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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 3 Apr 2013 18:21:43 +0200
From:	Linus Walleij <linus.walleij@...aro.org>
To:	Bibek Basu <bbasu@...dia.com>
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 Thu, Mar 28, 2013 at 6:11 PM, Bibek Basu <bbasu@...dia.com> wrote:

Hm I recognize this name :-)

> 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?

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