Received: by 10.213.65.68 with SMTP id h4csp2120973imn; Sun, 8 Apr 2018 20:13:21 -0700 (PDT) X-Google-Smtp-Source: AIpwx49SqlkY2vHkAltw+vxjxAEYR7L96bmi1KaxJfZBHTrnXpAKamox080grGTX6Re/5hEaw4Im X-Received: by 2002:a17:902:141:: with SMTP id 59-v6mr37914071plb.219.1523243601659; Sun, 08 Apr 2018 20:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523243601; cv=none; d=google.com; s=arc-20160816; b=cqH7pjVBXnWDbg+B3N3sO15LbBVvVPzRz6QS/pL4uFwsPzEx218qJ7tr4ScJo67Lvw A2KcYIo0woP3twWBqIYbFrUve+OGEx2oXEhmLX2XI87nG302Q/LQdoAGe6+mmrRRpMFz OZj+mQo6LdT/5ij5nFP6oiLF2KqZcKOaQrSb3fZk5HRokH4Hv1xCwVlQFrk8Jq9TTkGn kOEvdU1LmD3r/xm61UfK+IO46PN0zeu8VJBewgwLL9Drx8bOyFQhrsK01ZKEXAM1tbeB o721z4DYCUIEQUyDrN0rtivnSBZMBy8Bhu8JqicGoVIdvAboJ6e4NzybozUELZ7XolFB 2yVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=SZh3vgQNdhAgs3O49TL/pKdFdGIycwFjLiFi0xOnDfs=; b=EzQR+OBxXGo8/+gjjd83MpeTHRwsE4Fe0dbMXyn1oEes5cXOSPszVsGzpRpK7Yiwlc 03WQMQfGnT8i1c6kBxvnHEH04yAnJAaQ8ldidt7ynsEdevf+/DC3+ix84jvTE2TpVzAe dCNRcCpXQGQbY8L4wLXBqXGuumOfHt5S92I2wlcs8uUS5XfStAf2lxOAYyma7Owm1tfr Gs/jmf5H78D5nI1BpebtgmGgBI00zsMEkNoE84xFHs21DXEFV0QaWEtMbzaIe0qxpX+R SvexQZZPXmbxlc+j/iJw2uczxKKvxqRfqzG91RRGvs4bNKQvXiUmUqVLyT56EYiNVnIO 8nVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=GeyydgPe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n11-v6si13533188plg.565.2018.04.08.20.12.45; Sun, 08 Apr 2018 20:13:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=GeyydgPe; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751774AbeDIDAt (ORCPT + 99 others); Sun, 8 Apr 2018 23:00:49 -0400 Received: from mail-bn3nam01on0139.outbound.protection.outlook.com ([104.47.33.139]:17920 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754338AbeDIAZa (ORCPT ); Sun, 8 Apr 2018 20:25:30 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=SZh3vgQNdhAgs3O49TL/pKdFdGIycwFjLiFi0xOnDfs=; b=GeyydgPeqU9r5t6hT2Z/5Ps4wCDr+YTcnHGzCkFYh1l1RqABaibyODwBLhENG/04AEcBVysS25WXu5rZxzVS9IRQLakOGbwya9oc7AU5L6qMAtpfB/Djpg6R3dNFGNvx5//tIx5uLNngFtu2Ye2K/HyjGKPRTGawrLNxqrWMIf0= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB1013.namprd21.prod.outlook.com (52.132.133.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.696.0; Mon, 9 Apr 2018 00:25:25 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::8109:aef0:a777:7059%2]) with mapi id 15.20.0696.003; Mon, 9 Apr 2018 00:25:25 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Hans de Goede , "Rafael J . Wysocki" , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 120/161] ACPI / bus: Do not call _STA on battery devices with unmet dependencies Thread-Topic: [PATCH AUTOSEL for 4.14 120/161] ACPI / bus: Do not call _STA on battery devices with unmet dependencies Thread-Index: AQHTz5i1wqT1oDsV8EGuNNwEfxthCw== Date: Mon, 9 Apr 2018 00:21:31 +0000 Message-ID: <20180409001936.162706-120-alexander.levin@microsoft.com> References: <20180409001936.162706-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001936.162706-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB1013;7:4ynYo4vjtINKbtXQQ2rCf42js+rarmQYKINMwxlJWFfsqtpYHV2J0LUA7CNAnHm7TNEZgE5a/5PLBtzTqzH/NffBDyFQROJecGQQrKKeJA/R8O2uN2rnDawleIXQ3mztYNjx+tGADwZaqnNS6Rvw8DrMOSj74FswQq1rJ0rn2/TF9tG0SSTYrqU2tD188PSohDAOLNMRr0oFtNJQeChIRhtL/JiVADzk9pfrkYbZnwdNTbli/GxgDmOUhNHeZ4UK;20:5RbTacDR/pxY6EQQoEI+S2JDh/gepnX34hQawdJrA74LaDgOG0uM4K11I3nucyDe1JJjDAfb94maANClBBbNLOIYiV8Kt3ZhS/y0UAlG10equ36jEf9WYd5z3s4jsCTmcssHQO/o7MJf9cMIsfMHPeBucPsjv7maN6mDaxvLag8= X-MS-Office365-Filtering-Correlation-Id: abf7c832-9ff4-4ace-cd64-08d59db063a5 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(3008032)(48565401081)(2017052603328)(7193020);SRVR:DM5PR2101MB1013; x-ms-traffictypediagnostic: DM5PR2101MB1013: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(211171220733660)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(8211001083)(61425038)(6040522)(2401047)(8121501046)(5005006)(3231221)(944501327)(52105095)(3002001)(93006095)(93001095)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB1013;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB1013; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(979002)(346002)(366004)(376002)(396003)(39860400002)(39380400002)(189003)(199004)(3280700002)(2616005)(8936002)(7736002)(476003)(446003)(11346002)(53936002)(3660700001)(86362001)(575784001)(86612001)(81156014)(2906002)(186003)(81166006)(105586002)(1076002)(8676002)(26005)(97736004)(25786009)(6512007)(3846002)(68736007)(72206003)(106356001)(5660300001)(6486002)(6666003)(6116002)(14454004)(4326008)(305945005)(6436002)(2501003)(5250100002)(10290500003)(478600001)(2900100001)(59450400001)(22452003)(110136005)(316002)(99286004)(66066001)(10090500001)(107886003)(76176011)(102836004)(54906003)(6506007)(36756003)(486006)(22906009)(217873001)(969003)(989001)(999001)(1009001)(1019001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB1013;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: sbwBEQxJzSjycNxkSc2uoPQbPI4M4LPpoqdSpb+HTQBp6HI1ts7DIH1j2UaZcnWsfK2aIuFdEo01VMZvmg4BoVlmatsr4gzdve/kyA7Qhb/VX96Zc5qsoNZftyWelDLBdEVv2TVwiO12OpuPPVTk6oP0Ws5AvDSEUfbA78ZJ0suBZM3qO2l74WRqysy+7VDhnhLCAlboBuruElCsirFvhedp4no+/3Q9DNs52WopGD/rYmyYeQ+xFNUWmWoQqpZf+SJFg91o4n0rsP7p6ewgc4CeBSObYG1axRpwESIquG1zs2U835zTF+VGYAEsau7gaYZbViwM3sXzbSEEveLnoyfhLtTgdGuVgqM5QsCVwlq2+Qn14ilf1G6grnWPmI+Q/707GGx4gBpGh/aj06KEtuwQ+BRAY6RtnxCgTrWh+aE= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: abf7c832-9ff4-4ace-cd64-08d59db063a5 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:21:31.6593 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB1013 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede [ Upstream commit 54ddce7062242036402242242c07c60c0b505f84 ] The battery code uses acpi_device->dep_unmet to check for unmet deps and if there are unmet deps it does not bind to the device to avoid errors about missing OpRegions when calling ACPI methods on the device. The missing OpRegions when there are unmet deps problem also applies to the _STA method of some battery devices and calling it too early results in errors like these: [ 0.123579] ACPI Error: No handler for Region [ECRM] (00000000ba9edc4c) [GenericSerialBus] (20170831/evregion-166) [ 0.123601] ACPI Error: Region GenericSerialBus (ID=3D9) has no handler (20170831/exfldio-299) [ 0.123618] ACPI Error: Method parse/execution failed \_SB.I2C1.BAT1._STA, AE_NOT_EXIST (20170831/psparse-550) This commit fixes these errors happening when acpi_get_bus_status gets called by checking dep_unmet for battery devices and reporting a status of 0 until all dependencies are met. Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/bus.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index b6d58cc58f5f..f0348e388d01 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c @@ -146,6 +146,12 @@ int acpi_bus_get_status(struct acpi_device *device) return 0; } =20 + /* Battery devices must have their deps met before calling _STA */ + if (acpi_device_is_battery(device) && device->dep_unmet) { + acpi_set_device_status(device, 0); + return 0; + } + status =3D acpi_bus_get_status_handle(device->handle, &sta); if (ACPI_FAILURE(status)) return -ENODEV; --=20 2.15.1