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: <37f6f8ce-12b2-44ee-a94c-f21b29c98821@app.fastmail.com>
Date: Mon, 17 Nov 2025 10:06:57 +0100
From: "Arnd Bergmann" <arnd@...db.de>
To: "Siddharth Vadapalli" <s-vadapalli@...com>
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, 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.

     Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ