[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251006194241.GA537937@bhelgaas>
Date: Mon, 6 Oct 2025 14:42:41 -0500
From: Bjorn Helgaas <helgaas@...nel.org>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
Cc: Linus Walleij <linus.walleij@...aro.org>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof Wilczyński <kwilczynski@...nel.org>,
Manivannan Sadhasivam <mani@...nel.org>,
Rob Herring <robh@...nel.org>, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, Bjorn Helgaas <bhelgaas@...gle.com>
Subject: Re: [PATCH] PCI: ixp4xx: Guard ARM32-specific hook_fault_code()
On Tue, Sep 30, 2025 at 09:50:40PM +0100, Russell King (Oracle) wrote:
> On Tue, Sep 30, 2025 at 08:59:36PM +0200, Linus Walleij wrote:
> > On Thu, Sep 25, 2025 at 10:27 PM Bjorn Helgaas <helgaas@...nel.org> wrote:
> > > hook_fault_code() is an ARM32-specific API. Guard it and related code with
> > > CONFIG_ARM #ifdefs so the driver can be compile tested on other
> > > architectures.
> > >
> > > Signed-off-by: Bjorn Helgaas <bhelgaas@...gle.com>
> >
> > It looks OK to me
> > Acked-by: Linus Walleij <linus.walleij@...ar.org>
> >
> > I see some other ARM32 drivers use it too, but we surely do
> > not have a arch-agnostic way of handling bus errors so perhaps it
> > need to be like this.
> >
> > I think Russell created the fault hooks originally so CC:ing him
> > in.
>
> I wonder what the point of compile testing if it needs code to be
> #ifdef'd out.
We can still catch errors in the bulk of the drivers.
> Wouldn't it be better to add something like:
>
> #ifndef CONFIG_ARM
> static inline void hook_fault_code(int n, int (*fn)(unsigned long, unsigned int,
> struct pt_regs *),
> int sig, int code, const char *name)
> {
> }
> #endif
>
> maybe to a local header that pci-imx6, pci-keystone, pcie-rcar-host
> and pci-ixp4xx can all share?
I guess we could put a stub like that in drivers/pci/pci.h. But all
these drivers also have other CONFIG_ARM #ifdefs for the
hook_fault_code() *handlers*, so I'm not sure it's any better to
remove one #ifdef and leave the other.
Powered by blists - more mailing lists