From patchwork Fri May 11 03:35:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yinbo Zhu X-Patchwork-Id: 10393229 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A6F6060348 for ; Fri, 11 May 2018 03:42:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9AA4928DEF for ; Fri, 11 May 2018 03:42:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8E2F328DF3; Fri, 11 May 2018 03:42:22 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D91D528DEF for ; Fri, 11 May 2018 03:42:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ezdyxHAELyLRJNBGm6klqAyGFxsBye+nl3LB/v7sq1g=; b=dPiUFg0yVZ3iuF FE4L27sTC1wUS8AXNbwe1i2mJ6G6ZYaTjBorLjBwq/LR5D9EP4um1X6nIw4MWoT/bqeeqkHaxc1JV WYpi9JpjB/Cl/LIxF2Sp5uBmQyvSHBiaAilOv4mboaLxSnwY9M3jlsM+iTUajN7DNc2OcxrA7GH49 s8o6BRLzQ8X91JDmZArDNiBKyAUyuPyvCm/UrMRIKUS/H8edDciqT81s9O3iekaZGEn8cUAGuFfjk MtDS0+G7soroopGbaNuyQN4IOWynsHS1L6C6X3p6jh7a72vu0Jk5WPWUVvmDufdz+MdBmBjL35btb qHZx7RGacjhUwTAMefqg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGywd-0005Yp-IG; Fri, 11 May 2018 03:42:11 +0000 Received: from mail-sn1nam01on0728.outbound.protection.outlook.com ([2a01:111:f400:fe40::728] helo=NAM01-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fGys3-00028S-Oj for linux-arm-kernel@lists.infradead.org; Fri, 11 May 2018 03:37:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freescale.onmicrosoft.com; s=selector1-freescale-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=vEgchfc3sBNHRk2tGM/jCntWwwAHTuq5iCO8peETSiE=; b=a+U1gjibyhpE19FR35DEQHsmiEwM1Kfo0MlCKaFX5l/OmBMpho0fkax5NQLfni0ZXMVexsNE0aLjs9aj8rrvtRa7/9Za4aEbhkoUrWZX5Cq2bCoDEcLSySr6AL1QAJ0z7LcYfYyAxL9aqCWgbTE+TfBWZVQYR3ih9de+RTdXEHM= Received: from BN6PR03CA0070.namprd03.prod.outlook.com (2603:10b6:404:4c::32) by SN2PR03MB2189.namprd03.prod.outlook.com (2603:10b6:804:c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.735.19; Fri, 11 May 2018 03:37:10 +0000 Received: from BY2FFO11FD025.protection.gbl (2a01:111:f400:7c0c::141) by BN6PR03CA0070.outlook.office365.com (2603:10b6:404:4c::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.755.16 via Frontend Transport; Fri, 11 May 2018 03:37:10 +0000 Authentication-Results: spf=fail (sender IP is 64.157.242.222) smtp.mailfrom=nxp.com; nxp.com; dkim=none (message not signed) header.d=none;nxp.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 64.157.242.222 as permitted sender) receiver=protection.outlook.com; client-ip=64.157.242.222; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (64.157.242.222) by BY2FFO11FD025.mail.protection.outlook.com (10.1.15.214) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.715.13 via Frontend Transport; Fri, 11 May 2018 03:37:08 +0000 Received: from az84smr01.freescale.net (az84smr01.freescale.net [10.64.34.197]) by tx30smr01.am.freescale.net (8.14.3/8.14.3) with ESMTP id w4B3b7tM026426; Thu, 10 May 2018 20:37:07 -0700 Received: from titan.ap.freescale.net ([10.192.208.233]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id w4B3aTss014534; Thu, 10 May 2018 20:37:00 -0700 From: Yinbo Zhu To: , Rob Herring , Mark Rutland , "Catalin Marinas )" , "Will Deacon )" , "Lorenzo Pieralisi )" , Li Yang Subject: [PATCH 5/9] drivers: firmware: psci: use psci v0.2 to implement sleep Date: Fri, 11 May 2018 11:35:26 +0800 Message-ID: <20180511033530.7931-5-yinbo.zhu@nxp.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180511033530.7931-1-yinbo.zhu@nxp.com> References: <20180511033530.7931-1-yinbo.zhu@nxp.com> X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:64.157.242.222; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10019020)(1496009)(39860400002)(39380400002)(396003)(376002)(346002)(2980300002)(1109001)(1110001)(339900001)(189003)(199004)(50466002)(316002)(26005)(7406005)(7416002)(106466001)(16586007)(2906002)(4326008)(81156014)(498600001)(5660300001)(8676002)(8656006)(50226002)(48376002)(81166006)(77096007)(105606002)(1076002)(97736004)(86362001)(356003)(8936002)(36756003)(51416003)(476003)(2616005)(446003)(110136005)(126002)(336012)(76176011)(54906003)(486006)(47776003)(11346002)(6666003)(6636002)(53936002)(44832011)(305945005)(59450400001)(85426001); DIR:OUT; SFP:1102; SCL:1; SRVR:SN2PR03MB2189; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; LANG:en; PTR:ErrorRetry; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD025; 1:dJ0W2YSSexHVe55OWniMIkncX/cnBEqHGhEiJux60nV91K8j//64PQYJ3mBcTmlSbxc0zjH6IKnUG7de2zeUMUSO9QsAAX2xhuW6EbZEQ4vHKVAwCW2mq3l+K0n/OcXU MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(5600026)(2017052603328); SRVR:SN2PR03MB2189; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2189; 3:9zICG90Yy251lb2yLUm6iXOQDXWAPY3NnUfsuymdDTsZvp/5vN+L5AVOHH4xQGGWWSlHXJxcRF75oe7lLO/6VOqHez8Q87ndE6ldheNwFc7VT5r1S1yQVqX2otyjzOVMfp77h/zoG3OZ0PSJdelaBV1VDVmUAFBHG6LGG65QvKC32+9wVfCNlVoZUWRbG5s4M/WhLfcLQKbPVdennppjyOHDj/wGCgiiHe4dBTuZfplorwpGZgy+9vHcmrHl3e3y3wP+fA5Gntu0P9svDrA9eW8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84iJOrsuWeZvBZnnsXNvEa7wfxaidl5gH/862iL/uj1eVRYCiC6JJxjDhB0ohRWcymtk2eg9CNTLcY/OdEUMuO7B1BZZh2RkQXw8Fh+LFAeDK1UbdMyz9+P+na1H2XBeA0mBM1zZxDxtU5jCod/ucYhMTctBNivi36Hlue+/yDaHS4LGvn9nTqXDlybfD2wDMcATdz3i4p+7n0y3cGvXV1pNTz54BO314tBm6E0Fp9nuvxcajwBmjgqejx4ou190YWaJabkhlRUbmVezjsz9wmRUxtCzEzMHXGWc3ZCjfKWGgUN8I+/x4ekVlLuLREH3Xuh1tJqyLk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-MS-Exchange-SenderADCheck: 0 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(93006095)(93003095)(3231254)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061750153)(20161123560045)(20161123562045)(20161123564045)(20161123558120)(6072148)(201708071742011); SRVR:SN2PR03MB2189; BCL:0; PCL:0; RULEID:; SRVR:SN2PR03MB2189; X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2189; 4:SY2r+fCAsRbuDQ6tDK24/0RqpI20jEiHLGGdrt/1w1zcDP1MhXyoPOnMtYETcd/ueDoiH8OIh1qyw6MgLjk1BQE1JtFP2g6GymJxkkdEuzRFydunILgxGKzrIs6K8a9M4e0BHMM9PegYnhELLGHUVVa5yCNVpUxl6Q6wYKR2AUtZ6viZWNtWNf/vDFMnq8fIWHDGsIfLkbTZQAu+qDZE28/LhJ8JMhYVOIlj2HSx5u8VNP95mjoZL7pSwGSxHXv33dbxAxu1OyPrjYxWyKbyGazwWQLI1DUNn+Pe207T+yo9EcRlYHRPg3VwP86K8+um X-Forefront-PRVS: 06691A4183 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN2PR03MB2189;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QnOq85Z+hGbGqyfuZM+K242IYX45LqOIbaFlUuZiX44CofyKHxnbkeDVS0DSxST+laAo+jCa0k6y59PWSanCJ8NZU7HPcBXt/QoXHE0ydnZkIl7b1pXtpysiaNs7oZw==; 5:vHlX7SxKRCI9yQei+Z5K0UfMVnbcty5829bk3cWaxR0ITeC/nm0zNc4fUiqXnZ/mOAQitvWDHjXT85fV/TL+6d4lAOMYAWaomWcbri+QqpbpVb7dT/qC3+wwVh9+ZQ1KaPaTRoMUYg2JuWFcm13QCBwbU6pqGlsnF1zPXj/8sc4=; 24:Mc8cb0qbCL1u9A/ED3vRJk/Ci4i+XPdr0MSbrAho/2EwpPRVp1NhCYSWeUWvfrSEG+FcJpj4mYlum0BOEfpSNHI4lg4ov4YcG6wNVaBe7Bc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN2PR03MB2189; 7:f3WobbwqBIJlu+2hjib5tuYlGt2gibVlbkqqdfl+YwRRFNdvFmBsvK8QWz7KzMBZhNUCUIwvQC3wRlipG5FtDG8tqaubIeOlqIZXgA7LbZiCXI/yymCAV1MtpwWSBISjCAOM14S9UiEz1feFMd+OGqmLIq6yn1HHPGPGSa2EQy7WDbYwervMda6Bekf8SVH7PQOjIGTSoKdBbiNZA4Xk6T20gmiVbtn22EOJPxnTK11XFJhRyQWURGJGdYZ0A0hw X-MS-Office365-Filtering-Correlation-Id: 412c5e39-aee1-438e-8682-08d5b6f07990 X-OriginatorOrg: freescale.onmicrosoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 11 May 2018 03:37:08.7126 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 412c5e39-aee1-438e-8682-08d5b6f07990 X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[64.157.242.222]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN2PR03MB2189 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180510_203727_882800_5A7C1EB2 X-CRM114-Status: GOOD ( 10.99 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Madalin Bucur , "open list:CLOCKSOURCE, CLOCKEVENT DRIVERS" , Minghuan Lian , Zhao Qiang , Meng Yi , =?UTF-8?q?Horia=20Geant=C4=83?= , Tang Yuantian , Sumit Garg , Daniel Lezcano , "jiaheng . fan" , Wang Dongsheng , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Hou Zhiqiang , "open list:FREESCALE SOC DRIVERS" , Nipun Gupta , Yuantian Tang , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, costi , Changming Huang , Priyanka Jain , Po Liu , ying.zhang22455@nxp.com, xiaobo.xie@nxp.com, Fabio Estevam , ran.wang_1@nxp.com, Shawn Guo , Bogdan Purcareata Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yuantian Tang Technically psci v0.2 can not support system sleep. Unfortunately our PPA only supports psci v0.2. So workaround this by changing psci v1.0 to v0.2 call to implement system sleep. Signed-off-by: Tang Yuantian Signed-off-by: Yinbo Zhu --- drivers/firmware/psci.c | 16 ++++++++++++++-- 1 files changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c index c80ec1d..0bd795f 100644 --- a/drivers/firmware/psci.c +++ b/drivers/firmware/psci.c @@ -437,8 +437,18 @@ int psci_cpu_suspend_enter(unsigned long index) static int psci_system_suspend(unsigned long unused) { - return invoke_psci_fn(PSCI_FN_NATIVE(1_0, SYSTEM_SUSPEND), - __pa_symbol(cpu_resume), 0, 0); + u32 state; + u32 ver = psci_get_version(); + + if (PSCI_VERSION_MAJOR(ver) >= 1) { + return invoke_psci_fn(PSCI_FN_NATIVE(1_0, SYSTEM_SUSPEND), + virt_to_phys(cpu_resume), 0, 0); + } else { + state = (2 << PSCI_0_2_POWER_STATE_AFFL_SHIFT) | + (1 << PSCI_0_2_POWER_STATE_TYPE_SHIFT); + + return psci_cpu_suspend(state, virt_to_phys(cpu_resume)); + } } static int psci_system_suspend_enter(suspend_state_t state) @@ -562,6 +572,8 @@ static void __init psci_0_2_set_functions(void) arm_pm_restart = psci_sys_reset; pm_power_off = psci_sys_poweroff; + + suspend_set_ops(&psci_suspend_ops); } /*