* [PATCH] PCI: eswin: Publish the platform driver's OF alias
@ 2026-09-05 13:42 hpp.iscas
2026-09-05 13:53 ` sashiko-bot
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: hpp.iscas @ 2026-09-05 13:42 UTC (permalink / raw)
To: Senchuan Zhang
Cc: hpp.iscas, Lorenzo Pieralisi, Krzysztof Wilczyński,
Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, linux-pci,
linux-kernel, linux-riscv, Yu Ning, Yanghui Ou
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,
^ permalink raw reply related [flat|nested] 7+ messages in thread* Re: [PATCH] PCI: eswin: Publish the platform driver's OF alias 2026-09-05 13:42 [PATCH] PCI: eswin: Publish the platform driver's OF alias hpp.iscas @ 2026-09-05 13:53 ` sashiko-bot 2026-09-05 14:46 ` Nick Huang 2026-09-05 15:59 ` Manivannan Sadhasivam 2 siblings, 0 replies; 7+ messages in thread From: sashiko-bot @ 2026-09-05 13:53 UTC (permalink / raw) To: hpp.iscas; +Cc: linux-pci Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider: Pre-existing issues: - [High] Resource leak of `perst` reset controls on the probe error path due to incorrect label ordering. -- commit 086b34d1058711efceb6e05d5c137e933d166d8c Author: hpp.iscas <hppiscas@163.com> PCI: eswin: Publish the platform driver's OF alias 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. > diff --git a/drivers/pci/controller/dwc/pcie-eswin.c b/drivers/pci/controller/dwc/pcie-eswin.c > index ce8d64f8a3957..1bb44696057e4 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); [Severity: High] This isn't a bug introduced by this patch, but while reviewing this file I noticed a pre-existing issue in eswin_pcie_probe() regarding error handling. When dw_pcie_host_init() fails, execution jumps to err_init: ret = dw_pcie_host_init(&pci->pp); if (ret) { dev_err(dev, "Failed to init host\n"); goto err_init; } Because err_init is positioned after err_pm_runtime_put, it completely skips the loop that releases the exclusive perst reset controls: err_pm_runtime_put: list_for_each_entry_safe(port, tmp, &pcie->ports, list) { reset_control_put(port->perst); list_del(&port->list); } err_init: pm_runtime_put(dev); Does this leak the perst reset controls? Because they are requested exclusively via of_reset_control_get_exclusive(), would subsequent attempts to reprobe the driver (e.g. module reload) fail to acquire the reset controls until a full system reboot? > > static struct platform_driver eswin_pcie_driver = { > .probe = eswin_pcie_probe, -- Sashiko AI review · https://sashiko.dev/#/patchset/20260905134251.67210-1-hppiscas@163.com?part=1 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] PCI: eswin: Publish the platform driver's OF alias 2026-09-05 13:42 [PATCH] PCI: eswin: Publish the platform driver's OF alias hpp.iscas 2026-09-05 13:53 ` sashiko-bot @ 2026-09-05 14:46 ` Nick Huang 2026-09-05 15:55 ` Manivannan Sadhasivam 2026-09-05 15:59 ` Manivannan Sadhasivam 2 siblings, 1 reply; 7+ messages in thread From: Nick Huang @ 2026-09-05 14:46 UTC (permalink / raw) To: hpp.iscas Cc: Senchuan Zhang, Lorenzo Pieralisi, Krzysztof Wilczyński, Manivannan Sadhasivam, Rob Herring, Bjorn Helgaas, linux-pci, linux-kernel, linux-riscv, Yu Ning, Yanghui Ou 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] PCI: eswin: Publish the platform driver's OF alias 2026-09-05 14:46 ` Nick Huang @ 2026-09-05 15:55 ` Manivannan Sadhasivam 2026-09-07 10:23 ` Nick Huang 0 siblings, 1 reply; 7+ messages in thread From: Manivannan Sadhasivam @ 2026-09-05 15:55 UTC (permalink / raw) To: Nick Huang Cc: hpp.iscas, Senchuan Zhang, Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas, linux-pci, linux-kernel, linux-riscv, Yu Ning, Yanghui Ou 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 -- மணிவண்ணன் சதாசிவம் ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] PCI: eswin: Publish the platform driver's OF alias 2026-09-05 15:55 ` Manivannan Sadhasivam @ 2026-09-07 10:23 ` Nick Huang 2026-09-07 10:49 ` Manivannan Sadhasivam 0 siblings, 1 reply; 7+ messages in thread From: Nick Huang @ 2026-09-07 10:23 UTC (permalink / raw) To: Manivannan Sadhasivam Cc: hpp.iscas, Senchuan Zhang, Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas, linux-pci, linux-kernel, linux-riscv, Yu Ning, Yanghui Ou 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 ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] PCI: eswin: Publish the platform driver's OF alias 2026-09-07 10:23 ` Nick Huang @ 2026-09-07 10:49 ` Manivannan Sadhasivam 0 siblings, 0 replies; 7+ messages in thread From: Manivannan Sadhasivam @ 2026-09-07 10:49 UTC (permalink / raw) To: Nick Huang Cc: hpp.iscas, Senchuan Zhang, Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas, linux-pci, linux-kernel, linux-riscv, Yu Ning, Yanghui Ou 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 -- மணிவண்ணன் சதாசிவம் ^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] PCI: eswin: Publish the platform driver's OF alias 2026-09-05 13:42 [PATCH] PCI: eswin: Publish the platform driver's OF alias hpp.iscas 2026-09-05 13:53 ` sashiko-bot 2026-09-05 14:46 ` Nick Huang @ 2026-09-05 15:59 ` Manivannan Sadhasivam 2 siblings, 0 replies; 7+ messages in thread From: Manivannan Sadhasivam @ 2026-09-05 15:59 UTC (permalink / raw) To: hpp.iscas Cc: Senchuan Zhang, Lorenzo Pieralisi, Krzysztof Wilczyński, Rob Herring, Bjorn Helgaas, linux-pci, linux-kernel, linux-riscv, Yu Ning, Yanghui Ou 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 -- மணிவண்ணன் சதாசிவம் ^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-09-07 10:49 UTC | newest] Thread overview: 7+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-09-05 13:42 [PATCH] PCI: eswin: Publish the platform driver's OF alias hpp.iscas 2026-09-05 13:53 ` sashiko-bot 2026-09-05 14:46 ` Nick Huang 2026-09-05 15:55 ` Manivannan Sadhasivam 2026-09-07 10:23 ` Nick Huang 2026-09-07 10:49 ` Manivannan Sadhasivam 2026-09-05 15:59 ` Manivannan Sadhasivam
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox