From 15d76ad333c2fea62ce7a54bec749d59ad3a064b Mon Sep 17 00:00:00 2001 From: jc_gargma Date: Mon, 19 Oct 2020 15:51:18 -0700 Subject: Updated to 5.9.1 --- ...-acpi_walk_dep_device_list-getting-called.patch | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 0002-i2c-core-Restore-acpi_walk_dep_device_list-getting-called.patch (limited to '0002-i2c-core-Restore-acpi_walk_dep_device_list-getting-called.patch') diff --git a/0002-i2c-core-Restore-acpi_walk_dep_device_list-getting-called.patch b/0002-i2c-core-Restore-acpi_walk_dep_device_list-getting-called.patch new file mode 100644 index 0000000..076844f --- /dev/null +++ b/0002-i2c-core-Restore-acpi_walk_dep_device_list-getting-called.patch @@ -0,0 +1,70 @@ +From 94d41d2b670111855a361a35806ebac8d2444042 Mon Sep 17 00:00:00 2001 +From: Hans de Goede +Date: Wed, 14 Oct 2020 16:41:58 +0200 +Subject: i2c: core: Restore acpi_walk_dep_device_list() getting called after + registering the ACPI i2c devs + +Commit 21653a4181ff ("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: 21653a4181ff ("i2c: core: Call i2c_acpi_install_space_handler() before i2c_acpi_register_devices()") +Suggested-by: Maximilian Luz +Reported-and-tested-by: Kieran Bingham +Signed-off-by: Hans de Goede +--- + drivers/i2c/i2c-core-acpi.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +diff --git a/drivers/i2c/i2c-core-acpi.c b/drivers/i2c/i2c-core-acpi.c +index e627d7b2790f..37c510d9347a 100644 +--- a/drivers/i2c/i2c-core-acpi.c ++++ b/drivers/i2c/i2c-core-acpi.c +@@ -264,6 +264,7 @@ static acpi_status i2c_acpi_add_device(acpi_handle handle, u32 level, + void i2c_acpi_register_devices(struct i2c_adapter *adap) + { + acpi_status status; ++ acpi_handle handle; + + if (!has_acpi_companion(&adap->dev)) + return; +@@ -274,6 +275,15 @@ void i2c_acpi_register_devices(struct i2c_adapter *adap) + adap, NULL); + if (ACPI_FAILURE(status)) + dev_warn(&adap->dev, "failed to enumerate I2C slaves\n"); ++ ++ if (!adap->dev.parent) ++ return; ++ ++ handle = ACPI_HANDLE(adap->dev.parent); ++ if (!handle) ++ return; ++ ++ acpi_walk_dep_device_list(handle); + } + + 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) + return -ENOMEM; + } + +- acpi_walk_dep_device_list(handle); + return 0; + } + +-- +cgit v1.2.3-1-gf6bb5 + -- cgit v1.2.1