lkml.org 
[lkml]   [2020]   [Jun]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] cpufreq: dt: fix oops on armada37xx
On Sat, Jun 20, 2020 at 07:54:38PM +0200, Andrew Lunn wrote:
> On Sat, Jun 20, 2020 at 05:44:49PM +0100, Ivan Kokshaysky wrote:
> > Commit 0c868627e617e43a295d8 (cpufreq: dt: Allow platform specific
> > intermediate callbacks) added two function pointers to the
> > struct cpufreq_dt_platform_data. However, armada37xx_cpufreq_driver_init()
> > has this struct (pdata) located on the stack and uses only "suspend"
> > and "resume" fields. So these newly added "get_intermediate" and
> > "target_intermediate" pointers are uninitialized and contain arbitrary
> > non-null values, causing all kinds of trouble.
> >
> > For instance, here is an oops on espressobin after an attempt to change
> > the cpefreq governor:
> >
> > [ 29.174554] Unable to handle kernel execute from non-executable memory at virtual address ffff00003f87bdc0
> > ...
> > [ 29.269373] pc : 0xffff00003f87bdc0
> > [ 29.272957] lr : __cpufreq_driver_target+0x138/0x580
> > ...
> >
> > Fixed by zeroing out pdata before use.
> >
> > Signed-off-by: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
>
> Hi Ivan
>
> A Fixes: tag would be good.

Hi Andrew,

I'm not sure that "Fixes:" would be appropriate here - commit 0c868627e617
is fine by itself, it just revealed a bug in older code.

Thanks for reviewing,
Ivan.

> Reviewed-by: Andrew Lunn <andrew@lunn.ch>
>
> Andrew

\
 
 \ /
  Last update: 2020-06-20 21:11    [W:1.663 / U:0.172 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site