[PATCH] PCI: eswin: Publish the platform driver's OF alias

hpp.iscas posted 1 patch 2 weeks, 6 days ago
drivers/pci/controller/dwc/pcie-eswin.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] PCI: eswin: Publish the platform driver's OF alias
Posted by hpp.iscas 2 weeks, 6 days ago
The ESWIN PCIe host controller is a platform driver matched through
eswin_pcie_of_match. PCIE_ESWIN is tristate, but the table is not
published for OF module autoloading.

Publish this platform-device table. Do not change the RISC-V host
initialization sequence or PCI device matching.

Fixes: b593c26d081a ("PCI: eswin: Add ESWIN PCIe Root Complex driver")
Signed-off-by: hpp.iscas <hppiscas@163.com>
---
 drivers/pci/controller/dwc/pcie-eswin.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/controller/dwc/pcie-eswin.c b/drivers/pci/controller/dwc/pcie-eswin.c
index ce8d64f..1bb4469 100644
--- a/drivers/pci/controller/dwc/pcie-eswin.c
+++ b/drivers/pci/controller/dwc/pcie-eswin.c
@@ -388,6 +388,7 @@ static const struct of_device_id eswin_pcie_of_match[] = {
 	{ .compatible = "eswin,eic7700-pcie", .data = &eswin_eic7700_data },
 	{}
 };
+MODULE_DEVICE_TABLE(of, eswin_pcie_of_match);
 
 static struct platform_driver eswin_pcie_driver = {
 	.probe = eswin_pcie_probe,
Re: [PATCH] PCI: eswin: Publish the platform driver's OF alias
Posted by Manivannan Sadhasivam 2 weeks, 6 days ago
On Sat, Sep 05, 2026 at 09:42:51PM +0800, hpp.iscas wrote:
> The ESWIN PCIe host controller is a platform driver matched through
> eswin_pcie_of_match. PCIE_ESWIN is tristate, but the table is not
> published for OF module autoloading.
> 
> Publish this platform-device table. Do not change the RISC-V host
> initialization sequence or PCI device matching.
> 
> Fixes: b593c26d081a ("PCI: eswin: Add ESWIN PCIe Root Complex driver")
> Signed-off-by: hpp.iscas <hppiscas@163.com>

As per Linux Kernel DCO, a real name is required for the submitter/author.
Please refer: Documentation/process/submitting-patches.rst

'hpp.iscas' doesn't appear to be a real name.

- Mani

-- 
மணிவண்ணன் சதாசிவம்
Re: [PATCH] PCI: eswin: Publish the platform driver's OF alias
Posted by Nick Huang 2 weeks, 6 days ago
On Sat, Sep 05, 2026 at 09:42:51PM +0800, hpp.iscas wrote:
> The ESWIN PCIe host controller is a platform driver matched through
> eswin_pcie_of_match. PCIE_ESWIN is tristate, but the table is not
> published for OF module autoloading.
> 
> Publish this platform-device table. Do not change the RISC-V host
> initialization sequence or PCI device matching.
> 
> Fixes: b593c26d081a ("PCI: eswin: Add ESWIN PCIe Root Complex driver")
> Signed-off-by: hpp.iscas <hppiscas@163.com>
> ---
>  drivers/pci/controller/dwc/pcie-eswin.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/pci/controller/dwc/pcie-eswin.c b/drivers/pci/controller/dwc/pcie-eswin.c
> index ce8d64f..1bb4469 100644
> --- a/drivers/pci/controller/dwc/pcie-eswin.c
> +++ b/drivers/pci/controller/dwc/pcie-eswin.c
> @@ -388,6 +388,7 @@ static const struct of_device_id eswin_pcie_of_match[] = {
>  	{ .compatible = "eswin,eic7700-pcie", .data = &eswin_eic7700_data },
>  	{}
>  };
> +MODULE_DEVICE_TABLE(of, eswin_pcie_of_match);
>  
>  static struct platform_driver eswin_pcie_driver = {
>  	.probe = eswin_pcie_probe,
>
Hi hpp.iscas

Since this driver uses `builtin_platform_driver(eswin_pcie_driver)`, it
appears to be built-in only. In that case, `MODULE_DEVICE_TABLE()` seems
unnecessary.

Regards,
Nick Huang
Re: [PATCH] PCI: eswin: Publish the platform driver's OF alias
Posted by Manivannan Sadhasivam 2 weeks, 6 days ago
On Sat, Sep 05, 2026 at 02:46:41PM +0000, Nick Huang wrote:
> On Sat, Sep 05, 2026 at 09:42:51PM +0800, hpp.iscas wrote:
> > The ESWIN PCIe host controller is a platform driver matched through
> > eswin_pcie_of_match. PCIE_ESWIN is tristate, but the table is not
> > published for OF module autoloading.
> > 
> > Publish this platform-device table. Do not change the RISC-V host
> > initialization sequence or PCI device matching.
> > 
> > Fixes: b593c26d081a ("PCI: eswin: Add ESWIN PCIe Root Complex driver")
> > Signed-off-by: hpp.iscas <hppiscas@163.com>
> > ---
> >  drivers/pci/controller/dwc/pcie-eswin.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/pci/controller/dwc/pcie-eswin.c b/drivers/pci/controller/dwc/pcie-eswin.c
> > index ce8d64f..1bb4469 100644
> > --- a/drivers/pci/controller/dwc/pcie-eswin.c
> > +++ b/drivers/pci/controller/dwc/pcie-eswin.c
> > @@ -388,6 +388,7 @@ static const struct of_device_id eswin_pcie_of_match[] = {
> >  	{ .compatible = "eswin,eic7700-pcie", .data = &eswin_eic7700_data },
> >  	{}
> >  };
> > +MODULE_DEVICE_TABLE(of, eswin_pcie_of_match);
> >  
> >  static struct platform_driver eswin_pcie_driver = {
> >  	.probe = eswin_pcie_probe,
> >
> Hi hpp.iscas
> 
> Since this driver uses `builtin_platform_driver(eswin_pcie_driver)`, it
> appears to be built-in only. In that case, `MODULE_DEVICE_TABLE()` seems
> unnecessary.
> 

Nope. builtin_platform_driver() only prevents removing the driver once loaded.
Since the driver is defined as 'tristate' in Kconfig, it can still be loaded
dynamically. So MODULE_DEVICE_TABLE() would still be necessary for udev to
autoload the module based on modalias.

- Mani

-- 
மணிவண்ணன் சதாசிவம்
Re: [PATCH] PCI: eswin: Publish the platform driver's OF alias
Posted by Nick Huang 2 weeks, 4 days ago
Manivannan Sadhasivam <mani@kernel.org> 於 2026年9月5日週六 下午11:55寫道:
>
> On Sat, Sep 05, 2026 at 02:46:41PM +0000, Nick Huang wrote:
> > On Sat, Sep 05, 2026 at 09:42:51PM +0800, hpp.iscas wrote:
> > > The ESWIN PCIe host controller is a platform driver matched through
> > > eswin_pcie_of_match. PCIE_ESWIN is tristate, but the table is not
> > > published for OF module autoloading.
> > >
> > > Publish this platform-device table. Do not change the RISC-V host
> > > initialization sequence or PCI device matching.
> > >
> > > Fixes: b593c26d081a ("PCI: eswin: Add ESWIN PCIe Root Complex driver")
> > > Signed-off-by: hpp.iscas <hppiscas@163.com>
> > > ---
> > >  drivers/pci/controller/dwc/pcie-eswin.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/pci/controller/dwc/pcie-eswin.c b/drivers/pci/controller/dwc/pcie-eswin.c
> > > index ce8d64f..1bb4469 100644
> > > --- a/drivers/pci/controller/dwc/pcie-eswin.c
> > > +++ b/drivers/pci/controller/dwc/pcie-eswin.c
> > > @@ -388,6 +388,7 @@ static const struct of_device_id eswin_pcie_of_match[] = {
> > >     { .compatible = "eswin,eic7700-pcie", .data = &eswin_eic7700_data },
> > >     {}
> > >  };
> > > +MODULE_DEVICE_TABLE(of, eswin_pcie_of_match);
> > >
> > >  static struct platform_driver eswin_pcie_driver = {
> > >     .probe = eswin_pcie_probe,
> > >
> > Hi hpp.iscas
> >
> > Since this driver uses `builtin_platform_driver(eswin_pcie_driver)`, it
> > appears to be built-in only. In that case, `MODULE_DEVICE_TABLE()` seems
> > unnecessary.
> >
>
> Nope. builtin_platform_driver() only prevents removing the driver once loaded.
> Since the driver is defined as 'tristate' in Kconfig, it can still be loaded
> dynamically. So MODULE_DEVICE_TABLE() would still be necessary for udev to
> autoload the module based on modalias.
>
> - Mani
>
> --
> மணிவண்ணன் சதாசிவம்
Hi Mani

Thanks for the clarification. I see that builtin_platform_driver() does not
prevent the driver from being built and loaded as a module, so
MODULE_DEVICE_TABLE() is still needed for module autoloading.

However, since builtin_platform_driver() does not provide an unregister
path, the module cannot be unloaded with rmmod. Is that intentional for
this driver?

Thanks,
Nick
Re: [PATCH] PCI: eswin: Publish the platform driver's OF alias
Posted by Manivannan Sadhasivam 2 weeks, 4 days ago
On Mon, Sep 07, 2026 at 06:23:19PM +0800, Nick Huang wrote:
> Manivannan Sadhasivam <mani@kernel.org> 於 2026年9月5日週六 下午11:55寫道:
> >
> > On Sat, Sep 05, 2026 at 02:46:41PM +0000, Nick Huang wrote:
> > > On Sat, Sep 05, 2026 at 09:42:51PM +0800, hpp.iscas wrote:
> > > > The ESWIN PCIe host controller is a platform driver matched through
> > > > eswin_pcie_of_match. PCIE_ESWIN is tristate, but the table is not
> > > > published for OF module autoloading.
> > > >
> > > > Publish this platform-device table. Do not change the RISC-V host
> > > > initialization sequence or PCI device matching.
> > > >
> > > > Fixes: b593c26d081a ("PCI: eswin: Add ESWIN PCIe Root Complex driver")
> > > > Signed-off-by: hpp.iscas <hppiscas@163.com>
> > > > ---
> > > >  drivers/pci/controller/dwc/pcie-eswin.c | 1 +
> > > >  1 file changed, 1 insertion(+)
> > > >
> > > > diff --git a/drivers/pci/controller/dwc/pcie-eswin.c b/drivers/pci/controller/dwc/pcie-eswin.c
> > > > index ce8d64f..1bb4469 100644
> > > > --- a/drivers/pci/controller/dwc/pcie-eswin.c
> > > > +++ b/drivers/pci/controller/dwc/pcie-eswin.c
> > > > @@ -388,6 +388,7 @@ static const struct of_device_id eswin_pcie_of_match[] = {
> > > >     { .compatible = "eswin,eic7700-pcie", .data = &eswin_eic7700_data },
> > > >     {}
> > > >  };
> > > > +MODULE_DEVICE_TABLE(of, eswin_pcie_of_match);
> > > >
> > > >  static struct platform_driver eswin_pcie_driver = {
> > > >     .probe = eswin_pcie_probe,
> > > >
> > > Hi hpp.iscas
> > >
> > > Since this driver uses `builtin_platform_driver(eswin_pcie_driver)`, it
> > > appears to be built-in only. In that case, `MODULE_DEVICE_TABLE()` seems
> > > unnecessary.
> > >
> >
> > Nope. builtin_platform_driver() only prevents removing the driver once loaded.
> > Since the driver is defined as 'tristate' in Kconfig, it can still be loaded
> > dynamically. So MODULE_DEVICE_TABLE() would still be necessary for udev to
> > autoload the module based on modalias.
> >
> > - Mani
> >
> > --
> > மணிவண்ணன் சதாசிவம்
> Hi Mani
> 
> Thanks for the clarification. I see that builtin_platform_driver() does not
> prevent the driver from being built and loaded as a module, so
> MODULE_DEVICE_TABLE() is still needed for module autoloading.
> 
> However, since builtin_platform_driver() does not provide an unregister
> path, the module cannot be unloaded with rmmod. Is that intentional for
> this driver?
> 

Yes, that's intentional and only applicable for controller drivers implementing
irqchip. Refer this guide for more details:
https://docs.kernel.org/PCI/controller/pci-controller-drivers.html#remove

- Mani

-- 
மணிவண்ணன் சதாசிவம்