[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vd8ODnr+GE0kxvZ+anR31Fyou9g-zT6HC7BSARhoKD4vg@mail.gmail.com>
Date: Wed, 19 Nov 2025 16:05:12 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Jisheng Zhang <jszhang@...nel.org>
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 3:17 PM Jisheng Zhang <jszhang@...nel.org> wrote:
> 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.
It's possible, but it will require some other refactoring most likely.
...
> 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
This is a good point. Was it mentioned in the commit message?
...
Okay, I am not going to tag this patch, I leave it for Bart to decide,
but I don't like the idea of blowing the run-time memory footprint
just because we may need it in CONFIG_PM=y case.
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists