Skip to content

Commit 3b63aaa

Browse files
jiangliubjorn-helgaas
authored andcommitted
PCI: acpiphp: Do not use ACPI PCI subdriver mechanism
Previously the acpiphp driver registered itself as an ACPI PCI subdriver, so its callbacks were invoked when creating/destroying PCI root buses to manage ACPI-based PCI hotplug slots. But it doesn't handle P2P bridge hotplug events, so it will cause strange behaviour if there are hotplug slots associated with a hot-removed P2P bridge. This patch fixes this issue by: 1) Directly hooking into PCI core to update hotplug slot devices when creating/destroying PCI buses through: pci_{add|remove}_bus() -> acpi_pci_{add|remove}_bus() 2) Getting rid of unused ACPI PCI subdriver-related code It also cleans up unused code in the acpiphp driver. [bhelgaas: keep acpi_pci_add_bus() stub for CONFIG_ACPI=n] Signed-off-by: Jiang Liu <jiang.liu@huawei.com> Signed-off-by: Yijing Wang <wangyijing@huawei.com> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Yinghai Lu <yinghai@kernel.org> Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com> Cc: Toshi Kani <toshi.kani@hp.com>
1 parent 6037a80 commit 3b63aaa

5 files changed

Lines changed: 71 additions & 247 deletions

File tree

‎drivers/pci/hotplug/acpiphp.h‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ struct acpiphp_slot {
119119
*/
120120
struct acpiphp_func {
121121
struct acpiphp_slot *slot; /* parent */
122-
struct acpiphp_bridge *bridge; /* Ejectable PCI-to-PCI bridge */
123122

124123
struct list_head sibling;
125124
struct notifier_block nb;
@@ -176,8 +175,6 @@ extern int acpiphp_register_hotplug_slot(struct acpiphp_slot *slot);
176175
extern void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *slot);
177176

178177
/* acpiphp_glue.c */
179-
extern int acpiphp_glue_init (void);
180-
extern void acpiphp_glue_exit (void);
181178
typedef int (*acpiphp_callback)(struct acpiphp_slot *slot, void *data);
182179

183180
extern int acpiphp_enable_slot (struct acpiphp_slot *slot);

‎drivers/pci/hotplug/acpiphp_core.c‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737

3838
#include <linux/kernel.h>
3939
#include <linux/pci.h>
40+
#include <linux/pci-acpi.h>
4041
#include <linux/pci_hotplug.h>
4142
#include <linux/slab.h>
4243
#include <linux/smp.h>
@@ -354,19 +355,9 @@ void acpiphp_unregister_hotplug_slot(struct acpiphp_slot *acpiphp_slot)
354355
}
355356

356357

357-
static int __init acpiphp_init(void)
358+
void __init acpiphp_init(void)
358359
{
359360
info(DRIVER_DESC " version: " DRIVER_VERSION "%s\n",
360361
acpiphp_disabled ? ", disabled by user; please report a bug"
361362
: "");
362-
363-
if (acpi_pci_disabled || acpiphp_disabled)
364-
return 0;
365-
366-
/* read all the ACPI info from the system */
367-
/* initialize internal data structure etc. */
368-
return acpiphp_glue_init();
369363
}
370-
371-
372-
module_init(acpiphp_init);

0 commit comments

Comments
 (0)