From patchwork Wed Dec 9 08:17:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ken Xue X-Patchwork-Id: 7805321 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 3BC1B9F350 for ; Wed, 9 Dec 2015 08:23:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 45568204D6 for ; Wed, 9 Dec 2015 08:23:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5366D204D8 for ; Wed, 9 Dec 2015 08:23:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751354AbbLIIXO (ORCPT ); Wed, 9 Dec 2015 03:23:14 -0500 Received: from mail-bl2on0056.outbound.protection.outlook.com ([65.55.169.56]:13831 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751281AbbLIIXM (ORCPT ); Wed, 9 Dec 2015 03:23:12 -0500 Received: from BY2PR12CA0037.namprd12.prod.outlook.com (10.160.121.47) by BN4PR12MB0849.namprd12.prod.outlook.com (10.164.59.11) with Microsoft SMTP Server (TLS) id 15.1.337.19; Wed, 9 Dec 2015 08:23:10 +0000 Received: from BY2NAM03FT032.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::200) by BY2PR12CA0037.outlook.office365.com (2a01:111:e400:2c84::47) with Microsoft SMTP Server (TLS) id 15.1.355.16 via Frontend Transport; Wed, 9 Dec 2015 08:23:10 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.222) 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 atltwp02.amd.com (165.204.84.222) by BY2NAM03FT032.mail.protection.outlook.com (10.152.84.228) with Microsoft SMTP Server id 15.1.346.13 via Frontend Transport; Wed, 9 Dec 2015 08:23:09 +0000 X-WSS-ID: 0NZ30MI-08-IN4-02 X-M-MSG: Received: from satlvexedge02.amd.com (satlvexedge02.amd.com [10.177.96.29]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by atltwp02.amd.com (Axway MailGate 5.3.1) with ESMTPS id 26DA2D22212; Wed, 9 Dec 2015 03:23:06 -0500 (EST) Received: from SATLEXDAG01.amd.com (10.181.40.3) by SATLVEXEDGE02.amd.com (10.177.96.29) with Microsoft SMTP Server (TLS) id 14.3.195.1; Wed, 9 Dec 2015 02:23:28 -0600 Received: from SCYBEXDAG03.amd.com (10.34.11.13) by SATLEXDAG01.amd.com (10.181.40.3) with Microsoft SMTP Server (TLS) id 14.3.266.1; Wed, 9 Dec 2015 03:23:06 -0500 Received: from [10.237.74.14] (10.237.74.14) by SCYBEXDAG03.amd.com (10.34.11.13) with Microsoft SMTP Server id 14.3.266.1; Wed, 9 Dec 2015 16:23:02 +0800 Message-ID: <1449649050.2175.59.camel@kxue-X58A-UD3R> Subject: [PATCH V2] ACPI: Support D3 COLD device in old BIOS for ZPODD From: Ken Xue To: , , CC: , , , Andy Shevchenko , , , , Date: Wed, 9 Dec 2015 16:17:30 +0800 X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:165.204.84.222; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(2980300002)(428002)(209900001)(199003)(189002)(5001770100001)(47776003)(92566002)(105586002)(586003)(230700001)(5820100001)(5008740100001)(97736004)(86362001)(1220700001)(1096002)(33646002)(101416001)(50466002)(189998001)(11100500001)(33716001)(15395725005)(2201001)(50986999)(106466001)(229853001)(23676002)(575784001)(87936001)(19580395003)(19580405001)(15975445007)(103116003)(50226001)(77096005)(99106002)(3940600001)(6606295002); DIR:OUT; SFP:1101; SCL:1; SRVR:BN4PR12MB0849; H:atltwp02.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0849; 2:lmvx56mlHBhZin9qEzG18WJkWIT734g7jvEJWquPm/wgI5kKD7AO5kGyqrCt6zi0xTEguXj9cyDdWAyjDvusAGrLQuTmKvYDr1hgIAbNqzr9LNaQjx+cMgbZwpDY094RJLLSTHIi0Eh7leyQCC9WpA==; 3:1hyfVMExT7IrtycUFlgFAgLJ5IP7DTzzCcpzcP5q9UwoynDwIGDAWwGChEbiYQeey5tnKi2ffK5rfAkYcYVIqChWJFqBlKl7k2KFoB3/F7yFtbsxep8ozyzSxakVjODB6IqnzRVfLYS3S9LuLXr++OMcnwePnMx5kicw2tj4I/IvKFtQVelW3I9kba9fbJQUCmQcapgDUgehJaSDOs0nqjJE4XzGCmglzU1Qm6LfPnI=; 25:tOJ2n+hbpPG/gFRWfHQ084cTxvrqRYQP/XY0zj0nXvZZRfP1MZGS1EU01c7mddoGRA5idhkyBzb3rwp2tcoSiRyVe9v8q5sQXCmowyLWonKZIzPErkXB8P5pOQqCF+6D6QS45c8xwPgi694QkYKdfwZptPg1g1CdJeQA4r6NGUmarKBZAHpw+RsjLzoAWY/8TPJVF4vr7nS3EwcDx3IHOyU8r1wkPbekKs0BsXX7ndXP1/mV66GBTN3tINOQrTW7 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN4PR12MB0849; X-Microsoft-Exchange-Diagnostics: 1; BN4PR12MB0849; 20:Y/oi9nI646AM7Pas/v9OU5p9FcLWzZwOUhi+hfhUchnfD1iUQpJkpisGmWrNuSc8L/cKWVcj9slKkQyVHSamlp0UHrkWCHcMP3YxKWSBaw18WlegbgHGDeeCt07LUxMIYNipxGc6NTaaNspSG3Yqu5vqP7yNBKBVoB1eYZ0L0ZXzKCfSKaMXUSGSLFLSU7pafzvmlW4lLk49ID28pQdTPx5gksfZ8HJdbu566hf0GeW5zGa7HJ8i8M3ot2HMhWsU8BJadGehUErcLGRuWrxsZScASxqS200E7zEt7s5bDg0DgvCemISdhq9LRFe/2CfZq0ujnwv5EJpwfqcZeAoA6QjgCo1TSaIBvdwP+PjWZK5MwcZv3xPdvizND9AMVoz+rzgn4zYkEVjiKum19tJj9S9/7mwxmWOfawOxeL+guRzCCGp2Ly2if6wA0whpauL9CJ/SYfzGt68LS8k7LiEOmhnntO/hHFfTFsNiid2+s3nBTZVowskCqjD+d/ZaXF9Q; 4:knP0w7zbxKY12+L6lOn7pMoDIyfKjNOEBCk4IpBdUGR+3lejwjBtFLdZ19oyh36q5n046tJXI15KAoQx2mzb8QotHELShuEDQX0uooirzTnCpry5CEqHtzs/LDhUoF7YUspSmLYQIWR6/ltTdbrZcuDPih3MhFgYR4bBZ3m46v3G5tjTtOBenQWHi8Mo45sKUtUR/m5bh+l0t8jHg0WeI7LQ09kqtLZf1PONcwjyVen+5gvigj9p5zaciO1OmTNnrYrwiqXAmU53MIfdzi+nveHxgvFbTi2Kj4M+RETmPQuE5C9iWCHB5oypkI0m+ZNPLMGexIF8iTRi6S8I/a5IGF2oIJK956PnJoVWYlkIpIAAdUVIb8wYJjA+z/JlZFK8ieLo80DDtSg9EUxE+Py9nryqMO+y4DWHuaxbRT uvkGM= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(520078)(8121501046)(5005006)(10201501046)(3002001); SRVR:BN4PR12MB0849; BCL:0; PCL:0; RULEID:; SRVR:BN4PR12MB0849; X-Forefront-PRVS: 0785459C39 X-Microsoft-Exchange-Diagnostics: =?utf-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6cuBBesFaO6F/RS+Ye1atY9t1pcZWgn/UkzCIz/2RFBQ90SR0/sCLDetlwQrAgsWaFsLkLmcPLYU4HThJTc/23tk16V+zLLQnDpjPNLzUcGJ10Wfu78s2ls4yAx+4KkAIoEVO25dBhMAj2l3+Ew8BC9ryRi5G7J3HPHpiGkjOIM/gegdK6B1lUiloLYuOk48sjetf55r3FAiHG4xL9XTip2sTN/wZjtHKCoudivPglN SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Dec 2015 08:23:09.2607 (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.222]; Helo=[atltwp02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN4PR12MB0849 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: Rework device power management to follow ACPI 6"). But some old BIOS only defined "_PS3" for the D3COLD device, such as ZPODD device. And old kernel also believes the device with "_PS3" is a D3COLD device. So, add some logics for supporting D3 COLD device with old BIOS which is compatible with earlier ACPI spec and kernel behavior. Reference: http://marc.info/?l=linux-acpi&m=144946938709759&w=2 Signed-off-by: Ken Xue Reported-and-tested-by: Gang Long --- include/acpi/acpi_bus.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index ad0a5ff..9894b75 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -631,7 +631,9 @@ static inline bool acpi_device_can_wakeup(struct acpi_device *adev) static inline bool acpi_device_can_poweroff(struct acpi_device *adev) { - return adev->power.states[ACPI_STATE_D3_COLD].flags.valid; + return adev->power.states[ACPI_STATE_D3_COLD].flags.valid || + ((acpi_gbl_FADT.header.revision < 6) && + adev->power.states[ACPI_STATE_D3_HOT].flags.explicit_set); } #else /* CONFIG_ACPI */