[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <k4yatufwwibauqxmm2nv6bh4clckk2j2xnpc2o5zjjpk7j7phk@ihrd2rsqdm64>
Date: Mon, 17 Nov 2025 14:58:58 +0530
From: Manivannan Sadhasivam <mani@...nel.org>
To: Siddharth Vadapalli <s-vadapalli@...com>
Cc: Arnd Bergmann <arnd@...db.de>,
Lorenzo Pieralisi <lpieralisi@...nel.org>, Krzysztof Wilczyński <kwilczynski@...nel.org>,
Rob Herring <robh@...nel.org>, bhelgaas@...gle.com, Chen Wang <unicorn_wang@...look.com>,
Kishon Vijay Abraham I <kishon@...nel.org>, stable@...r.kernel.org, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, srk@...com
Subject: Re: [PATCH] PCI: cadence: Kconfig: change PCIE_CADENCE configs from
tristate to bool
On Mon, Nov 17, 2025 at 02:53:00PM +0530, Siddharth Vadapalli wrote:
> On Mon, 2025-11-17 at 10:06 +0100, Arnd Bergmann wrote:
> > On Mon, Nov 17, 2025, at 07:05, Siddharth Vadapalli wrote:
> > > On Fri, 2025-11-14 at 08:03 +0100, Arnd Bergmann wrote:
> > > > On Fri, Nov 14, 2025, at 06:47, Siddharth Vadapalli wrote:
> >
> > > I understand that the solution should be fixing the pci-j721e.c driver
> > > rather than updating Kconfig or Makefile. Thank you for the feedback. I
> > > will update the pci-j721e.c driver to handle the case that is triggering
> > > the build error.
> >
> > Ok, thanks!
> >
> > I think a single if(IS_ENABLED(CONFIG_PCI_J721E_HOST)) check
> > is probably enough to avoid the link failure
> >
> > --- a/drivers/pci/controller/cadence/pci-j721e.c
> > +++ b/drivers/pci/controller/cadence/pci-j721e.c
> > @@ -669,7 +669,8 @@ static void j721e_pcie_remove(struct platform_device *pdev)
> > struct cdns_pcie_ep *ep;
> > struct cdns_pcie_rc *rc;
> >
> > - if (pcie->mode == PCI_MODE_RC) {
> > + if (IS_ENABLED(CONFIG_PCI_J721E_HOST) &&
> > + pcie->mode == PCI_MODE_RC) {
> > rc = container_of(cdns_pcie, struct cdns_pcie_rc, pcie);
> > cdns_pcie_host_disable(rc);
> >
> >
> > but you may want to split it up further to get better dead
> > code elimination and prevent similar bugs from reappearing when
> > another call gets added without this type of check.
> >
> > If you split j721e_pcie_driver into a host and an ep driver
> > structure with their own probe/remove callbacks, you can
> > move the IS_ENABLED() check all the way into module_init()
> > function.
>
> Thank you for the suggestion :)
>
> Would it work if I send a quick fix for `cdns_pcie_host_disable` using
> IS_ENABLED in the existing driver implementation and then send the
> refactoring series later? This is to resolve the build error quickly until
> the refactoring series is ready.
>
This will work for me so that this fix can be backported.
- Mani
--
மணிவண்ணன் சதாசிவம்
Powered by blists - more mailing lists