[PATCH 00/11] PCI: Keystone: Enable loadable module support

Siddharth Vadapalli posted 11 patches 4 weeks, 1 day ago
There is a newer version of this series
drivers/pci/controller/dwc/Kconfig            |   6 +-
drivers/pci/controller/dwc/pci-keystone.c     | 111 +++++++++++++++++-
.../pci/controller/dwc/pcie-designware-ep.c   |   1 +
.../pci/controller/dwc/pcie-designware-host.c |  10 ++
drivers/pci/controller/dwc/pcie-designware.h  |   5 +
drivers/pci/host-bridge.c                     |   1 +
include/linux/pci.h                           |   1 +
7 files changed, 127 insertions(+), 8 deletions(-)
[PATCH 00/11] PCI: Keystone: Enable loadable module support
Posted by Siddharth Vadapalli 4 weeks, 1 day ago
Hello,

This series enables support for the 'pci-keystone.c' driver to be built
as a loadable module. The motivation for the series is that PCIe is not
a necessity for booting Linux due to which the 'pci-keystone.c' driver
does not need to be built-in.

Series is based on linux-next tagged next-20250903.

Series has been tested on the AM654-IDK-EVM by validating module removal
and reprobe while connected to an Intel PCIe-Ethernet Adapter. Test Logs:
https://gist.github.com/Siddharth-Vadapalli-at-TI/dfd7821c187241d63098117eb7431a1b

Regards,
Siddharth.

Siddharth Vadapalli (11):
  PCI: Export pci_get_host_bridge_device() for use by pci-keystone
  PCI: dwc: Export dw_pcie_allocate_domains() for pci-keystone
  PCI: dwc: Add dw_pcie_free_domains() helper for cleanup
  PCI: dwc: ep: Export dw_pcie_ep_raise_msix_irq() for pci-keystone
  PCI: keystone: Add ks_pcie_free_msi_irq() helper for cleanup
  PCI: keystone: Add ks_pcie_free_intx_irq() helper for cleanup
  PCI: keystone: Add ks_pcie_host_deinit() helper for cleanup
  PCI: keystone: Add ks_pcie_disable_error_irq() helper for cleanup
  PCI: keystone: Switch to devm_request_irq() for "ks-pcie-error-irq"
    IRQ
  PCI: keystone: Exit ks_pcie_probe() for the default switch-case of
    "mode"
  PCI: keystone: Add support to build as a loadable module

 drivers/pci/controller/dwc/Kconfig            |   6 +-
 drivers/pci/controller/dwc/pci-keystone.c     | 111 +++++++++++++++++-
 .../pci/controller/dwc/pcie-designware-ep.c   |   1 +
 .../pci/controller/dwc/pcie-designware-host.c |  10 ++
 drivers/pci/controller/dwc/pcie-designware.h  |   5 +
 drivers/pci/host-bridge.c                     |   1 +
 include/linux/pci.h                           |   1 +
 7 files changed, 127 insertions(+), 8 deletions(-)

-- 
2.43.0
Re: [PATCH 00/11] PCI: Keystone: Enable loadable module support
Posted by Manivannan Sadhasivam 3 weeks, 4 days ago
On Wed, Sep 03, 2025 at 06:14:41PM GMT, Siddharth Vadapalli wrote:
> Hello,
> 
> This series enables support for the 'pci-keystone.c' driver to be built
> as a loadable module. The motivation for the series is that PCIe is not
> a necessity for booting Linux due to which the 'pci-keystone.c' driver
> does not need to be built-in.
> 

There are concerns from the irqchip maintainers that unloading an irqchip
controller is a bad idea. We had a lot of previous discussions on this topic.

But I would certainly welcome the idea of building a controller driver as a
module (tristate) and prevent unloading it during runtime (by keeping it as
builtin_platform_driver).

> Series is based on linux-next tagged next-20250903.
> 

No need to base your patches on top of linux-next. Either do it on top of -rc1
or pci/next.

- Mani

-- 
மணிவண்ணன் சதாசிவம்
Re: [PATCH 00/11] PCI: Keystone: Enable loadable module support
Posted by Siddharth Vadapalli 3 weeks, 3 days ago
On Mon, Sep 08, 2025 at 09:09:08AM +0530, Manivannan Sadhasivam wrote:
> On Wed, Sep 03, 2025 at 06:14:41PM GMT, Siddharth Vadapalli wrote:
> > Hello,
> > 
> > This series enables support for the 'pci-keystone.c' driver to be built
> > as a loadable module. The motivation for the series is that PCIe is not
> > a necessity for booting Linux due to which the 'pci-keystone.c' driver
> > does not need to be built-in.
> > 
> 
> There are concerns from the irqchip maintainers that unloading an irqchip
> controller is a bad idea. We had a lot of previous discussions on this topic.

Ok, I wasn't aware of this. Thank you for pointing this out.

> 
> But I would certainly welcome the idea of building a controller driver as a
> module (tristate) and prevent unloading it during runtime (by keeping it as
> builtin_platform_driver).

I will update the series to retain 'builtin_platform_driver' while
enabling tristate support. Since the intent of the series is primarily
to convert the driver to support being built as a loadable module, and
unloading it is only a secondary requirement which is optional, I agree
with your suggestion.

> 
> > Series is based on linux-next tagged next-20250903.
> > 
> 
> No need to base your patches on top of linux-next. Either do it on top of -rc1
> or pci/next.

I will keep this in mind when I post the v2 series.

Thank you for your feedback.

Regards,
Siddharth.