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-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 26 Dec 2017 18:20:38 +0800
From:   Dong Aisheng <dongas86@...il.com>
To:     Peng Fan <peng.fan@....com>
Cc:     Shawn Guo <shawnguo@...nel.org>,
        "A.s. Dong" <aisheng.dong@....com>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Russell King <linux@...linux.org.uk>,
        Fabio Estevam <fabio.estevam@....com>,
        Sascha Hauer <kernel@...gutronix.de>,
        "van.freenix@...il.com" <van.freenix@...il.com>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH] arm: imx: suspend/resume: use outer_disable/resume

On Tue, Dec 26, 2017 at 10:11:41AM +0000, Peng Fan wrote:
> 
> Hi Aisheng,
> 
> > -----Original Message-----
> > From: Dong Aisheng [mailto:dongas86@...il.com]
> > Sent: Tuesday, December 26, 2017 6:04 PM
> > To: Peng Fan <peng.fan@....com>
> > Cc: Shawn Guo <shawnguo@...nel.org>; A.s. Dong <aisheng.dong@....com>;
> > linux-kernel@...r.kernel.org; Russell King <linux@...linux.org.uk>; Fabio
> > Estevam <fabio.estevam@....com>; Sascha Hauer <kernel@...gutronix.de>;
> > van.freenix@...il.com; linux-arm-kernel@...ts.infradead.org
> > Subject: Re: [PATCH] arm: imx: suspend/resume: use outer_disable/resume
> > 
> > On Tue, Dec 26, 2017 at 09:49:01AM +0000, Peng Fan wrote:
> > > Hi Shawn
> > >
> > > > -----Original Message-----
> > > > From: Shawn Guo [mailto:shawnguo@...nel.org]
> > > > Sent: Tuesday, December 26, 2017 5:13 PM
> > > > To: Peng Fan <peng.fan@....com>
> > > > Cc: A.s. Dong <aisheng.dong@....com>; linux-kernel@...r.kernel.org;
> > > > Russell King <linux@...linux.org.uk>; Fabio Estevam
> > > > <fabio.estevam@....com>; Sascha Hauer <kernel@...gutronix.de>;
> > > > van.freenix@...il.com; linux-arm- kernel@...ts.infradead.org
> > > > Subject: Re: [PATCH] arm: imx: suspend/resume: use
> > > > outer_disable/resume
> > > >
> > > > On Sun, Dec 10, 2017 at 08:07:18PM +0800, Peng Fan wrote:
> > > > > Use outer_disable/resume for suspend/resume.
> > > > > With the two APIs used, code could be simplified and easy to
> > > > > extend to introduce l2c_write_sec for i.MX platforms when moving
> > > > > Linux Kernel runs in non-secure world.
> > > > >
> > > > > Signed-off-by: Peng Fan <peng.fan@....com>
> > > > > Cc: Shawn Guo <shawnguo@...nel.org>
> > > > > Cc: Sascha Hauer <kernel@...gutronix.de>
> > > > > Cc: Fabio Estevam <fabio.estevam@....com>
> > > > > Cc: Russell King <linux@...linux.org.uk>
> > > > > Cc: Dong Aisheng <aisheng.dong@....com>
> > > >
> > > > Changed 'arm: ' prefix to 'ARM: ', and applied patch.
> > >
> > > I just tested it on 6sx-sdb, seems this patch breaks 6sx. Could you
> > > first drop this patch? I'll send out v2 fix the 6sx issue soon.
> > >
> > 
> > Yes, i tested mx6ul/mx6sl ok but mx6sx sdb failed.
> 
> Thanks for the test.
> 
> > 
> > After a few debug, it seems you removed the l2c310_early_resume in
> > v7_cpu_resume which is shared between lower power idle and suspend.
> > 
> > Current only mx6sx/mx6ul supports low power idle in upstream, but mx6ul is
> > A7 with internal L2, that's probably why only mx6sx showed the issue.
> > 
> > I did the following quick try to restore L2 after exit lower power idle, but still
> > can meet occasional crash during booting.
> > 
> > diff --git a/arch/arm/mach-imx/cpuidle-imx6sx.c b/arch/arm/mach-
> > imx/cpuidle-imx6sx.c
> > index c5a5c3a..edce5bd 100644
> > --- a/arch/arm/mach-imx/cpuidle-imx6sx.c
> > +++ b/arch/arm/mach-imx/cpuidle-imx6sx.c
> > @@ -26,7 +26,7 @@ static int imx6sx_idle_finish(unsigned long val)
> >          * to adding conditional code for L2 cache type,
> >          * just call flush_cache_all() is fine.
> >          */
> > -       flush_cache_all();
> > +//     flush_cache_all();
> 
> I think flush_cache_all is still needed, to flush L1 data, right?
> 

I thought it will be done in generic cpu_suspend.
See: __cpu_suspend_save()

So we still need it?


Regards
Dong Aisheng
> >         cpu_do_idle();
> > 
> >         return 0;
> > @@ -49,7 +49,9 @@ static int imx6sx_enter_wait(struct cpuidle_device *dev,
> >                 cpu_pm_enter();
> >                 cpu_cluster_pm_enter();
> > 
> > +               outer_disable();
> >                 cpu_suspend(0, imx6sx_idle_finish);
> > +               outer_resume();
> 
> Yes, this is in my V2 patch.
> 
> > 
> >                 cpu_cluster_pm_exit();
> >                 cpu_pm_exit();
> > 
> > As this changed the order to L2 restore and cpu resume, so i'm not quite sure if
> > lower power idle still requres L2 restore before CPU resume or something else
> > we're missing.
> 
> In low power idle, L2 may also lose power, so outer_disable/resume is needed, I think.
> 
> Thanks,
> Peng.
> 
> > 
> > Regards
> > Dong Aisheng
> > 
> > > Thanks,
> > > Peng.
> > >
> > > >
> > > > Shawn

Powered by blists - more mailing lists