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()")
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>

authored by Hans de Goede and committed by Wolfram Sang 8058d699 d7691390

+10 -1
+10 -1
drivers/i2c/i2c-core-acpi.c
··· 264 264 void i2c_acpi_register_devices(struct i2c_adapter *adap) 265 265 { 266 266 acpi_status status; 267 + acpi_handle handle; 267 268 268 269 if (!has_acpi_companion(&adap->dev)) 269 270 return; ··· 275 274 adap, NULL); 276 275 if (ACPI_FAILURE(status)) 277 276 dev_warn(&adap->dev, "failed to enumerate I2C slaves\n"); 277 + 278 + if (!adap->dev.parent) 279 + return; 280 + 281 + handle = ACPI_HANDLE(adap->dev.parent); 282 + if (!handle) 283 + return; 284 + 285 + acpi_walk_dep_device_list(handle); 278 286 } 279 287 280 288 static const struct acpi_device_id i2c_acpi_force_400khz_device_ids[] = { ··· 729 719 return -ENOMEM; 730 720 } 731 721 732 - acpi_walk_dep_device_list(handle); 733 722 return 0; 734 723 } 735 724