Skip to content

Commit 8058d69

Browse files
jwrdegoedewsakernel
authored andcommitted
i2c: core: Restore acpi_walk_dep_device_list() getting called after registering the ACPI i2c devs
Commit 21653a4 ("i2c: core: Call i2c_acpi_install_space_handler() before i2c_acpi_register_devices()")'s intention was to only move the acpi_install_address_space_handler() call to the point before where the ACPI declared i2c-children of the adapter where instantiated by i2c_acpi_register_devices(). But i2c_acpi_install_space_handler() had a call to acpi_walk_dep_device_list() hidden (that is I missed it) at the end of it, so as an unwanted side-effect now acpi_walk_dep_device_list() was also being called before i2c_acpi_register_devices(). Move the acpi_walk_dep_device_list() call to the end of i2c_acpi_register_devices(), so that it is once again called *after* the i2c_client-s hanging of the adapter have been created. This fixes the Microsoft Surface Go 2 hanging at boot. Fixes: 21653a4 ("i2c: core: Call i2c_acpi_install_space_handler() before i2c_acpi_register_devices()") Link: https://bugzilla.kernel.org/show_bug.cgi?id=209627 Reported-by: Rainer Finke <rainer@finke.cc> Reported-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Suggested-by: Maximilian Luz <luzmaximilian@gmail.com> Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent d769139 commit 8058d69

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

drivers/i2c/i2c-core-acpi.c

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ static acpi_status i2c_acpi_add_device(acpi_handle handle, u32 level,
264264
void i2c_acpi_register_devices(struct i2c_adapter *adap)
265265
{
266266
acpi_status status;
267+
acpi_handle handle;
267268

268269
if (!has_acpi_companion(&adap->dev))
269270
return;
@@ -274,6 +275,15 @@ void i2c_acpi_register_devices(struct i2c_adapter *adap)
274275
adap, NULL);
275276
if (ACPI_FAILURE(status))
276277
dev_warn(&adap->dev, "failed to enumerate I2C slaves\n");
278+
279+
if (!adap->dev.parent)
280+
return;
281+
282+
handle = ACPI_HANDLE(adap->dev.parent);
283+
if (!handle)
284+
return;
285+
286+
acpi_walk_dep_device_list(handle);
277287
}
278288

279289
static const struct acpi_device_id i2c_acpi_force_400khz_device_ids[] = {
@@ -719,7 +729,6 @@ int i2c_acpi_install_space_handler(struct i2c_adapter *adapter)
719729
return -ENOMEM;
720730
}
721731

722-
acpi_walk_dep_device_list(handle);
723732
return 0;
724733
}
725734

0 commit comments

Comments
 (0)