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]
Message-ID: <aR2_GVi6E5gLeS47@xhacker>
Date: Wed, 19 Nov 2025 20:59:05 +0800
From: Jisheng Zhang <jszhang@...nel.org>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: 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 v2 01/15] gpio: dwapb: Use modern PM macros

On Wed, Nov 19, 2025 at 08:42:05PM +0800, Jisheng Zhang wrote:
> On Tue, Nov 18, 2025 at 12:15:35PM +0200, Andy Shevchenko wrote:
> > On Tue, Nov 18, 2025 at 2:50 AM Jisheng Zhang <jszhang@...nel.org> 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.
> > >
> > > The dwapb_context structure is always embedded into struct
> > > dwapb_gpio_port to simplify code. Sure this brings a tiny 36 bytes
> > > data overhead for !CONFIG_PM_SLEP. After greping the arm/arm64/riscv
> > 
> > SLEEP
> > grepping
> > 
> > > dts dir, the max port number is 6, the berlin2q soc families, so this
> > > means current we have wasted 216 bytes memory which is trivial
> > 
> > currently
> > 
> > > compared to the system memory.
> > 
> > I still think the embedding is not related to this change and should
> > be justified in a separate patch. W/o that part the rest looks fine.
> 
> I got your mind now: it looks like you prefer a seperate patch for the
> embedding. Let me explain why I have the embedding within this patch:
> the pm_ptr() or pm_sleep_ptr() just optimizes out the PM functions, but the
> PM funtions are still compiled, so w/o the embedding, it's impossible
> to clean up the code with the modern PM macros.

For dwapb, I can still acchieve the clean up w/ only embedding the
pointer. But I'm not sure whether embedding the struture deserve a seperate
patch.

BTW: as Michael mentioned during v1 review, the driver allocates the
struct with kzalloc and stores a pointer to it, so considering the
pointer itself and the kmalloc overhead/alignment etc, current gpio-dwapb
have an overhead in the same order of magnitude when PM=y

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ