Commit 94add0f8 authored by Jiang Liu's avatar Jiang Liu Committed by Rafael J. Wysocki

ACPI / dock: Initialize ACPI dock subsystem upfront

Commit 3b63aaa7 (PCI: acpiphp: Do not use ACPI PCI subdriver
mechanism) introduced an ACPI dock support regression, because it
changed the relative initialization order of the ACPI dock subsystem
and the ACPI-based PCI hotplug (acpiphp).

Namely, the ACPI dock subsystem has to be initialized before
acpiphp_enumerate_slots() is first run, which after commit
3b63aaa7 happens during the initial enumeration of the PCI
hierarchy triggered by the initial ACPI namespace scan in
acpi_scan_init().  For this reason, the dock subsystem has to be
initialized before the initial ACPI namespace scan in

To make that happen, modify the ACPI dock subsystem to be
non-modular and add the invocation of its initialization routine,
acpi_dock_init(), to acpi_scan_init() directly before the initial
namespace scan.

[rjw: Changelog, removal of dock_exit().]
References: default avatarAlexander E. Patrakov <>
Tested-by: default avatarIllya Klymov <>
Signed-off-by: default avatarJiang Liu <>
Acked-by: default avatarYinghai Lu <>
Cc: 3.9+ <>
Signed-off-by: default avatarRafael J. Wysocki <>
parent 9e895ace
......@@ -993,30 +993,6 @@ err_unregister:
return ret;
* dock_remove - free up resources related to the dock station
static int dock_remove(struct dock_station *ds)
struct dock_dependent_device *dd, *tmp;
struct platform_device *dock_device = ds->dock_device;
if (!dock_station_count)
return 0;
/* remove dependent devices */
list_for_each_entry_safe(dd, tmp, &ds->dependent_devices, list)
/* cleanup sysfs */
sysfs_remove_group(&dock_device->dev.kobj, &dock_attribute_group);
return 0;
* find_dock_and_bay - look for dock stations and bays
* @handle: acpi handle of a device
......@@ -1035,7 +1011,7 @@ find_dock_and_bay(acpi_handle handle, u32 lvl, void *context, void **rv)
return AE_OK;
static int __init dock_init(void)
int __init acpi_dock_init(void)
if (acpi_disabled)
return 0;
......@@ -1054,19 +1030,3 @@ static int __init dock_init(void)
ACPI_DOCK_DRIVER_DESCRIPTION, dock_station_count);
return 0;
static void __exit dock_exit(void)
struct dock_station *tmp, *dock_station;
list_for_each_entry_safe(dock_station, tmp, &dock_stations, sibling)
* Must be called before drivers of devices in dock, otherwise we can't know
* which devices are in a dock
......@@ -40,6 +40,11 @@ void acpi_container_init(void);
static inline void acpi_container_init(void) {}
void acpi_dock_init(void);
static inline void acpi_dock_init(void) {}
void acpi_memory_hotplug_init(void);
......@@ -2042,6 +2042,7 @@ int __init acpi_scan_init(void)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment