From patchwork Wed Mar 27 13:21:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 10873477 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B29D71708 for ; Wed, 27 Mar 2019 13:22:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 99CCE28657 for ; Wed, 27 Mar 2019 13:22:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8DC2528BBF; Wed, 27 Mar 2019 13:22:06 +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=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 2738F28657 for ; Wed, 27 Mar 2019 13:22:06 +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:In-Reply-To:References: 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=SAF4cvcY9UQvdAx+IoQ9llsCdRiw+ofmHWK9r/NWt6U=; b=Zd+Ashyqxi46gF ye2+eRzOk/PwQ12u1EUhSD3sTUogD7J5RqQPgj6FHXDhRdQaxAHbpYv6/R9QXM0acIJVgFuHtiCxs uNkYiHpCkf04XWAeJUBGcITo76bjqbbPqOUYGgK4xqd1gMQh2D87xGv9XwKT7OafJojdQKvG3GplR Et0kWqiUgN8zoPBowyP0kD1Cj7dJ2US4iVda/TDDLccKgm0ruZ5mtuCr8wwx7XjiRq1TKmimSqKBt KNwc+GiFgnRwiq4O2qLzRK1stVAWbUJi7vEkWEDfCSwDKZLoVPnHCiJbByP2NoliaffSdyHaM+3TF 2mq91gjFMezWnTkarw4w==; 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 1h98VH-0004Ve-3g; Wed, 27 Mar 2019 13:22:03 +0000 Received: from mail-eopbgr20044.outbound.protection.outlook.com ([40.107.2.44] helo=EUR02-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h98UZ-0003XW-Ps for linux-arm-kernel@lists.infradead.org; Wed, 27 Mar 2019 13:21:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NnnvC8rrbllreco+SztEGDJRUJfZW3+oDSGTnyNzkbg=; b=Ag2NwhrfQYTotQRRC/5XIW3pnNkdksFiYh9UzG9vffDxvfBdkfu9F80CWsDtdukXUnnLPYj53fpzZnQZsp/YXbEsOAK5+5UCsFIfjgEtYKUgOE0preqBpBCIcVs3qPxB97tJnP2oIy9ETULGFSYb8O0Qt0ECv4CWyau35tWOSAI= Received: from AM0PR04MB5779.eurprd04.prod.outlook.com (20.178.202.151) by AM0PR04MB6051.eurprd04.prod.outlook.com (20.179.35.15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.15; Wed, 27 Mar 2019 13:21:17 +0000 Received: from AM0PR04MB5779.eurprd04.prod.outlook.com ([fe80::9579:32ab:898e:6769]) by AM0PR04MB5779.eurprd04.prod.outlook.com ([fe80::9579:32ab:898e:6769%2]) with mapi id 15.20.1730.019; Wed, 27 Mar 2019 13:21:17 +0000 From: Abel Vesa To: Sudeep Holla , Marc Zyngier , Rob Herring , Mark Rutland , Shawn Guo , Sascha Hauer , "catalin.marinas@arm.com" , Will Deacon , "Rafael J. Wysocki" , Lorenzo Pieralisi , Fabio Estevam , Lucas Stach , Aisheng Dong Subject: [RFC 6/7] cpuidle-arm: Add arm64 wake helper for cpu_poke op Thread-Topic: [RFC 6/7] cpuidle-arm: Add arm64 wake helper for cpu_poke op Thread-Index: AQHU5J/1bOMxExZCXkCLbXm+Qvy5kg== Date: Wed, 27 Mar 2019 13:21:16 +0000 Message-ID: <1553692845-20983-7-git-send-email-abel.vesa@nxp.com> References: <1553692845-20983-1-git-send-email-abel.vesa@nxp.com> In-Reply-To: <1553692845-20983-1-git-send-email-abel.vesa@nxp.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1PR0701CA0038.eurprd07.prod.outlook.com (2603:10a6:800:90::24) To AM0PR04MB5779.eurprd04.prod.outlook.com (2603:10a6:208:131::23) x-originating-ip: [212.146.100.6] authentication-results: spf=none (sender IP is ) smtp.mailfrom=abel.vesa@nxp.com; x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 5ba16ad8-f60f-45a4-0f71-08d6b2b71798 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600127)(711020)(4605104)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB6051; x-ms-traffictypediagnostic: AM0PR04MB6051: x-microsoft-antispam-prvs: x-forefront-prvs: 0989A7979C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(136003)(39860400002)(396003)(346002)(376002)(199004)(189003)(25786009)(14444005)(68736007)(4326008)(6436002)(5660300002)(6116002)(71200400001)(71190400001)(3846002)(256004)(8936002)(8676002)(6636002)(2501003)(66066001)(305945005)(2906002)(53936002)(81156014)(6512007)(7736002)(81166006)(7416002)(97736004)(6486002)(36756003)(54906003)(44832011)(50226002)(486006)(106356001)(6506007)(386003)(186003)(110136005)(102836004)(446003)(14454004)(476003)(86362001)(99286004)(11346002)(52116002)(478600001)(316002)(2616005)(26005)(105586002)(76176011)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB6051; H:AM0PR04MB5779.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: nxp.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: eSXvAMa0U6xLbvi2tcE/ajWZzzIv0+K15d7D82d/6eLP4dGOoihiAWS5FwjDTob5LuJSTiFDg/4vFkQhGPPDEuW34dJS3z31HPCtCZJNLt8bQU2evFJllwD2ssHV2IiqhOGcJW6n6iqWMq+VJHoSIN0rXksPwpAGjqqmzjz05/KxY7855UNzpFnN1YHx91/oQ/wH1UYke+GN5klQgHMn4shU+3y52h5yIuQxqGIGKdKBsgp4BX9X9VHW0LwlA1JY/UADPwlORki1mrCz9gTQ8z0/eMlPiiIxfca1dlhSztUOXNtkP0eJuOWA8CV5kjm4lVU0RYxSLUDSAzfWFp+y2BzbTxTb2jsrK84P06Y9a281PEOEMtyC3r7y+LuK8v5ckMYJ3DyLgmV7+pP+ByZfRB4Y9UHKvT8oOTbx0gpOdLM= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5ba16ad8-f60f-45a4-0f71-08d6b2b71798 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Mar 2019 13:21:16.9428 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR04MB6051 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190327_062121_011469_2A71C0FB X-CRM114-Status: GOOD ( 14.62 ) 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: Abel Vesa , "linux-pm@vger.kernel.org" , dl-linux-imx , "linux-arm-kernel@lists.infradead.org" , Linux Kernel Mailing List 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 When the arm_poke_idle_state gets called, the poking cpu_ops of the current core gets called, passing on the the index of the core to be poked. Signed-off-by: Abel Vesa --- arch/arm64/include/asm/cpuidle.h | 6 ++++++ arch/arm64/kernel/cpuidle.c | 8 ++++++++ drivers/cpuidle/cpuidle-arm.c | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/arch/arm64/include/asm/cpuidle.h b/arch/arm64/include/asm/cpuidle.h index 3c5ddb4..e637d4d 100644 --- a/arch/arm64/include/asm/cpuidle.h +++ b/arch/arm64/include/asm/cpuidle.h @@ -7,6 +7,7 @@ #ifdef CONFIG_CPU_IDLE extern int arm_cpuidle_init(unsigned int cpu); extern int arm_cpuidle_suspend(int index); +extern int arm_cpuidle_wake(int index); #else static inline int arm_cpuidle_init(unsigned int cpu) { @@ -17,5 +18,10 @@ static inline int arm_cpuidle_suspend(int index) { return -EOPNOTSUPP; } + +static inline int arm_cpuidle_wake(int index) +{ + return -EOPNOTSUPP; +} #endif #endif diff --git a/arch/arm64/kernel/cpuidle.c b/arch/arm64/kernel/cpuidle.c index f2d1381..af00955 100644 --- a/arch/arm64/kernel/cpuidle.c +++ b/arch/arm64/kernel/cpuidle.c @@ -43,6 +43,14 @@ int arm_cpuidle_suspend(int index) return cpu_ops[cpu]->cpu_suspend(index); } +int arm_cpuidle_wake(int index) +{ + int cpu = smp_processor_id(); + + return cpu_ops[cpu]->cpu_poke(index); +} + + #ifdef CONFIG_ACPI #include diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c index 76ee7ac..d5d3eef 100644 --- a/drivers/cpuidle/cpuidle-arm.c +++ b/drivers/cpuidle/cpuidle-arm.c @@ -48,7 +48,7 @@ static int arm_enter_idle_state(struct cpuidle_device *dev, static int arm_poke_idle_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, int cpu) { - return 0; + return arm_cpuidle_wake(cpu); } static struct cpuidle_driver arm_idle_driver __initdata = {