Linux PCI subsystem development
 help / color / mirror / Atom feed
From: Siddharth Vadapalli <s-vadapalli@ti.com>
To: "Arnd Bergmann" <arnd@arndb.de>,
	"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>
Cc: <stable@vger.kernel.org>, <linux-pci@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <srk@ti.com>,
	<s-vadapalli@ti.com>
Subject: Re: [PATCH] PCI: cadence: Kconfig: change PCIE_CADENCE configs from tristate to bool
Date: Fri, 14 Nov 2025 11:17:08 +0530	[thread overview]
Message-ID: <250d2b94d5785e70530200e00c1f0f46fde4311b.camel@ti.com> (raw)
In-Reply-To: <084b804f-2999-4f8d-8372-43cfbf0c0d28@app.fastmail.com>

On Thu, 2025-11-13 at 11:13 +0100, Arnd Bergmann wrote:

Hello Arnd,

> On Thu, Nov 13, 2025, at 10:27, Siddharth Vadapalli wrote:
> > The drivers associated with the PCIE_CADENCE, PCIE_CADENCE_HOST AND
> > PCIE_CADENCE_EP configs are used by multiple vendor drivers and serve as a
> > library of helpers. Since the vendor drivers could individually be built
> > as built-in or as loadable modules, it is possible to select a build
> > configuration wherein a vendor driver is built-in while the library is
> > built as a loadable module. This will result in a build error as reported
> > in the 'Closes' link below.
> > 
> > Address the build error by changing the library configs to be 'bool'
> > instead of 'tristate'.
> > 
> > Reported-by: kernel test robot <lkp@intel.com>
> > Closes: 
> > https://lore.kernel.org/oe-kbuild-all/202511111705.MZ7ls8Hm-lkp@intel.com/
> > Fixes: 1c72774df028 ("PCI: sg2042: Add Sophgo SG2042 PCIe driver")
> > Cc: <stable@vger.kernel.org>
> > Signed-off-by: Siddharth Vadapalli <s-vadapalli@ti.com>
> 
> I really think there has to be a better solution here, this is not
> an unusual problem.
> 
> > @@ -4,16 +4,16 @@ menu "Cadence-based PCIe controllers"
> >  	depends on PCI
> > 
> >  config PCIE_CADENCE
> > -	tristate
> > +	bool
> > 
> >  config PCIE_CADENCE_HOST
> > -	tristate
> > +	bool
> >  	depends on OF
> >  	select IRQ_DOMAIN
> >  	select PCIE_CADENCE
> > 
> >  config PCIE_CADENCE_EP
> > -	tristate
> > +	bool
> >  	depends on OF
> >  	depends on PCI_ENDPOINT
> >  	select PCIE_CADENCE
> 
> I think the easiest way would be to leave PCIE_CADENCE as
> a 'tristate' symbol but make the other two 'bool', and then
> adjust the Makefile logic to use CONFIG_PCIE_CADENCE as
> the thing that controls how the individual drivers are built.
> 
> That way, if any platform specific driver is built-in, both
> the EP and HOST support are built-in or disabled but never
> loadable modules. As long as all platform drivers are
> loadable modules, so would be the base support.

Thank you for the suggestion. I think that the following Makefile changes
will be sufficient and Kconfig doesn't need to be modified:

diff --git a/drivers/pci/controller/cadence/Makefile
b/drivers/pci/controller/cadence/Makefile
index 5e23f8539ecc..1a97c9b249b8 100644
--- a/drivers/pci/controller/cadence/Makefile
+++ b/drivers/pci/controller/cadence/Makefile
@@ -4,4 +4,6 @@ obj-$(CONFIG_PCIE_CADENCE_HOST) += pcie-cadence-host.o
 obj-$(CONFIG_PCIE_CADENCE_EP) += pcie-cadence-ep.o
 obj-$(CONFIG_PCIE_CADENCE_PLAT) += pcie-cadence-plat.o
 obj-$(CONFIG_PCI_J721E) += pci-j721e.o
+pci_j721e-y := pci-j721e.o pcie-cadence.o
 obj-$(CONFIG_PCIE_SG2042_HOST) += pcie-sg2042.o
+pci_sg2042_host-y := pci-sg2042.o pcie-cadence.o

If either of PCI_J721E or SG2042_HOST is selected as a built-in module,
then pcie-cadence-host.c, pcie-cadence-ep.c and pcie-cadence.c drivers will
be built-in. If both PCI_J721E and SG2042_HOST are selected as loadable
modules, only then the library drivers will be enabled as loadable modules.

Please let me know what you think.

Regards,
Siddharth.

  reply	other threads:[~2025-11-14  5:47 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 [this message]
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
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=250d2b94d5785e70530200e00c1f0f46fde4311b.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