[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aKe9C50Q3uHbdI4Y@xhacker>
Date: Fri, 22 Aug 2025 08:42:51 +0800
From: Jisheng Zhang <jszhang@...nel.org>
To: Andy Shevchenko <andy.shevchenko@...il.com>
Cc: Michael Büsch <mb@...s.ch>,
Doug Berger <opendmb@...il.com>,
Florian Fainelli <florian.fainelli@...adcom.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>, Michael Buesch <m@...s.ch>,
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>,
Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
linux-gpio@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, linux-omap@...r.kernel.org,
linux@...tq-group.com
Subject: Re: [PATCH 01/16] gpio: dwapb: Use modern PM macros
On Thu, Aug 21, 2025 at 10:32:01PM +0300, Andy Shevchenko wrote:
> On Thu, Aug 21, 2025 at 8:02 PM Jisheng Zhang <jszhang@...nel.org> wrote:
> > On Wed, Aug 20, 2025 at 10:04:39PM +0300, Andy Shevchenko wrote:
> > > On Wed, Aug 20, 2025 at 8:11 PM Michael Büsch <mb@...s.ch> wrote:
> > > > On Wed, 20 Aug 2025 19:54:44 +0300
> > > > Andy Shevchenko <andy.shevchenko@...il.com> wrote:
> > > >
> > > > > > 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.
> > > > >
> > > > > I don't think it's a good approach to add a lot of data for peanuts in
> > > > > case of PM_SLEEP=n.
> > > >
> > > > It wastes 36 bytes in case of PM=n.
> > >
> > > ...per port.
> > >
> > > > The driver currently allocates the struct with kzalloc and stores a pointer to it
> > > > in case of PM=y.
> > > > So this probably has an overhead in the same order of magnitude (pointer +
> > > > malloc overhead/alignment/fragmentation) in case of PM=y now.
> > >
> > > ...per driver.
> >
> > Before the patch, struct dwapb_context *ctx is also per port.
>
> OK. So the comparison is 4 or 8 bytes per port vs. 36 bytes per port, correct?
yep, I think so
>
> > > So, I can't say it's equal, but I leave this to maintainers to decide,
> >
> > What in my mind now: this is linux rather than RTOS. After greping the
> > the arm/arm64/riscv 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 compared to the system memory.
>
> Maybe, but this should be clarified in the commit message. And again,
> I have no strong objection on this part, but it needs to be described
> accurately at bare minimum.
Good idea, will do in v2.
>
> --
> With Best Regards,
> Andy Shevchenko
Powered by blists - more mailing lists