lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8ac2ed36a85f854a54ee1d05599891632087869d.camel@ti.com>
Date: Mon, 17 Nov 2025 14:53:00 +0530
From: Siddharth Vadapalli <s-vadapalli@...com>
To: Arnd Bergmann <arnd@...db.de>
CC: Lorenzo Pieralisi <lpieralisi@...nel.org>, Krzysztof
 WilczyƄski <kwilczynski@...nel.org>, Manivannan Sadhasivam
	<mani@...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, 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.

On the other hand, if it should be fixed the right way by refactoring, I
will not post the temporary fix. Please let me know.

Regards,
Siddharth.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ