[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SY0P300MB04687548090B73E40AF97D8897B82@SY0P300MB0468.AUSP300.PROD.OUTLOOK.COM>
Date: Wed, 7 Aug 2024 18:34:34 +0800
From: Ian <4dark@...look.com>
To: bhelgaas@...gle.com
Cc: linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org,
Ian Ding <4dark@...look.com>
Subject: [PATCH] PCI: Adjust pci_sysfs_init() to device_initcall
From: Ian Ding <4dark@...look.com>
When the controller driver uses async probe
(.probe_type = PROBE_PREFER_ASYNCHRONOUS), pci_host_probe() is not
guaranteed to run before pci_sysfs_init(), kernel may call
pci_create_sysfs_dev_files() twice in pci_sysfs_init() and
pci_host_probe() -> pci_bus_add_device(), and dump stack:
sysfs: cannot create duplicate filename
Signed-off-by: Ian Ding <4dark@...look.com>
---
drivers/pci/pci-sysfs.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index dd0d9d9bc..bef25fecb 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -1534,7 +1534,7 @@ static int __init pci_sysfs_init(void)
return 0;
}
-late_initcall(pci_sysfs_init);
+device_initcall(pci_sysfs_init);
static struct attribute *pci_dev_dev_attrs[] = {
&dev_attr_boot_vga.attr,
--
2.25.1
Powered by blists - more mailing lists