Skip to content

Commit

Permalink
[PATCH] acpiphp: Scan slots under the nested P2P bridge
Browse files Browse the repository at this point in the history
Current ACPIPHP driver scans only slots under the top level PCI-to-PCI
bridge. So hotplug PCI slots under the nested PCI-to-PCI bridge would
not be detected. For example, if the system has the ACPI namespace
like below, hotplug slots woule not be detected.

Device (PCI0) {						/* Root bridge */
	Name (_HID, "PNP0A03")
	Device (P2PA) {					/* PCI-to-PCI bridge */
		Name (_ADR, ...)
		Device (P2PB) {				/* PCI-to-PCI bridge */
			Name (_ADR, ...)
			Device (S0F0) {			/* hotplug slot */
				Name (_ADR, ...)
				Name (_SUN, ...)
				Method (_EJ0, ...) { ... }
			}
			...
			Device (S0F7) {			/* hotplug slot */
				Name (_ADR, ...)
				Name (_SUN, ...)
				Method (_EJ0, ...) { ... }
			}
			Device (S1F0) {			/* hotplug slot */
				Name (_ADR, ...)
				Name (_SUN, ...)
				Method (_EJ0, ...) { ... }
			}
			...
		}
	}
}

This patch fixes this issue.

Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
Kenji Kaneshige authored and Greg Kroah-Hartman committed Mar 23, 2006
1 parent 8e77af6 commit 7c8f25d
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion drivers/pci/hotplug/acpiphp_glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,12 @@ find_p2p_bridge(acpi_handle handle, u32 lvl, void *context, void **rv)
add_p2p_bridge(handle, dev);
}

/* search P2P bridges under this p2p bridge */
status = acpi_walk_namespace(ACPI_TYPE_DEVICE, handle, (u32)1,
find_p2p_bridge, dev->subordinate, NULL);
if (ACPI_FAILURE(status))
warn("find_p2p_bridge faied (error code = 0x%x)\n", status);

out:
pci_dev_put(dev);
return AE_OK;
Expand Down Expand Up @@ -603,7 +609,8 @@ static void remove_bridge(acpi_handle handle)
} else {
/* clean-up p2p bridges under this host bridge */
acpi_walk_namespace(ACPI_TYPE_DEVICE, handle,
(u32)1, cleanup_p2p_bridge, NULL, NULL);
ACPI_UINT32_MAX, cleanup_p2p_bridge,
NULL, NULL);
}
}

Expand Down

0 comments on commit 7c8f25d

Please sign in to comment.