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] [day] [month] [year] [list]
Date:	Tue, 23 Apr 2013 23:22:33 +0530
From:	Bibek Basu <bbasu@...dia.com>
To:	Linus Walleij <linus.walleij@...aro.org>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Pritesh Raithatha <praithatha@...dia.com>
Subject: RE: [PATCH] pinctrl: tegra: add suspend-resume support

On 23/04/2013 11:25 PM, Bibek Basu wrote:
> -----Original Message-----
> From: Linus Walleij [mailto:linus.walleij@...aro.org]
> Sent: Wednesday, April 03, 2013 9:52 PM
> To: Bibek Basu
> Cc: linux-kernel@...r.kernel.org; Pritesh Raithatha
> Subject: Re: [PATCH] pinctrl: tegra: add suspend-resume support
> 
> On Thu, Mar 28, 2013 at 6:11 PM, Bibek Basu <bbasu@...dia.com> wrote:
> 
> Hm I recognize this name :-)
> 
You recognized me correctly. After all it's a small world:-)
> > This patch adds suspend and resume callbacks to the pinctrl-tegra driver.
> 
> Please be more verbose. How is this achieved? I have to guess what the code
> is doing..
> 
> > +#ifdef CONFIG_PM_SLEEP
> > +
> > +static int pinctrl_suspend(void)
> > +{
> > +       int i, j;
> > +       u32 *pg_data = pmx->pg_data;
> > +       u32 *regs;
> > +
> > +       for (i = 0; i < pmx->nbanks; i++) {
> > +               regs = pmx->regs[i];
> > +               for (j = 0; j < pmx->regs_size[i] / 4; j++)
> > +                       *pg_data++ = readl(regs++);
> > +       }
> > +       return 0;
> > +}
> > +
> > +static void pinctrl_resume(void)
> > +{
> > +       int i, j;
> > +       u32 *pg_data = pmx->pg_data;
> > +       u32 *regs;
> > +
> > +       for (i = 0; i < pmx->nbanks; i++) {
> > +               regs = pmx->regs[i];
> > +               for (j = 0; j < pmx->regs_size[i] / 4; j++)
> > +                       writel(*pg_data++, regs++);
> > +       }
> > +}
> > +
> > +static struct syscore_ops pinctrl_syscore_ops = {
> > +       .suspend = pinctrl_suspend,
> > +       .resume = pinctrl_resume,
> > +};
> > +
> > +#endif
> (...)
> > +#ifdef CONFIG_PM_SLEEP
> > +       register_syscore_ops(&pinctrl_syscore_ops);
> > +#endif
> 
> So Stephen already commented that syscore ops is maybe too big a
> sledgehammer for a fine-granular problem.
> 
> I mainly want to know what is happening above, it looks like a state
> save/restore for all registers or something like this?
> 
Yeah, patch mainly saves and restores the registers.
I am re-pushing the patch after incorporating stephen's changes.

regards
Bibek
> Yours,
> Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ