[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aEgBGup553Pki98e@smile.fi.intel.com>
Date: Tue, 10 Jun 2025 12:55:38 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Anup Patel <apatel@...tanamicro.com>
Cc: Michael Turquette <mturquette@...libre.com>,
Stephen Boyd <sboyd@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Jassi Brar <jassisinghbrar@...il.com>,
Thomas Gleixner <tglx@...utronix.de>,
"Rafael J . Wysocki" <rafael@...nel.org>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Linus Walleij <linus.walleij@...aro.org>,
Bartosz Golaszewski <brgl@...ev.pl>,
Uwe Kleine-König <ukleinek@...nel.org>,
Palmer Dabbelt <palmer@...belt.com>,
Paul Walmsley <paul.walmsley@...ive.com>,
Len Brown <lenb@...nel.org>, Sunil V L <sunilvl@...tanamicro.com>,
Rahul Pathak <rpathak@...tanamicro.com>,
Leyfoon Tan <leyfoon.tan@...rfivetech.com>,
Atish Patra <atish.patra@...ux.dev>,
Andrew Jones <ajones@...tanamicro.com>,
Samuel Holland <samuel.holland@...ive.com>,
Anup Patel <anup@...infault.org>, linux-clk@...r.kernel.org,
devicetree@...r.kernel.org, linux-riscv@...ts.infradead.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 07/23] mailbox: Add RISC-V SBI message proxy (MPXY)
based mailbox driver
On Tue, Jun 10, 2025 at 10:05:27AM +0530, Anup Patel wrote:
> On Tue, Jun 10, 2025 at 1:34 AM Andy Shevchenko
> <andriy.shevchenko@...ux.intel.com> wrote:
> > On Mon, Jun 09, 2025 at 05:59:40PM +0530, Anup Patel wrote:
> > > On Wed, May 28, 2025 at 4:23 PM Andy Shevchenko
> > > <andriy.shevchenko@...ux.intel.com> wrote:
> > > > On Sun, May 25, 2025 at 02:16:54PM +0530, Anup Patel wrote:
...
> > > > > + if (mbox->msi_count)
> > > >
> > > > Is this check really needed?
> > >
> > > MSIs are optional for the SBI MPXY mailbox so we should only use
> > > platform_device_msi_xyz() APIs only when MSIs are available.
> >
> > > > > + platform_device_msi_free_irqs_all(mbox->dev);
> >
> > Hmm... I am not sure why. Do you have any Oops or warnings if the check
> > is not there and no MSI provided?
>
> We don't see any oops or warnings. This check is to avoid unnecessary
> work (such as acquiring lock, checking default domain, etc) in the
> msi_domain_free_irqs_all() called by platform_device_msi_free_irqs_all().
>
> I don't mind dropping the check so I will update in the next revision.
Perhaps you can rather add this check into the callee? Seems to me that
you have a justification for it. Usual pattern in the kernel that freeing
resources should be aware of the NULL pointers or optional resources
so we may call it unconditionally from the user(s).
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists