From 029d11df81278d99d8a0441ff45a5dfdfce0168b Mon Sep 17 00:00:00 2001 From: Vibhor Goel Date: Sat, 3 Oct 2026 22:10:19 +0530 Subject: [PATCH] ACPI: dock: Retry probing battery docks after hotplug On a ThinkPad T480 booted with the removable battery absent, reinserting that battery can leave BAT1 missing from /sys/class/power_supply even after firmware sends an ACPI add notification. The battery dock platform device already exists, but its driver did not bind while the battery was absent. During hotplug, acpi_bus_scan() updates the ACPI device and attempts to attach it on the ACPI bus. acpi_create_platform_device() does not create another platform device because the existing physical node is still associated with the ACPI device. Consequently, the existing platform device remains unbound. Retry probing the battery dock platform device after hotplug_dock_devices() has refreshed the ACPI state. Restrict this to battery docks. If the platform device is already bound, device_initial_probe() leaves that binding in place. Signed-off-by: Vibhor Goel [ rjw: Add empty code line after a conditional ] Link: https://patch.msgid.link/20261003164019.11195-1-vibhor1102@gmail.com Signed-off-by: Rafael J. Wysocki --- drivers/acpi/dock.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index d7f3a8912e6a..24c5813ca291 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c @@ -445,6 +445,15 @@ int dock_notify(struct acpi_device *adev, u32 event) break; } hotplug_dock_devices(ds, event); + /* + * The dock platform device already exists when an empty battery + * bay becomes occupied, but its driver may not have bound while + * the battery was absent. Retry after the ACPI scan updates its + * status, since the scan only attaches the ACPI device. + */ + if (ds->flags & DOCK_IS_BAT) + device_initial_probe(&ds->dock_device->dev); + complete_dock(ds); dock_event(ds, event, DOCK_EVENT); acpi_evaluate_lck(ds->handle, 1);