Re: [PATCH 0/4, v3] Physical PCI slot objects

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Kenji Kaneshige
Date: Thursday, November 29, 2007 - 12:47 am

> Hi Gary, Kenji-san, et. al,

Thank you for your good job.

I tested shpchp and pciehp both with and without pci_slot module. There
seems no regression from shpchp and pciehp's point of view.
(I had a little concern about the hotplug slots' name that vary depending
on whether pci_slot functionality is enabled or disabled. But, now that we
can build pci_slot driver as a kernel module, I don't think it is a big
problem).

Only the problems is that I got Call Traces with the following error
messages when pci_slot driver was loaded, and one strange slot named
'1023' was registered (other slots are fine). This is the same problem
I reported before.

    sysfs: duplicate filename '1023' can not be created
    WARNING: at fs/sysfs/dir.c:424 sysfs_add_one()

    kobject_add failed for 1023 with -EEXIST, don't try to register
    things with the same name in the same directory.

On my system, hotplug slots themselves can be added, removed and replaced
with the ohter type of I/O box. The ACPI firmware tells OS the presence of
those slots using _STA method (That is, it doesn't use 'LoadTable()' AML
operator). On the other hand, current pci_slot driver doesn't check _STA.
As a result, pci_slot driver tryied to register the invalid (non-existing)
slots. The ACPI firmware of my system returns '1023' if the invalid slot's
_SUN is evaluated. This is the cause of Call Traces mentioned above. To
fix this problem, pci_slot driver need to check _STA when scanning ACPI
Namespace.

I'm sorry for reporting this so late. I'm attaching the patch to fix the
problem. This is against 2.6.24-rc3 with your patches applied. Could you
try it?

BTW, acpiphp also seems to have the same problem...

Thanks,
Kenji Kaneshige

---
 drivers/acpi/pci_slot.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

Index: linux-2.6.24-rc3/drivers/acpi/pci_slot.c
===================================================================
--- linux-2.6.24-rc3.orig/drivers/acpi/pci_slot.c
+++ linux-2.6.24-rc3/drivers/acpi/pci_slot.c
@@ -113,10 +113,17 @@ register_slot(acpi_handle handle, u32 lv
 	int device;
 	unsigned long sun;
 	char name[KOBJ_NAME_LEN];
+	acpi_status status;
+	struct acpi_device *dummy_device;
 
 	struct pci_slot *pci_slot;
 	struct pci_bus *pci_bus = context;
 
+	/* Skip non-existing device object. */
+	status = acpi_bus_get_device(handle, &dummy_device);
+	if (ACPI_FAILURE(status))
+		return AE_OK;
+
 	if (check_slot(handle, &device, &sun))
 		return AE_OK;
 
@@ -150,12 +157,18 @@ walk_p2p_bridge(acpi_handle handle, u32 
 	acpi_status status;
 	acpi_handle dummy_handle;
 	acpi_walk_callback user_function;
+	struct acpi_device *dummy_device;
 
 	struct pci_dev *dev;
 	struct pci_bus *pci_bus;
 	struct p2p_bridge_context child_context;
 	struct p2p_bridge_context *parent_context = context;
 
+	/* Skip non-existing device object. */
+	status = acpi_bus_get_device(handle, &dummy_device);
+	if (ACPI_FAILURE(status))
+		return AE_OK;
+
 	pci_bus = parent_context->pci_bus;
 	user_function = parent_context->user_function;
 

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 3/4, v3] PCI, PCI Hotplug: Introduce pci_slot, Alex Chiang, (Sat Nov 17, 11:37 am)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kristen Carlson Accardi, (Mon Nov 19, 10:43 am)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Alex Chiang, (Mon Nov 19, 10:57 am)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Alex Chiang, (Mon Nov 19, 3:02 pm)
[PATCH 3/4, v4] PCI, PCI Hotplug: Introduce pci_slot, Alex Chiang, (Mon Nov 19, 3:03 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Matthew Garrett, (Mon Nov 19, 7:04 pm)
[PATCH 3/4, v5] PCI, PCI Hotplug: Introduce pci_slot, Alex Chiang, (Mon Nov 26, 3:26 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Gary Hade, (Mon Nov 26, 8:04 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kristen Carlson Accardi, (Tue Nov 27, 12:11 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Gary Hade, (Wed Nov 28, 2:31 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kristen Carlson Accardi, (Wed Nov 28, 5:02 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Gary Hade, (Wed Nov 28, 6:09 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kenji Kaneshige, (Thu Nov 29, 12:47 am)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Alex Chiang, (Thu Nov 29, 6:19 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Alex Chiang, (Thu Nov 29, 6:51 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Gary Hade, (Fri Nov 30, 12:10 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kenji Kaneshige, (Sun Dec 2, 8:30 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Alex Chiang, (Mon Dec 3, 3:43 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kenji Kaneshige, (Tue Dec 4, 5:57 am)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Alex Chiang, (Mon Dec 10, 4:02 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kristen Carlson Accardi, (Tue Mar 11, 12:15 pm)
Re: [PATCH 0/4, v3] Physical PCI slot objects, Kenji Kaneshige, (Wed Mar 12, 5:25 am)