Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Siddharth Vadapalli <s-vadapalli@ti.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: "Lorenzo Pieralisi" <lpieralisi@kernel.org>,
	"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
	"Manivannan Sadhasivam" <mani@kernel.org>,
	"Rob Herring" <robh@kernel.org>,
	bhelgaas@google.com, "Chen Wang" <unicorn_wang@outlook.com>,
	"Kishon Vijay Abraham I" <kishon@kernel.org>,
	stable@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, srk@ti.com
Subject: Re: [PATCH] PCI: cadence: Kconfig: change PCIE_CADENCE configs from tristate to bool
Date: Mon, 17 Nov 2025 14:53:00 +0530	[thread overview]
Message-ID: <8ac2ed36a85f854a54ee1d05599891632087869d.camel@ti.com> (raw)
In-Reply-To: <37f6f8ce-12b2-44ee-a94c-f21b29c98821@app.fastmail.com>

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.

  reply	other threads:[~2025-11-17  9:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-13  9:27 [PATCH] PCI: cadence: Kconfig: change PCIE_CADENCE configs from tristate to bool Siddharth Vadapalli
2025-11-13 10:13 ` Arnd Bergmann
2025-11-14  5:47   ` Siddharth Vadapalli
2025-11-14  7:03     ` Arnd Bergmann
2025-11-17  6:05       ` Siddharth Vadapalli
2025-11-17  9:06         ` Arnd Bergmann
2025-11-17  9:23           ` Siddharth Vadapalli [this message]
2025-11-17  9:28             ` Manivannan Sadhasivam
2025-11-17  9:42             ` Arnd Bergmann
2025-11-13 10:38 ` Hans Zhang
2025-11-13 10:43   ` Siddharth Vadapalli
2025-11-13 10:51     ` Hans Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ac2ed36a85f854a54ee1d05599891632087869d.camel@ti.com \
    --to=s-vadapalli@ti.com \
    --cc=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=kishon@kernel.org \
    --cc=kwilczynski@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=lpieralisi@kernel.org \
    --cc=mani@kernel.org \
    --cc=robh@kernel.org \
    --cc=srk@ti.com \
    --cc=stable@vger.kernel.org \
    --cc=unicorn_wang@outlook.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox