From patchwork Mon Dec 7 04:44:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ken Xue X-Patchwork-Id: 7780081 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id F40FCBEEE1 for ; Mon, 7 Dec 2015 06:23:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2264C2054C for ; Mon, 7 Dec 2015 06:23:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E4DC720503 for ; Mon, 7 Dec 2015 06:23:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751450AbbLGGXG (ORCPT ); Mon, 7 Dec 2015 01:23:06 -0500 Received: from mail-by2on0081.outbound.protection.outlook.com ([207.46.100.81]:7456 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751186AbbLGGXF (ORCPT ); Mon, 7 Dec 2015 01:23:05 -0500 X-Greylist: delayed 5571 seconds by postgrey-1.27 at vger.kernel.org; Mon, 07 Dec 2015 01:23:05 EST Received: from DM3PR12CA0009.namprd12.prod.outlook.com (10.164.12.147) by DM3PR12MB0859.namprd12.prod.outlook.com (10.164.7.141) with Microsoft SMTP Server (TLS) id 15.1.331.20; Mon, 7 Dec 2015 04:50:11 +0000 Received: from DM3NAM03FT012.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::206) by DM3PR12CA0009.outlook.office365.com (2a01:111:e400:599f::19) with Microsoft SMTP Server (TLS) id 15.1.337.19 via Frontend Transport; Mon, 7 Dec 2015 04:50:11 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.221) smtp.mailfrom=amd.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from atltwp01.amd.com (165.204.84.221) by DM3NAM03FT012.mail.protection.outlook.com (10.152.82.116) with Microsoft SMTP Server id 15.1.346.13 via Frontend Transport; Mon, 7 Dec 2015 04:50:10 +0000 X-WSS-ID: 0NYZ1FM-07-ERV-02 X-M-MSG: Received: from satlvexedge01.amd.com (satlvexedge01.amd.com [10.177.96.28]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by atltwp01.amd.com (Axway MailGate 5.3.1) with ESMTPS id 28BD5CAF2E5; Sun, 6 Dec 2015 23:50:09 -0500 (EST) Received: from SATLEXDAG02.amd.com (10.181.40.5) by satlvexedge01.amd.com (10.177.96.28) with Microsoft SMTP Server (TLS) id 14.3.195.1; Sun, 6 Dec 2015 22:50:32 -0600 Received: from SCYBEXDAG04.amd.com (10.34.11.14) by SATLEXDAG02.amd.com (10.181.40.5) with Microsoft SMTP Server (TLS) id 14.3.266.1; Sun, 6 Dec 2015 23:50:08 -0500 Received: from [10.237.74.14] (10.237.74.14) by SCYBEXDAG04.amd.com (10.34.11.14) with Microsoft SMTP Server id 14.3.266.1; Mon, 7 Dec 2015 12:50:03 +0800 Message-ID: <1449463473.2175.13.camel@kxue-X58A-UD3R> Subject: [PATCH 1/1] ACPI: Support D3 COLD device for old BIOS From: Ken Xue To: , , , CC: , , "Andy Shevchenko" , , Date: Mon, 7 Dec 2015 12:44:33 +0800 X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.221; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(428002)(199003)(189002)(106466001)(105586002)(229853001)(87936001)(103116003)(5001770100001)(97736004)(86362001)(50226001)(189998001)(47776003)(77096005)(19580395003)(50986999)(2201001)(19580405001)(586003)(230700001)(92566002)(101416001)(23676002)(5008740100001)(33646002)(33716001)(50466002)(1220700001)(1096002)(5820100001)(11100500001)(99106002)(3940600001)(2101003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM3PR12MB0859; H:atltwp01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0859; 2:0QmLLheRwW0nRMK1YJTPaqsFFKLYajDynArXhN2SKmCy9TlpN5U8RD7tzPERT7M28bLqK0ORaj7Xmwa7WWL4zQk8CWgCziBQ+/hXHMZVeLhJXac11i44bKiiYpkF5D0aobywcp+a+l6Q+Mw1J/Evag==; 3:ewukE65nVPQ301RzN4g6DvKYm7h0ODx6QYRYmLQplF0p8TR/2Mq+HJ07/cT84IqEOalppy/IMpBcaNQ5MnPcoucihERNdFG2D3okq9UCaaAPlD2l3meQ+D6G+ULt0TBnERCpVDy9bPvNqSeFgkEJdbVqfhxX23A+TYPpGtWWN7g5YCZkN+dXeaRik1KkSP9x/54YkiAMzVd96FozfSM2t2nX4BHc3Oh5ujkRxfpdHqI=; 25:ogEkY+v5qMRKUQTqkXzOW8Uv6+JHzssEtCqELoFWYyHyTcP18F8KrERaWhEc/kqARl/9zY0hqHlldb+Y45YwVdvE3z4mbPWM3Wtjmjxou/vH/wSXz3di7Qi029lNIIE3iAgBM1eIbjY3ZaYy3N23dAqX4/QtrNyRvGoANC60tYLA8S/d0h5vGtz1X3N5TGbHO01yfGdAk8s/nMrUc7WFWPXy7Gz68M1B/YcocybIsDn2IRXrtmT3PwNepW+w0tsd X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM3PR12MB0859; X-Microsoft-Exchange-Diagnostics: 1; DM3PR12MB0859; 20:SnJvrlEbKgRXIvY5/DyFIP95Bq6nzCLe1bN9Vf9KiMPthYyir8uKSu+83PYscMk58nuOaeUBC4bnh4aH3BrdUM2EUtK+cwVCGfaGK+ksQ2IwYgsWfCR/jAOPVgIy8EjhhTRMRwfk/3ipwt3elJv9792yrS5IN301mLTizaEJp4zS/+e9mW7+RcItkUMgW49zU7u670ekHBTDvBxt/Us704BMbJRRNjVy+gx2kRf0xz5ACXCQQB/r7RT6rISOfCXefoQbRoTEQjqtwUiFjpiRPrkCmtYdoMibONyxtvwXb/oF3MU8goCv7Sfnq8n+xPNSew7pk6zmZLlDZGUFuHnFSNqnwHVY6F823AnAGuBl0UrGaTIO6D4mp/1fEjMk8XEpBeUkAmIdXkxtJf/3u6pjEopCZ65zxKecCqQKtPCkuGG5YpPMvLU2BupVeMadwDMrlxVimydF4AJHWb11j9/ansY9kFnauWjnllqgJpEPOtVEfwbF1OoepOiI2SNRmQRb; 4:wec25AuenVLGbx1kZUWE/NDvauO1plEmZklxS8aT/r0u53puetG8saUXqKd+aKpRVmojXoLApYhfCLTyMI4VQi16fWmxYFYgXMp17OZ3cOa3k14Y8Vavt3h2GWLEkz8/R7LoxcJyB/Cl1jtuRB+8dJbJ927ciBg3MXYCKwfSMXIJ67H3NP6ixnNrGzcZ+S6RTORSi0dmnguEHJnw3kWWk5I6kzuPBbFPHvQVag7xtFJps2FBFg99HsAZF6sGHhXuc+8ITgfP9yoNmOz2et+tS9AKHj2jcTYXsgXgMkpV/xXKPKt2+R2/JosTL9dUzLOJm4KHMwxZzFskKNHaMrk2hBG4QPw0rnIAzy+P3LUGNW1+IAvvIZYElTb9mqcWmBVgUjzkqjSg5GLxnnKOkDDfCqX3n61OxpE0uapPwe 03Cm8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001)(10201501046); SRVR:DM3PR12MB0859; BCL:0; PCL:0; RULEID:; SRVR:DM3PR12MB0859; X-Forefront-PRVS: 078310077C X-Microsoft-Exchange-Diagnostics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qzY5vptTObt4J1RbXI7KbetMiA4oD3yf8EJdcvWrtztt98Tb7Rd12lsoV23jkbrq4xR9P9fa6RUJyOkRhz SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Dec 2015 04:50:10.7849 (UTC) X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.221]; Helo=[atltwp01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM3PR12MB0859 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP D3cold is only regarded as valid if the "_PR3" object is present for the given device after the commit <20dacb71ad28> (ACPI/PM: Reworkdevice power management to follow ACPI 6). But some old BIOS only defined "_PS3" for the D3COLD device. And old kernel also believes the device has "_PS3" is a D3COLD device. So, add some logics for supporting D3 COLD device for old BIOS which is compatible with earlier ACPI spec. Signed-off-by: Ken Xue Reported-and-tested-by: Gang Long --- drivers/acpi/scan.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 01136b8..85c16bb 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -979,7 +979,9 @@ static void acpi_bus_get_power_flags(struct acpi_device *device) acpi_bus_init_power_state(device, i); INIT_LIST_HEAD(&device->power.states[ACPI_STATE_D3_COLD].resources); - if (!list_empty(&device->power.states[ACPI_STATE_D3_HOT].resources)) + if (!list_empty(&device->power.states[ACPI_STATE_D3_HOT].resources) || + ((acpi_gbl_FADT.header.revision < 6) && + device->power.states[ACPI_STATE_D3_HOT].flags.explicit_set)) device->power.states[ACPI_STATE_D3_COLD].flags.valid = 1; /* Set defaults for D0 and D3hot states (always valid) */