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]
Message-ID: <CAHp75VdW1JDPmFm2Vt=j20BKf7V+yOdoaQG=sBYKdL0OGj-Bzg@mail.gmail.com>
Date: Thu, 20 Nov 2025 09:01:48 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Jisheng Zhang <jszhang@...nel.org>
Cc: Andy Shevchenko <andriy.shevchenko@...el.com>, Doug Berger <opendmb@...il.com>, 
	Florian Fainelli <florian.fainelli@...adcom.com>, bcm-kernel-feedback-list@...adcom.com, 
	Linus Walleij <linus.walleij@...aro.org>, Bartosz Golaszewski <brgl@...ev.pl>, 
	Hoan Tran <hoan@...amperecomputing.com>, Andy Shevchenko <andy@...nel.org>, 
	Daniel Palmer <daniel@...ngy.jp>, Romain Perier <romain.perier@...il.com>, 
	Grygorii Strashko <grygorii.strashko@...com>, Santosh Shilimkar <ssantosh@...nel.org>, 
	Kevin Hilman <khilman@...nel.org>, Robert Jarzmik <robert.jarzmik@...e.fr>, 
	Kunihiko Hayashi <hayashi.kunihiko@...ionext.com>, Masami Hiramatsu <mhiramat@...nel.org>, 
	Shubhrajyoti Datta <shubhrajyoti.datta@....com>, Srinivas Neeli <srinivas.neeli@....com>, 
	Michal Simek <michal.simek@....com>, linux-gpio@...r.kernel.org, 
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org, 
	linux-omap@...r.kernel.org
Subject: Re: [PATCH v4 05/15] gpio: pxa: Use modern PM macros

On Thu, Nov 20, 2025 at 2:42 AM Jisheng Zhang <jszhang@...nel.org> wrote:
> On Wed, Nov 19, 2025 at 07:41:44PM +0200, Andy Shevchenko wrote:
> > On Thu, Nov 20, 2025 at 12:33:17AM +0800, Jisheng Zhang wrote:
> > > Use the modern PM macros for the suspend and resume functions to be
> > > automatically dropped by the compiler when CONFIG_PM or
> > > CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> > >
> > > This has the advantage of always compiling these functions in,
> > > independently of any Kconfig option. Thanks to that, bugs and other
> > > regressions are subsequently easier to catch.

...

> > >  static struct syscore_ops pxa_gpio_syscore_ops = {
> > > -   .suspend        = pxa_gpio_suspend,
> > > -   .resume         = pxa_gpio_resume,
> > > +   .suspend        = pm_ptr(pxa_gpio_suspend),
> > > +   .resume         = pm_ptr(pxa_gpio_resume),
> > >  };
> >
> > I believe this needs to be thoroughly checked and thought through as
> > this is *not* a dev_pm_ops.
>
> pm_ptr()/pm_sleep_ptr() is defined in pm.h, so I think we can make use
> of it for syscore_ops as well.
> E.g This patch makes use of pm_ptr() to optimize out .suspend/.resume when !PM
> while get in them when PM. Thus the same result can be acchieved between
> before and after this patch.

At bare minimum this should be mentioned in the commit message that
you were/are aware of the data type differences.

-- 
With Best Regards,
Andy Shevchenko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ