Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp235288pxx; Wed, 28 Oct 2020 03:40:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwN/lfOS+VlvuLpI1i+PmwJtC41xwwGueLBlVFgaOIP8FmeOi9wMtmJviuvxkcEa5UA+IjM X-Received: by 2002:a17:906:fad8:: with SMTP id lu24mr6764860ejb.486.1603881616283; Wed, 28 Oct 2020 03:40:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603881616; cv=none; d=google.com; s=arc-20160816; b=0U1R8wiRi+IzbjKI52YIfs5C9Era3hVdHHtaD+CY1mB26qHVvZTq1xSemjtLvt8SDj viznPg5PaApNOttPvfcvXUo+ONH/OFgjCecjvUWFriTjMz/tXdFCdi7m9TS0+km/wmvQ jvPr3C8/sILX2fmhVM00OcpeKwwYmuHs59susk1PUjgcuUuLYm741rFX0+UBbkW5NeQ3 ryEuykmq+HF+/GMxkboCmdaxzKI4P3icL4HnITrSeGnYRRxMLIE5rhzyQ8A2MAbCoJRd sx70XBr61E5SeIs/w8tp5oxsjL1CrxWrl8vzWd6atBfOb8B7Bxiy+/hRVRlWWw+oVa4X Fp8A== 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=yBY4r+Ltz5iwgVvxGU8f/k6gbX1LIPzSR8BBrhBBqok=; b=sY9BUOX+2z7y2lTRkyPTesqg1gl678MmgesfNXaYld5bCt6/limuf49fXiXs5zgny8 40HKUsalzNBgReFQR3VnvQd0I5KzNnuQHvdr5GiHH8RdCp7MQTcmdsjW6hq9FbNf9oa3 q8cMBQb6Y+eM211cqzuAPAM1oTHmUz8ftZJhgDuvHQE8nXS1810p4VkXU8M+aC38LZ0d Nkj7unhM5VFJ6eUhbLNt7aSZnL2WKhkid4hAZ4zfQKHiwMIi+JDK48VNQmteakVDS9YF VwXFDncadsxmcSKlCeOSDZ2xQe+Hh2SwgDjzjswL+ApmXuF49awzVBV8Z6N7xEGWJaZs xP+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=jwmX4qgt; 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 p17si2879649ejg.48.2020.10.28.03.39.54; Wed, 28 Oct 2020 03:40:16 -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=jwmX4qgt; 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 S1762940AbgJ0Ooj (ORCPT + 99 others); Tue, 27 Oct 2020 10:44:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:43018 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1762523AbgJ0OnQ (ORCPT ); Tue, 27 Oct 2020 10:43:16 -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 3B71C206B2; Tue, 27 Oct 2020 14:43:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603809795; bh=QlwQjnTau7MbTy26jzjQxKGAUdXacCXnc9csOyLAdXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jwmX4qgtpYoxQs/SfSQzGJqOkrhsMYTpWDZMQR0PQCYGbwYIKNiuEsT0V0OpZ148r gFW4zJTrdZNUrmRmmB2Gk4Pz2//R6cCFGQoUea9U4lpzhwM4kkGcZN0nu28hXorQAM Mlw8hldzzDw4b/VtfEUxt3GPwvUGhclHDFAX/YQs= 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.4 323/408] i2c: core: Restore acpi_walk_dep_device_list() getting called after registering the ACPI i2c devs Date: Tue, 27 Oct 2020 14:54:21 +0100 Message-Id: <20201027135510.014600601@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135455.027547757@linuxfoundation.org> References: <20201027135455.027547757@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 ce70b5288472c..c70983780ae79 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 * @@ -737,7 +747,6 @@ int i2c_acpi_install_space_handler(struct i2c_adapter *adapter) return -ENOMEM; } - acpi_walk_dep_device_list(handle); return 0; } -- 2.25.1