Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp291479pxx; Wed, 28 Oct 2020 05:09:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxMRKHo2ZBisRCp8vIVIhjSDUd07JiFD2TYui/TN11OzeGqFvMepP/8pJdhPs6gm9P8U3Bo X-Received: by 2002:a17:907:43c6:: with SMTP id i6mr7053954ejs.207.1603886993518; Wed, 28 Oct 2020 05:09:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603886993; cv=none; d=google.com; s=arc-20160816; b=OAiKa9pi34naNwpNY7F9ifh2+QbBFE2fYW88EHJowxRIdwC1rOWx4gLeQqWVcl00po qxBMlRtDJlESSrhnunrVFZZUyB0rFuqzUwbMnfuLJn3ETyP1xH5ZlZ48HFnXL9pI6Nt+ 19siMTYsr+kxVLIkXLWIUiyTRaF5IeSUAwZxZb7WGoIJcYMf8wq7F5VjPKXhyucttu3d Vndjqw4cFLjL47uXrqXd5/kfxVGDuiuNQRZkvQWe6U8R9eEEoHLcfaFNmwQ+i6QCtgYY 246VOzyId6aUPTTVHBL75BbBi7CPeQ7nysYucJ8YDjh2TS0ve+Bh92RJsTOIaiX70iJ+ dGNQ== 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=T6ykWrQR4wYQAMGtC1dL3FNpB0lJrUYY5mdW9CFpG60=; b=rVjVKaj/M78iu4tA0DRfGVqcd44w9kVytqlr8aSL3psi7+fG4wdmDPE745YGkP9ea6 pKTa2PpSt6JdZluR0nCKSv/VltoVPcdXQsytmsqk37xTGXEPlLfyoQE1yRVTi+KFYuHO LibBdluF/f+2mPu1nxmLzzMFvWix4l36P8leq6zT4WEqlAM4w9syH9/I1ZtmI/HS30dn YybA9NuOLzkqvUOMgfsuSd11B4HfHGsks1KgwkN3Vt1ZEDhVU308Mpq8ElFUsE/r9xHf P/RItZFNngOzD7TeWLp9AL9Ncuc4oaC4e3WilahJDw8Q1brxiKKwC9H6Eq9bPWKp22wU 5Jcg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=iyhIUANL; 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 s16si2897729edy.300.2020.10.28.05.09.30; Wed, 28 Oct 2020 05:09:53 -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=iyhIUANL; 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 S1795745AbgJ0PPU (ORCPT + 99 others); Tue, 27 Oct 2020 11:15:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:48312 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1794499AbgJ0PMJ (ORCPT ); Tue, 27 Oct 2020 11:12:09 -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 C403822202; Tue, 27 Oct 2020 15:12:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603811528; bh=TKwG8qN6udJoWiQIYQGkalBBVs0PelwEN8M2Z18AFTE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iyhIUANLjahlMPIWUDqASDRv8lwfpQeUF1d960LV182pRx/uIsf3JVu99lWgP6dg9 Pp2r1r+FriKoKRa9//WUt+49tMlG9MTZPF4vDDBn3JGDOcaHF7vEmQgY+YymgqIAzz 9MIrgabGojBnMnLsqOYaUbdwMwJsn8N5lLYM2dFc= 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.8 526/633] i2c: core: Restore acpi_walk_dep_device_list() getting called after registering the ACPI i2c devs Date: Tue, 27 Oct 2020 14:54:29 +0100 Message-Id: <20201027135547.453070770@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@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 2ade99b105b91..bbf8dd491d245 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); } const struct acpi_device_id * @@ -729,7 +739,6 @@ int i2c_acpi_install_space_handler(struct i2c_adapter *adapter) return -ENOMEM; } - acpi_walk_dep_device_list(handle); return 0; } -- 2.25.1