From: Michael Ellerman <mpe@ellerman.id.au>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Pratik Rajesh Sampat <psampat@linux.ibm.com>
Cc: linux-pm@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
linux-kernel@vger.kernel.org, pratik.r.sampat@gmail.com,
ego@linux.vnet.ibm.com, dja@axtens.net
Subject: Re: [PATCH] cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_work_fn
Date: Tue, 24 Mar 2020 17:34:56 +1100 [thread overview]
Message-ID: <87h7yexnu7.fsf@mpe.ellerman.id.au> (raw)
In-Reply-To: <1921198.IfoiWgUDIW@kreacher>
"Rafael J. Wysocki" <rjw@rjwysocki.net> writes:
> On Monday, March 16, 2020 2:57:43 PM CET Pratik Rajesh Sampat wrote:
>> The patch avoids allocating cpufreq_policy on stack hence fixing frame
>> size overflow in 'powernv_cpufreq_work_fn'
>>
>> Fixes: 227942809b52 ("cpufreq: powernv: Restore cpu frequency to policy->cur on unthrottling")
>> Signed-off-by: Pratik Rajesh Sampat <psampat@linux.ibm.com>
>
> Any objections or concerns here?
>
> If not, I'll queue it up.
I have it in my testing branch, but if you pick it up I can drop it.
cheers
>> diff --git a/drivers/cpufreq/powernv-cpufreq.c b/drivers/cpufreq/powernv-cpufreq.c
>> index 56f4bc0d209e..20ee0661555a 100644
>> --- a/drivers/cpufreq/powernv-cpufreq.c
>> +++ b/drivers/cpufreq/powernv-cpufreq.c
>> @@ -902,6 +902,7 @@ static struct notifier_block powernv_cpufreq_reboot_nb = {
>> void powernv_cpufreq_work_fn(struct work_struct *work)
>> {
>> struct chip *chip = container_of(work, struct chip, throttle);
>> + struct cpufreq_policy *policy;
>> unsigned int cpu;
>> cpumask_t mask;
>>
>> @@ -916,12 +917,14 @@ void powernv_cpufreq_work_fn(struct work_struct *work)
>> chip->restore = false;
>> for_each_cpu(cpu, &mask) {
>> int index;
>> - struct cpufreq_policy policy;
>>
>> - cpufreq_get_policy(&policy, cpu);
>> - index = cpufreq_table_find_index_c(&policy, policy.cur);
>> - powernv_cpufreq_target_index(&policy, index);
>> - cpumask_andnot(&mask, &mask, policy.cpus);
>> + policy = cpufreq_cpu_get(cpu);
>> + if (!policy)
>> + continue;
>> + index = cpufreq_table_find_index_c(policy, policy->cur);
>> + powernv_cpufreq_target_index(policy, index);
>> + cpumask_andnot(&mask, &mask, policy->cpus);
>> + cpufreq_cpu_put(policy);
>> }
>> out:
>> put_online_cpus();
>>
next prev parent reply other threads:[~2020-03-24 6:34 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-16 13:57 [PATCH] cpufreq: powernv: Fix frame-size-overflow in powernv_cpufreq_work_fn Pratik Rajesh Sampat
2020-03-17 22:30 ` Daniel Axtens
2020-03-19 10:18 ` Rafael J. Wysocki
2020-03-24 6:34 ` Michael Ellerman [this message]
2020-03-25 10:36 ` Rafael J. Wysocki
2020-03-20 10:37 ` Gautham R Shenoy
2020-03-26 12:06 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87h7yexnu7.fsf@mpe.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=dja@axtens.net \
--cc=ego@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=pratik.r.sampat@gmail.com \
--cc=psampat@linux.ibm.com \
--cc=rjw@rjwysocki.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).