Received: by 10.213.65.68 with SMTP id h4csp2200622imn; Sun, 8 Apr 2018 22:20:55 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/T+DrVJuHOqlIpqbIoVfRpiiQbcYnKnrAtXddCWklfQ151GCRhjQZS7daI2Q9Zu18PoFny X-Received: by 10.101.75.66 with SMTP id k2mr23967032pgt.66.1523251255300; Sun, 08 Apr 2018 22:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523251255; cv=none; d=google.com; s=arc-20160816; b=Eam7K/P+dZFeHrdfHaAHy9OKBX+pWVsA1c0hoOGJYHvHB7yhD+4GenFFNu7mJvjRk/ ZZ7YQigmdD8hIPW0soe2Ixbavt6GB/rBnEdUQS2921Uo6jLWAREtz9rdEUYYywuJjqCN QV0AP4Yiq5vJnFx+YC5cnxV/2iaKPb0cZYUR0g9TO0fETsEpnuKqiJJxbAPh9nrxGtk9 eb11cEn+Xwtbhh2/LwN8vBo8SHw2OUJDcB7KYIrUOWMcMcAcWLOMdl5Jfb+Y56vCrQDo gz7wm6y572fX+DceMLRXIrI1EBZnDBdac+ie30cH4T55RpLjqtIsPNuyequbUKK0KOm2 YiBA== 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=vhB0c5mxYNKYYNCrX6a9LaPBfklGHLVRIPetU7bUmERCpXdxw24m2oy/bAHL1rOlKV dHkM9YzlDWQZjaqZ5xb4eO4Oei4MHo5Xk+qZWStv6gdSNAOBpiRx/tQl8ZHqDCiQkb9v K5gzSGiQPEVcUM4kM3FZ33ZOS66Jz0TcbSAED1O7H2qEum7fuYvOIIzaFU/CJHwkBobD j9Ncvg1RlDJdIbex8+X7vHgsgPLhk75JbmNg4C3F8GED33WZnlF+bcjmfJs6qEx6raSm IpJeEknsQp28Xm6tGOLVKjt8HVfLF3nbIdLITfWgkJmYZgaveO2Lqdtg7EK00tfNZ3A7 v0jw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=Diq9F1/H; 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 o2si3041739pgq.451.2018.04.08.22.20.18; Sun, 08 Apr 2018 22:20:55 -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=Diq9F1/H; 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 S1754292AbeDIAUl (ORCPT + 99 others); Sun, 8 Apr 2018 20:20:41 -0400 Received: from mail-dm3nam03on0097.outbound.protection.outlook.com ([104.47.41.97]:45238 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754233AbeDIAUa (ORCPT ); Sun, 8 Apr 2018 20:20: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=Diq9F1/HjmkL8D8vT1GuTRHXGWYPFXixqCgLwb0mA2CSuWr/sHoBDyMwq3E2girAlZFiNXjEUwK9JqJ5Rw/Xe/I0B5w+37RccvSskwcRcnY/fzNm28BYLXr+PeuvyE/GFc8cQoQVfDd/E+ger6o6aMZkbTpA369iWsOrOTHoooo= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0920.namprd21.prod.outlook.com (52.132.132.165) 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:20:22 +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:20:22 +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.15 144/189] ACPI / bus: Do not call _STA on battery devices with unmet dependencies Thread-Topic: [PATCH AUTOSEL for 4.15 144/189] ACPI / bus: Do not call _STA on battery devices with unmet dependencies Thread-Index: AQHTz5hSTwdjrM1obUWEF8VnbFuX6Q== Date: Mon, 9 Apr 2018 00:18:44 +0000 Message-ID: <20180409001637.162453-144-alexander.levin@microsoft.com> References: <20180409001637.162453-1-alexander.levin@microsoft.com> In-Reply-To: <20180409001637.162453-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;DM5PR2101MB0920;7:0Po4pOMIAYCNerjL15rLxZokkq1B1jbbKSpLRyBjYUf5tr9wTiwWeoEXK3k4IkYJPJ9if8+3D+C2CxVzDTkrnfuIRWK3WafoGmtoG4zPZulZqYovaf1wsBA9evMOOUW8dq0jwIqlU3S7WU7F33VwZIOgBtocd5Fnw2OY6SoRPlfmTBqAPrQ0mnfPCJdbM7qUJXe8egm8SWN1Z0e5Hmcok+zqrUge16xGFYIHQp/y6v3aGnorqmwgC8RhlHQ/Cf8i;20:5OyA8MnRF/sfJH5GHU74vMyfzW97TU0QOD1i+2t5SfXNv13SY2aZpTpdiAblGbv2wCUwVr8bNpVbYicaM8bNgk3xbGIPh0nCFciGe22n25aj93uattODfk6XRj42jevHffzSQTRtOd4DXEMQMOj34DPUE9N7mMZATe1t6Rmrd5I= X-MS-Office365-Filtering-Correlation-Id: bb15e9d5-87f5-44f6-fdbf-08d59dafaec8 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:DM5PR2101MB0920; x-ms-traffictypediagnostic: DM5PR2101MB0920: 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)(93006095)(93001095)(3231221)(944501327)(52105095)(3002001)(10201501046)(6055026)(61426038)(61427038)(6041310)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(6072148)(201708071742011);SRVR:DM5PR2101MB0920;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0920; x-forefront-prvs: 0637FCE711 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(39860400002)(39380400002)(396003)(366004)(346002)(376002)(199004)(189003)(66066001)(86362001)(59450400001)(3660700001)(3280700002)(25786009)(76176011)(2900100001)(36756003)(6506007)(2906002)(99286004)(86612001)(6486002)(102836004)(305945005)(1076002)(7736002)(575784001)(97736004)(2616005)(446003)(11346002)(476003)(486006)(26005)(6666003)(6512007)(4326008)(107886003)(5660300001)(478600001)(6436002)(105586002)(10290500003)(5250100002)(22452003)(316002)(186003)(8676002)(110136005)(81166006)(54906003)(6116002)(8936002)(72206003)(53936002)(2501003)(3846002)(68736007)(14454004)(81156014)(10090500001)(106356001)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0920;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;A:1;MX:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 4yxqhu8kpeiADUELxr/FMvfFjNV5Q0dKqjqJuJEOG3uYsf1GnqjalEUC0IgXfB1NWrF9mxF/E7uTfcRqAg/fu0I/iLiMr5VPQS4//EOZbknd1fFzrI945RpLh/sfpzCBKcmOcy9pAxKl7Mtt8cB7gp9ukyPFHmAWW4IfH4VlMEzeyO+ScOEfMFcOFSj7vCut7klsVwflsQSV2KXZ8vOZNKZ9347JEWK2VbFeljeu/7mbeBUPL2g7afE4q6gO0FuxzIoCIUTyb85I+aDr0d+UCfRLwToJEvKXQgNyH3yAnYnYw1/VvDR+AutPJJra1srcdLIL+imHrerJUGa910BSUK8wXV2J9WNDgzNbt7YHgoqaDkZhcxK8/+lj2KFhICOocyUnc53dhxXSpPOzjzIZMmzlc8R3y7MIIC3RS6f1Fbw= 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: bb15e9d5-87f5-44f6-fdbf-08d59dafaec8 X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Apr 2018 00:18:44.3781 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0920 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