[PATCH v3] ARM: imx6q: cpuidle: fix bug that CPU might not wake up at expected time

Peng Fan peng.fan at nxp.com
Wed Mar 6 06:36:56 PST 2019



> -----Original Message-----
> From: Kohji Okuno [mailto:okuno.kohji at jp.panasonic.com]
> Sent: 2019年3月5日 18:38
> To: shawnguo at kernel.org
> Cc: linux-arm-kernel at lists.infradead.org; s.hauer at pengutronix.de;
> kernel at pengutronix.de; Fabio Estevam <fabio.estevam at nxp.com>;
> dl-linux-imx <linux-imx at nxp.com>; okuno.kohji at jp.panasonic.com
> Subject: Re: [PATCH v3] ARM: imx6q: cpuidle: fix bug that CPU might not wake
> up at expected time
> 
> Hi Shawn,
> 
> I found the fix of the same issue on linux-imx repository. Could you refer to
> the following?
> 
> https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fsour
> ce.codeaurora.org%2Fexternal%2Fimx%2Flinux-imx%2Fcommit%2F%3Fh%3D
> imx_4.1.y_brillo%26id%3Df739483488ef76979c06efea397237756bec45b9&a
> mp;data=02%7C01%7Cpeng.fan%40nxp.com%7Cf02b29e33b2c4245a60d08d
> 6a156ad72%7C686ea1d3bc2b4c6fa92cd99c5c301635%7C0%7C0%7C636873
> 790983230223&sdata=QM21UkcAUjjZq3kPdZEgrkCxvFTneGRH7%2BlQg
> GJNHoU%3D&reserved=0
> 
> Regarding the fix of cpuidle-imx6q.c, my fix is better, I think.
> But, we may also need to modify pm-imx6.c.
> 
> # I cannot understand why they doesn't release their modifications.

This patch has been tried to upstream long time ago, https://lkml.org/lkml/2017/12/30/65

Regards,
Peng

> 
> Best regards,
>  Kohji Okuno
> 
> Shawn Guo <shawnguo at kernel.org> wrote:
> > On Tue, Feb 26, 2019 at 11:34:13AM +0900, Kohji Okuno wrote:
> >>  In the current cpuidle implementation for i.MX6q, the CPU that sets
> >> 'WAIT_UNCLOCKED' and the CPU that returns to 'WAIT_CLOCKED' are
> >> always the same. While the CPU that sets 'WAIT_UNCLOCKED' is in IDLE
> >> state of "WAIT", if the other CPU wakes up and enters IDLE state of "WFI"
> >> istead of "WAIT", this CPU can not wake up at expired time.
> >>  Because, in the case of "WFI", the CPU must be waked up by the local
> >> timer interrupt. But, while 'WAIT_UNCLOCKED' is set, the local timer
> >> is stopped, when all CPUs execute "wfi" instruction. As a result, the
> >> local timer interrupt is not fired.
> >>  In this situation, this CPU will wake up by IRQ different from local
> >> timer. (e.g. broacast tiemr)
> >
> > s/tiemr/timer
> >
> >>
> >> So, this fix changes CPU to return to 'WAIT_CLOCKED'.
> >>
> >> Signed-off-by: Kohji Okuno <okuno.kohji at jp.panasonic.com>
> >
> > Applied the patch with following Fixes tag.
> >
> > Fixes: e5f9dec8ff5f ("ARM: imx6q: support WAIT mode using cpuidle")
> >
> > Thanks for the fixing.
> >
> > Shawn


More information about the linux-arm-kernel mailing list