Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp440078pxx; Wed, 28 Oct 2020 08:23:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw04Zg8WV8RPNLa6njxJl+Uo/uuj0SJSLa/41bS2QZQAPP5RVeqO0fsdwGJCurZahOkqip4 X-Received: by 2002:a17:906:3e1a:: with SMTP id k26mr8245467eji.96.1603898606197; Wed, 28 Oct 2020 08:23:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603898606; cv=none; d=google.com; s=arc-20160816; b=cjKmE5YiwIFtaYohHjyblqMtHLmGIaizFvwL4FZI7w0tlTVukCXgkVg+9fCS40Y6Mx vODRLwFzzqwbyOjUH80dFKv/1cbBdAPEbAsQ+L/5VF4JzguZHvauSA8mwgizbaVrGHV3 OQYIO4mspbZnIinFikvcGSf7RnojT/Ofen/fkaFwzn+dXCS9glX1uNRrPypuv++mR2lv mifkNoKTFOsq9zYG8+2ur6Mt6IDNnFek9peAh9YcVmJqLbBocosX7Tfq9UG6li/1EpOa jj28AArylwuyIRlfZYT5W+R+87YY6IqF3j0XzkaBjFnOjXPDuv4bJSp4Mdp/RwLfWz0g LDZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6CP/XqlAPbEzlnot42VcCESk6jXbNJgIh5meEhsntgc=; b=u+efs/8c7/PcwDIS54IqlBwFwsHUTq+L0TG2OMyDVlIAABEYvOk6/QiFxElsv+YI5p nZ6IJVlHKvT1NK4ZMihHI41Ygx/PtqhobOZ9Hb+uTa8h/aFjWLifizep8D5USUNrSXmt 4ZTaL0GUW9rmn2sAas96aouDCsy+z3FsfJ9UT/c+FMn+LnOR3yjbzgbxI2HTeOe9g21l DBUiVjVIge3mE9bZ28Yn/TqwviRgbVSBLJFZ10atC9AfnvKjVzmkRQ4qXaCX8SHKPxrI GERUKSLx8ZsKd+iWVh0dPgZoqrS9ML7gGzYN/dMbgGmOeCGxvkS2wBVg+mI7MBGaaOHI IeSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EmobtU4D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q18si2524555edb.466.2020.10.28.08.23.04; Wed, 28 Oct 2020 08:23:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EmobtU4D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1811073AbgJ0QhI (ORCPT + 99 others); Tue, 27 Oct 2020 12:37:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:48802 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1802415AbgJ0PsX (ORCPT ); Tue, 27 Oct 2020 11:48:23 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5D15D2231B; Tue, 27 Oct 2020 15:48:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603813702; bh=B0tLwBuVoTvMWxZvF0r6Atg520r9t2hCM2scppDUIdw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EmobtU4DWTAYz/qqKE0GN7PguJSp26BQ6+eLjcHORdIg3vssgZszfdy5HBj0asRrh E+DWUpSjOJyXVOKSXq5XT+iHynQqOtFikisK4UNnwOkIbrC5MfykYaJHyArNWrBjL8 7EkBY3npLKWNXU1Y74ZBGHRPwE2uheCujfVOrVpo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Rainer Finke , Kieran Bingham , Maximilian Luz , Hans de Goede , Wolfram Sang , Sasha Levin Subject: [PATCH 5.9 640/757] i2c: core: Restore acpi_walk_dep_device_list() getting called after registering the ACPI i2c devs Date: Tue, 27 Oct 2020 14:54:50 +0100 Message-Id: <20201027135520.579610031@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135450.497324313@linuxfoundation.org> References: <20201027135450.497324313@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede [ Upstream commit 8058d69905058ec8f467a120b5ec5bb831ea67f3 ] 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 Reported-by: Kieran Bingham Suggested-by: Maximilian Luz Tested-by: Kieran Bingham Signed-off-by: Hans de Goede Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- 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 e627d7b2790f7..37c510d9347a7 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; } -- 2.25.1