lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 15 Apr 2014 01:36:01 +0000 (GMT)
From:	ÇÔ¸íÁÖ <myungjoo.ham@...sung.com>
To:	Saravana Kannan <skannan@...eaurora.org>
Cc:	¹Ú°æ¹Î <kyungmin.park@...sung.com>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: Re: [PATCH] PM / devfreq: Use freq_table for available_frequencies

> MyungJoo/Kyungmin,
> 
> Bump. Can we accept this patch please?
> 
> -Saravana

Nack.

Please note that freq_table is also an optional value, which may
be null.

Besides, please be aware that your code is under rcu_read_lock().


Cheers,
MyungJoo.

ps. I'll send a related patch (avoid accessing null but not-an-error
pointer at other sysfs nodes). Thank you for letting me catch such bugs anyway.

> 
> 
> On 04/10/2014 07:54 PM, Saravana Kannan wrote:
> > Some devices use freq_table instead of OPP. For those devices, the
> > available_frequencies file shows up empty. Fix that by using freq_table to
> > generate the available_frequencies data when OPP is not present.
> >
> > Signed-off-by: Saravana Kannan <skannan@...eaurora.org>
> > ---
> >   drivers/devfreq/devfreq.c | 15 +++++++++++----
> >   1 file changed, 11 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> > index 2042ec3..a715d15 100644
> > --- a/drivers/devfreq/devfreq.c
> > +++ b/drivers/devfreq/devfreq.c
> > @@ -912,19 +912,26 @@ static ssize_t available_frequencies_show(struct device *d,
> >   	struct devfreq *df = to_devfreq(d);
> >   	struct device *dev = df->dev.parent;
> >   	struct dev_pm_opp *opp;
> > +	unsigned int i = 0, max_state = df->profile->max_state;
> > +	bool use_opp;
> >   	ssize_t count = 0;
> >   	unsigned long freq = 0;
> >
> >   	rcu_read_lock();
> > +	use_opp = dev_pm_opp_get_opp_count(dev) > 0;
> >   	do {
> > -		opp = dev_pm_opp_find_freq_ceil(dev, &freq);
> > -		if (IS_ERR(opp))
> > -			break;
> > +		if (use_opp) {
> > +			opp = dev_pm_opp_find_freq_ceil(dev, &freq);
> > +			if (IS_ERR(opp))
> > +				break;
> > +		} else {
> > +			freq = df->profile->freq_table[i++];
> > +		}
> >
> >   		count += scnprintf(&buf[count], (PAGE_SIZE - count - 2),
> >   				   "%lu ", freq);
> >   		freq++;
> > -	} while (1);
> > +	} while (use_opp || (!use_opp && i < max_state));
> >   	rcu_read_unlock();
> >
> >   	/* Truncate the trailing space */
> >
> 
> 
> -- 
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> hosted by The Linux Foundation
> 
> 
> 
>        
>   
>          
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ