From patchwork Wed Mar 27 13:21:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 10873465 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 254B71708 for ; Wed, 27 Mar 2019 13:21:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 07A4E28657 for ; Wed, 27 Mar 2019 13:21:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EFCCE28AED; Wed, 27 Mar 2019 13:21:41 +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 A129728BBF for ; Wed, 27 Mar 2019 13:21:41 +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=vfFfMZj6aakKYfml5TUftfd1/EOpGq88gGs3eb217FM=; b=OMxmz9qSLFKdit kubvPHThcPzfx4hkc0GWBOVtPSK6aELczLLDxwPHJeCyPRRZ2ShgRmdq6TB4BqYDfmRXq/03rrLRz Ym0bN7A5pPNuuB1kYepGSyA3tUDFIzPhf7SFopcR/muv/w/0TLYRngUSZ8N7xtVKW/eRy5mcUNJ2s Vph1OxQf++cCJzu6Dm/K0XT4/rgMwzd/1d2t7S6IhpRoDcjvhd5YfVqXPryTOU3kQNvTUtEYPN4DP hBL9ObxgkKcKO1TUGaXhlIoKuCzxvSNs5lg5c5dgFQAdDyfnyVpxpD8JRHxJ2Aos5ZZLZq7fc7R7A EhdNcUx2ycrEaEfHWHEQ==; 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 1h98Ul-0003sd-Rb; Wed, 27 Mar 2019 13:21:31 +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 1h98UT-0003XW-Ti for linux-arm-kernel@lists.infradead.org; Wed, 27 Mar 2019 13:21:15 +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=LR48d2g1vkoK40i8uWTgFtA7Op5aZtshDE+l5myETRI=; b=NsUquUgNsTpO92i0D91klAb/ZbWbonUzt88kmQTOFrj6Ivummgv+OQ991xlu8cfXfb6kkeTvHrOUs8XhiU/ffe45YK5liMoi/ENj6bShG9YsBc0XyHbZgo80Jt/33mI8/F0xuYlU/OKxX+Sdk2YpcyXGnPIMaLP5S54ld3Hz3IA= 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:08 +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:08 +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 1/7] sched: idle: Add sched get idle state helper Thread-Topic: [RFC 1/7] sched: idle: Add sched get idle state helper Thread-Index: AQHU5J/wYerhjHZf+0GO74u+rDGu6Q== Date: Wed, 27 Mar 2019 13:21:07 +0000 Message-ID: <1553692845-20983-2-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: b86b3313-a923-40fb-4cc8-08d6b2b711ed 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: vmOOorQZXAGQNM5Depghx6Zq76DGExyX1Hv/jWWvLTso5nqYjGo/4ee2wHaBhccJRjZEryZyxd+Kx4tAerSosZjlLqQGoAkDNymzsNBogrl2Swj1BoCxc50jA3BF/Gx2/eqQ8nuSEjD+DwETAtX/SNY0vVHmeoaeFBM/ecUw1G10zSU/9BrOCXKp7ZqxdrwJ+orprLAJTnQ/zabmOQz15Tw8WL8aNyAEba4vGuK3EGWehHG/vgaJ3YU0GEL3FK1DTLzdOc43Yt6oOPUIirKygx/CCNrv7IWDy3qLGUUTBSdRLdfUgZDAQdl7zZSXfkKDAox9MGBZWDbWeefoqx28T3Dr+FyIAnmIB/I+L1TWVm5V2zp9px0Ur7ygWwcs7+8/A/JIejKKXrmOoCvtuJwvXYloaRWnezR0ZQIQKPycVFc= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b86b3313-a923-40fb-4cc8-08d6b2b711ed X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Mar 2019 13:21:08.2226 (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_062113_956576_D9F9E59F X-CRM114-Status: GOOD ( 12.05 ) 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 This helper is useful in order to get the idle state of a specific cpu. Signed-off-by: Abel Vesa --- include/linux/cpuidle.h | 1 + kernel/sched/idle.c | 11 +++++++++++ 2 files changed, 12 insertions(+) diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 3b39472..88a9119 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -211,6 +211,7 @@ static inline void cpuidle_use_deepest_state(bool enable) /* kernel/sched/idle.c */ extern void sched_idle_set_state(struct cpuidle_state *idle_state); +extern struct cpuidle_state *sched_idle_get_state(int cpu); extern void default_idle_call(void); #ifdef CONFIG_ARCH_NEEDS_CPU_IDLE_COUPLED diff --git a/kernel/sched/idle.c b/kernel/sched/idle.c index f5516ba..484825d 100644 --- a/kernel/sched/idle.c +++ b/kernel/sched/idle.c @@ -21,6 +21,17 @@ void sched_idle_set_state(struct cpuidle_state *idle_state) idle_set_state(this_rq(), idle_state); } +/** + * sched_idle_get_state - Get idle state for the specified CPU. + * @index: CPU index. + */ + +struct cpuidle_state *sched_idle_get_state(int cpu) +{ + return idle_get_state(cpu_rq(cpu)); +} + + static int __read_mostly cpu_idle_force_poll; void cpu_idle_poll_ctrl(bool enable) From patchwork Wed Mar 27 13:21:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 10873467 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 35DDF1708 for ; Wed, 27 Mar 2019 13:21:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DDCD28657 for ; Wed, 27 Mar 2019 13:21:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 121C028BBF; Wed, 27 Mar 2019 13:21:46 +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 A37E628657 for ; Wed, 27 Mar 2019 13:21:45 +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=WlAKrD3LneynYE+u8k3r+1sYVdpNESo0JSJQ9a1cvnw=; b=gvej3UeM+OQEvv CmjoCpybZXJqGk3iDifnaXMYPNRG4AWgP7KabhfbOnlzRvNVrG7uGCALRv0h6GMC4lcxNp+Xx4HTR 8mmGB3gJVQYhFVqhX7TCQyswuqGWK+gHxRMCfTPOOftThN0N36/CF9a76mncIbQ7mMfjCLhPGlkfX +wDMWiKxLZ6A628Pr4helVi7viL+MbuC17D6QAqxIEYIVwcpkG/LuuH4oFN18xaN9Ea5b7AN1TH1K ahVnIT5n60jTsUPzgJTShK3e1V0i/msfm+qhn9UHqWpA1oOAtGUBhr+CRhXwrRzTNXtP3S9LRwsAH jWcApgmu6lpzx6ADoSlA==; 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 1h98Uw-00044E-CK; Wed, 27 Mar 2019 13:21:42 +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 1h98UW-0003XW-8k for linux-arm-kernel@lists.infradead.org; Wed, 27 Mar 2019 13:21:19 +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=mJoxWhmCyb3/U5EQiMFlg+3tnG1hrEoxJr+Q2jp8qb4=; b=F0FPr0vgVEoD406wyJs3lSN4FABwuOgxpn2IacEjm5eAAfLdvGLQQ6dTZs9mSppKTbFjP7ZIi3rYb+CXJhxCFkKX7LCcLx6UTzCS58ldIbwI5NFheKK3XOT2I9voyEFLxXw70diiVj6kcPRezU6YQu0jbKJay92Dsca/BIlzLFE= 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:10 +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:09 +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 2/7] cpuidle: Add cpu poke support Thread-Topic: [RFC 2/7] cpuidle: Add cpu poke support Thread-Index: AQHU5J/xpRRIW2AJek+3mcOjLL/sJg== Date: Wed, 27 Mar 2019 13:21:09 +0000 Message-ID: <1553692845-20983-3-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: 3ab53a77-04b0-4d0c-da77-08d6b2b7138d 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: TWH2+42YzTL6r44EZTcRdorG9+5Np9ttK6YSpIXGF/hrUeQvdfNgtu7oZUyCeQWDbW7dWBaqqOChfu+Hq0Klo9+F5IaA9IyoPzS/8eRFdmwo0QrjFSLcC8MynB7byLhB4w5gk2L4WMzw0mw8w+QCQ+O1f3utBRcRocvv0F6QQ5S3scocSOrvk/mEWuDxolBgfsLMRA5iI5LE4bug1qU3FgC6LTTkmDaZlX/cuIcTIvtGBoKDDX4bhzd8SIYBil/lTrpW7Sr+q8dH+fAG548PXvli26DFVu5vwTJaim6lnrgH6+sKwgyeN/tGFtYDIsXfkGDxZjhF9sI+0hYQPXtahAFb175eXZLSGX0YVuSt/rAZW4OA53rtfnffJwj8U0PHyJP4216wsMYLrZR/p7AFLWnNEGvXsyUhgEFXDkTphZ4= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3ab53a77-04b0-4d0c-da77-08d6b2b7138d X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Mar 2019 13:21:09.9348 (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_062116_499524_D22CF65E X-CRM114-Status: GOOD ( 14.05 ) 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 Having a poke operation per state, allows each cpuidle driver to implement, for each state, different ways of waking up (poking) cores. Signed-off-by: Abel Vesa --- drivers/cpuidle/cpuidle.c | 34 ++++++++++++++++++++++++++++++++++ include/linux/cpuidle.h | 6 ++++++ 2 files changed, 40 insertions(+) diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 7f10830..fca5313 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -297,6 +297,29 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, } /** + * cpuidle_poke_single - poke the specified cpu to wake up from + * current idle state + * + * @dev: cpuidle device for this cpu + * @drv: cpuidle driver for this cpu + * @cpu: the index of the cpu + */ +int cpuidle_poke_single(struct cpuidle_driver *drv, struct cpuidle_device *dev, + int cpu) +{ + struct cpuidle_state *state; + + if (cpuidle_disabled()) + return 0; + + state = sched_idle_get_state(cpu); + if (state && state->poke) + return state->poke(dev, drv, cpu); + + return 0; +} + +/** * cpuidle_select - ask the cpuidle framework to choose an idle state * * @drv: the cpuidle driver @@ -414,6 +437,17 @@ void cpuidle_resume(void) mutex_unlock(&cpuidle_lock); } +void cpuidle_poke(const struct cpumask *mask) +{ + struct cpuidle_device *dev = cpuidle_get_device(); + struct cpuidle_driver *drv = cpuidle_get_cpu_driver(dev); + int cpu; + + for_each_cpu(cpu, mask) { + WARN_ON(cpuidle_poke_single(drv, dev, cpu)); + } +} + /** * cpuidle_enable_device - enables idle PM for a CPU * @dev: the CPU diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h index 88a9119..0270771 100644 --- a/include/linux/cpuidle.h +++ b/include/linux/cpuidle.h @@ -55,6 +55,10 @@ struct cpuidle_state { struct cpuidle_driver *drv, int index); + int (*poke) (struct cpuidle_device *dev, + struct cpuidle_driver *drv, + int cpu); + int (*enter_dead) (struct cpuidle_device *dev, int index); /* @@ -145,6 +149,7 @@ extern void cpuidle_unregister(struct cpuidle_driver *drv); extern void cpuidle_pause_and_lock(void); extern void cpuidle_resume_and_unlock(void); extern void cpuidle_pause(void); +extern void cpuidle_poke(const struct cpumask *mask); extern void cpuidle_resume(void); extern int cpuidle_enable_device(struct cpuidle_device *dev); extern void cpuidle_disable_device(struct cpuidle_device *dev); @@ -181,6 +186,7 @@ static inline void cpuidle_unregister(struct cpuidle_driver *drv) { } static inline void cpuidle_pause_and_lock(void) { } static inline void cpuidle_resume_and_unlock(void) { } static inline void cpuidle_pause(void) { } +static inline void cpuidle_poke(const struct cpumask *mask) { } static inline void cpuidle_resume(void) { } static inline int cpuidle_enable_device(struct cpuidle_device *dev) {return -ENODEV; } From patchwork Wed Mar 27 13:21:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 10873475 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 815F3139A for ; Wed, 27 Mar 2019 13:21:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 678C028657 for ; Wed, 27 Mar 2019 13:21:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5B99128BBF; Wed, 27 Mar 2019 13:21:58 +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 C6F5328AED for ; Wed, 27 Mar 2019 13:21:57 +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=nSeNZ9qkMGPFTJcOWqmFQ1zJ7UbvKDjeLrfV4UFKWS4=; b=LsU5MKgzOTYV/F sEMNYsFVXKL3sjCMfNScOcqj35CHcSFOpnBJk4sWxi0r2Kj1MsNIpob0tSkDRhxsU1s74+ka9wjPG HDx/IlXqDvi4LlDBVB6V8NJ5N+pukj5rbp98qaKTtgOhZ/S4IGnLiOyo+v6SbU94Yy4n3q2Tzl5qi NBM70vrFe//bnyOnPRb3WBzlTfcmjPerfiH6E7C8CznTm10XEkA4dWEJ0UgvebX82Dbk3wrtoxMhy FA9dgsg6V7fIVZklg98RfrOCvKCYxZKag6ZDfoT2k05/sNnUOI2+Ze8gIgVeIb6y28xum+i5C+iKu PIAfWTyh7sgXQzFgLweg==; 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 1h98V5-0004JJ-MO; Wed, 27 Mar 2019 13:21:51 +0000 Received: from mail-db5eur01on0618.outbound.protection.outlook.com ([2a01:111:f400:fe02::618] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h98UZ-0003YO-TG for linux-arm-kernel@lists.infradead.org; Wed, 27 Mar 2019 13:21:26 +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=40SFnIjgxvNsiI+hPmydu4vsYSvQXaeVREae9BA1guk=; b=qUcDrVbwdOIPa/unlw95cgpd++wsVSUabOXqR1DNk40QlBuiVmY6WyIuAZx9oEtlddmdw0y6iWqjLZYBmDYvOHTuXm1pWCU42kNdAAT/L2lsihK0+0dE/JUViUjrPf57svLpghdSf56oW1/aQdcBy7VKMsW+x0TATUtVXK26hKQ= Received: from AM0PR04MB5779.eurprd04.prod.outlook.com (20.178.202.151) by AM0PR04MB5907.eurprd04.prod.outlook.com (20.178.202.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.18; Wed, 27 Mar 2019 13:21:11 +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:11 +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 3/7] smp: Poke the cores before requesting IPI Thread-Topic: [RFC 3/7] smp: Poke the cores before requesting IPI Thread-Index: AQHU5J/ysdAjuuc4sEaUwQd13R6FyA== Date: Wed, 27 Mar 2019 13:21:11 +0000 Message-ID: <1553692845-20983-4-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] x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 3c192940-a1a6-4210-a47b-08d6b2b71494 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB5907; x-ms-traffictypediagnostic: AM0PR04MB5907: x-microsoft-antispam-prvs: x-forefront-prvs: 0989A7979C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(376002)(346002)(39860400002)(396003)(199004)(189003)(25786009)(2906002)(26005)(386003)(54906003)(8676002)(68736007)(102836004)(6512007)(71200400001)(7416002)(71190400001)(446003)(5660300002)(8936002)(50226002)(4326008)(81166006)(2616005)(476003)(81156014)(44832011)(97736004)(11346002)(6116002)(3846002)(36756003)(105586002)(86362001)(106356001)(2501003)(6486002)(76176011)(6636002)(14454004)(478600001)(6506007)(316002)(52116002)(7736002)(186003)(53936002)(110136005)(6346003)(66066001)(99286004)(14444005)(256004)(486006)(6436002)(305945005)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5907; 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) authentication-results: spf=none (sender IP is ) smtp.mailfrom=abel.vesa@nxp.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: LIXKcyLEH5DsJVfS9zvLh5/J5opTWB/PenemuARDTF+AmBO4Q4NCoYADb/NIyx+O8V/QgE5dRnXNNyf7EGffnfU+iviK/h9RiIikETHSl1fhftjZmLa0zXiL7Wr2Ll2Dum+hS8d9gHZuk/je5ELQ2qXO16GEquxZOFq7IMpZ3owDpSUNpD2HAHSqrFi76Kx8yTh9jmO5sLHHuVhUqc1GLgGkKOiraoA1raHF+IlymRs5/KKRXBHtRw5C0PqhpgDs3otPCiN46+pqmER7YKA4+yHdDmEg9B7veSU2deD2Z20ePlYR4zgC+o/JiED6mEjNkAVpCGfDAUbwRqDM4hMCupQthT7KN1v6yXC3JQm3uYXsKpOIx3hGYEedtDotw/0Bgf1yhSdPfC2TkI83vJDUrXp8m2uJEYf21PAgBOfxgxk= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3c192940-a1a6-4210-a47b-08d6b2b71494 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Mar 2019 13:21:11.6330 (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: AM0PR04MB5907 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190327_062120_567475_A58EF62C X-CRM114-Status: GOOD ( 18.42 ) 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 Try poking the specified core(s) every time before requesting IPI, this way allowing the cpuidle driver to do its magic for the current idle state of the specified core(s), if there is such a need. Signed-off-by: Abel Vesa --- kernel/irq_work.c | 19 ++++++++++++++++--- kernel/sched/core.c | 16 +++++++++++----- kernel/smp.c | 10 +++++++++- kernel/time/tick-broadcast.c | 4 ++++ 4 files changed, 40 insertions(+), 9 deletions(-) diff --git a/kernel/irq_work.c b/kernel/irq_work.c index 6b7cdf1..deca898 100644 --- a/kernel/irq_work.c +++ b/kernel/irq_work.c @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -76,8 +77,12 @@ bool irq_work_queue_on(struct irq_work *work, int cpu) if (!irq_work_claim(work)) return false; - if (llist_add(&work->llnode, &per_cpu(raised_list, cpu))) + if (llist_add(&work->llnode, &per_cpu(raised_list, cpu))) { + /* Poke the cpu through cpuidle first */ + cpuidle_poke(cpumask_of(cpu)); + arch_send_call_function_single_ipi(cpu); + } #else /* #ifdef CONFIG_SMP */ irq_work_queue(work); @@ -99,11 +104,19 @@ bool irq_work_queue(struct irq_work *work) /* If the work is "lazy", handle it from next tick if any */ if (work->flags & IRQ_WORK_LAZY) { if (llist_add(&work->llnode, this_cpu_ptr(&lazy_list)) && - tick_nohz_tick_stopped()) + tick_nohz_tick_stopped()) { + /* Poke the cpus through cpuidle first */ + cpuidle_poke(cpumask_of(smp_processor_id())); + arch_irq_work_raise(); + } } else { - if (llist_add(&work->llnode, this_cpu_ptr(&raised_list))) + if (llist_add(&work->llnode, this_cpu_ptr(&raised_list))) { + /* Poke the cpus through cpuidle first */ + cpuidle_poke(cpumask_of(smp_processor_id())); + arch_irq_work_raise(); + } } preempt_enable(); diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 4778c48..7be9dba 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -126,6 +126,12 @@ struct rq *task_rq_lock(struct task_struct *p, struct rq_flags *rf) } } +static void smp_poke_and_send_reschedule(int cpu) +{ + cpuidle_poke(cpumask_of(cpu)); + smp_send_reschedule(cpu); +} + /* * RQ-clock updating methods: */ @@ -511,7 +517,7 @@ void resched_curr(struct rq *rq) } if (set_nr_and_not_polling(curr)) - smp_send_reschedule(cpu); + smp_poke_and_send_reschedule(cpu); else trace_sched_wake_idle_without_ipi(cpu); } @@ -583,7 +589,7 @@ static void wake_up_idle_cpu(int cpu) return; if (set_nr_and_not_polling(rq->idle)) - smp_send_reschedule(cpu); + smp_poke_and_send_reschedule(cpu); else trace_sched_wake_idle_without_ipi(cpu); } @@ -1471,7 +1477,7 @@ void kick_process(struct task_struct *p) preempt_disable(); cpu = task_cpu(p); if ((cpu != smp_processor_id()) && task_curr(p)) - smp_send_reschedule(cpu); + smp_poke_and_send_reschedule(cpu); preempt_enable(); } EXPORT_SYMBOL_GPL(kick_process); @@ -1836,7 +1842,7 @@ static void ttwu_queue_remote(struct task_struct *p, int cpu, int wake_flags) if (llist_add(&p->wake_entry, &cpu_rq(cpu)->wake_list)) { if (!set_nr_if_polling(rq->idle)) - smp_send_reschedule(cpu); + smp_poke_and_send_reschedule(cpu); else trace_sched_wake_idle_without_ipi(cpu); } @@ -1857,7 +1863,7 @@ void wake_up_if_idle(int cpu) } else { rq_lock_irqsave(rq, &rf); if (is_idle_task(rq->curr)) - smp_send_reschedule(cpu); + smp_poke_and_send_reschedule(cpu); /* Else CPU is not idle, do nothing here: */ rq_unlock_irqrestore(rq, &rf); } diff --git a/kernel/smp.c b/kernel/smp.c index f4cf1b0..f6b2ce7 100644 --- a/kernel/smp.c +++ b/kernel/smp.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -175,8 +176,12 @@ static int generic_exec_single(int cpu, call_single_data_t *csd, * locking and barrier primitives. Generic code isn't really * equipped to do the right thing... */ - if (llist_add(&csd->llist, &per_cpu(call_single_queue, cpu))) + if (llist_add(&csd->llist, &per_cpu(call_single_queue, cpu))) { + /* Poke the cpus through cpuidle first */ + cpuidle_poke(cpumask_of(cpu)); + arch_send_call_function_single_ipi(cpu); + } return 0; } @@ -457,6 +462,9 @@ void smp_call_function_many(const struct cpumask *mask, __cpumask_set_cpu(cpu, cfd->cpumask_ipi); } + /* Poke the cpus through cpuidle first */ + cpuidle_poke(cfd->cpumask_ipi); + /* Send a message to all CPUs in the map */ arch_send_call_function_ipi_mask(cfd->cpumask_ipi); diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index 0283523..8bb7b2b 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "tick-internal.h" @@ -286,6 +287,9 @@ static bool tick_do_broadcast(struct cpumask *mask) } if (!cpumask_empty(mask)) { + /* Poke the cpus through cpuidle first */ + cpuidle_poke(mask); + /* * It might be necessary to actually check whether the devices * have different broadcast functions. For now, just use the From patchwork Wed Mar 27 13:21:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 10873481 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 12D21139A for ; Wed, 27 Mar 2019 13:22:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EE52128657 for ; Wed, 27 Mar 2019 13:22:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E1D6028BB9; Wed, 27 Mar 2019 13:22:50 +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 61E9E28657 for ; Wed, 27 Mar 2019 13:22:50 +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=477LM4e9xIT1bFTnNz9GXOlSm7kKXtxetxr0hQBE+/s=; b=QGO0XNl1o0metd TXUQo5eusPjcBDEOgQS21rrpyQCf0ydegZJSMwdAT9Fza6CaOnlVjWdoM8OBtK12YK9mOHASGcseK CeUj/OLf2wNjkQmsLNq2x8f8PnGtltCC7FBojcb/urtAdwEoOU0U6XPfcOCCf5eXoV0utu0lOagUc N0A0X+YFutaVyYDach0BIj6ue7VN356veNX5xj9YfRwrD56zMn+YsvVBdWC+yOcNwxf1gu1GEraSQ E674WdtSruxwUDQp/oH5mLu+cISdUMI1Kxlnh5EF2r0ieoSW4CQqSNidefzTZSnRi5p38ht3iYNSw wfQM6YEs6gDFqbTdUCdQ==; 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 1h98Vn-0004tx-9N; Wed, 27 Mar 2019 13:22:35 +0000 Received: from mail-db5eur01on0618.outbound.protection.outlook.com ([2a01:111:f400:fe02::618] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h98Uh-0003YO-LH 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=6F10FU/nMBELMll6buxzdkIXlVxK85wRW3zUgJupC9Y=; b=lQHbIAXLjwEsMbk898r0shYoxQxw/1LaXT08YGpOonMAk2yb0yjmuS/q/zRE5GtlmTkjfRiJzXvM9bq2j/kOuHBgUd0nog7NZbkFsIXY+Yx4x8tpjQtkE2lGa/0GQqJXAHmTzy0pbpM4Plqam0EmOILTQddnX1dM75kgtkUyKnA= Received: from AM0PR04MB5779.eurprd04.prod.outlook.com (20.178.202.151) by AM0PR04MB5907.eurprd04.prod.outlook.com (20.178.202.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.18; Wed, 27 Mar 2019 13:21:13 +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:13 +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 4/7] psci: Add cpu_poke ops to support core poking Thread-Topic: [RFC 4/7] psci: Add cpu_poke ops to support core poking Thread-Index: AQHU5J/zprrbGAWi1k63FnonWZEQSg== Date: Wed, 27 Mar 2019 13:21:13 +0000 Message-ID: <1553692845-20983-5-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] x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: dd29c57d-4a49-40a1-b67c-08d6b2b71594 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB5907; x-ms-traffictypediagnostic: AM0PR04MB5907: x-microsoft-antispam-prvs: x-forefront-prvs: 0989A7979C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(376002)(346002)(39860400002)(396003)(199004)(189003)(25786009)(2906002)(26005)(386003)(54906003)(8676002)(68736007)(102836004)(6512007)(71200400001)(7416002)(71190400001)(446003)(5660300002)(8936002)(50226002)(4326008)(81166006)(2616005)(476003)(81156014)(44832011)(97736004)(11346002)(6116002)(3846002)(36756003)(105586002)(86362001)(106356001)(2501003)(6486002)(76176011)(6636002)(14454004)(478600001)(6506007)(316002)(52116002)(7736002)(186003)(53936002)(110136005)(6346003)(66066001)(99286004)(14444005)(256004)(486006)(6436002)(305945005)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5907; 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) authentication-results: spf=none (sender IP is ) smtp.mailfrom=abel.vesa@nxp.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: gh5VASb52UD4ucQoargW+Pj/M13yvK8y5tsNhjebMg1lP3FXxSLA8rfN3zoOV7LXV4d36KwR0oOSI3g2G5BsZwkouZ/+mIN/m6FzTaFJrLEMvzL79r9lFRAzwiP9ytO2lMqf6SntFsgsbBK4CWJXGIktpoOrQVigR2xm/i2AlM7An1z/1HRU91zG6t9aEoRB6lpW7lb6JkD3EE35xYuqtNUDldyh1y0/ABa/x7qhwJSDiV77QUNgS3X1+0/SzGsZeCtacqFy90YDXBWvBLt3PsJiIpHdUSMrAerqvMPjy3ZoczCsnnAS00MLV858kMP15IwpEMtM4GPtZWIJAyvv5sHzv9dkC6etHDPSMpxOuniHFpmvkMjpAIgvqwnldGBVfflkbmv9JOwprS2iPghzjOxIV2ohG2VVv8KcBlgPk0k= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: dd29c57d-4a49-40a1-b67c-08d6b2b71594 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Mar 2019 13:21:13.2882 (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: AM0PR04MB5907 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190327_062127_994463_EBEF9CED X-CRM114-Status: GOOD ( 12.60 ) 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 There can be platforms that need a dedicated work to be done in TF-A before the specified core can be woken up through an IPI. Allow those platforms to call into the TF-A to do that work by making use of the cpu_poke operation. Signed-off-by: Abel Vesa --- arch/arm64/include/asm/cpu_ops.h | 1 + arch/arm64/kernel/psci.c | 1 + drivers/firmware/psci.c | 6 ++++++ include/linux/psci.h | 1 + include/uapi/linux/psci.h | 2 ++ 5 files changed, 11 insertions(+) diff --git a/arch/arm64/include/asm/cpu_ops.h b/arch/arm64/include/asm/cpu_ops.h index 8f03446..913afef 100644 --- a/arch/arm64/include/asm/cpu_ops.h +++ b/arch/arm64/include/asm/cpu_ops.h @@ -60,6 +60,7 @@ struct cpu_operations { #ifdef CONFIG_CPU_IDLE int (*cpu_init_idle)(unsigned int); int (*cpu_suspend)(unsigned long); + int (*cpu_poke)(unsigned int); #endif }; diff --git a/arch/arm64/kernel/psci.c b/arch/arm64/kernel/psci.c index 8cdaf25..53227eb 100644 --- a/arch/arm64/kernel/psci.c +++ b/arch/arm64/kernel/psci.c @@ -115,6 +115,7 @@ const struct cpu_operations cpu_psci_ops = { #ifdef CONFIG_CPU_IDLE .cpu_init_idle = psci_cpu_init_idle, .cpu_suspend = psci_cpu_suspend_enter, + .cpu_poke = psci_cpu_suspend_exit, #endif .cpu_init = cpu_psci_cpu_init, .cpu_prepare = cpu_psci_cpu_prepare, diff --git a/drivers/firmware/psci.c b/drivers/firmware/psci.c index c80ec1d..282bc47 100644 --- a/drivers/firmware/psci.c +++ b/drivers/firmware/psci.c @@ -73,6 +73,7 @@ enum psci_function { PSCI_FN_CPU_ON, PSCI_FN_CPU_OFF, PSCI_FN_MIGRATE, + PSCI_FN_CPU_POKE, PSCI_FN_MAX, }; @@ -424,6 +425,11 @@ int psci_cpu_suspend_enter(unsigned long index) return ret; } +int psci_cpu_suspend_exit(unsigned int index) +{ + return invoke_psci_fn(PSCI_0_2_FN_CPU_POKE, index, 0, 0); +} + /* ARM specific CPU idle operations */ #ifdef CONFIG_ARM static const struct cpuidle_ops psci_cpuidle_ops __initconst = { diff --git a/include/linux/psci.h b/include/linux/psci.h index 8b1b3b5..d863733 100644 --- a/include/linux/psci.h +++ b/include/linux/psci.h @@ -24,6 +24,7 @@ bool psci_tos_resident_on(int cpu); int psci_cpu_init_idle(unsigned int cpu); int psci_cpu_suspend_enter(unsigned long index); +int psci_cpu_suspend_exit(unsigned int index); enum psci_conduit { PSCI_CONDUIT_NONE, diff --git a/include/uapi/linux/psci.h b/include/uapi/linux/psci.h index b3bcabe..19e7481 100644 --- a/include/uapi/linux/psci.h +++ b/include/uapi/linux/psci.h @@ -40,8 +40,10 @@ #define PSCI_0_2_FN_MIGRATE_INFO_UP_CPU PSCI_0_2_FN(7) #define PSCI_0_2_FN_SYSTEM_OFF PSCI_0_2_FN(8) #define PSCI_0_2_FN_SYSTEM_RESET PSCI_0_2_FN(9) +#define PSCI_0_2_FN_CPU_POKE PSCI_0_2_FN(11) #define PSCI_0_2_FN64_CPU_SUSPEND PSCI_0_2_FN64(1) +#define PSCI_0_2_FN64_CPU_POKE PSCI_0_2_FN64(11) #define PSCI_0_2_FN64_CPU_ON PSCI_0_2_FN64(3) #define PSCI_0_2_FN64_AFFINITY_INFO PSCI_0_2_FN64(4) #define PSCI_0_2_FN64_MIGRATE PSCI_0_2_FN64(5) From patchwork Wed Mar 27 13:21:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 10873483 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 8D3D51708 for ; Wed, 27 Mar 2019 13:22:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71D5228657 for ; Wed, 27 Mar 2019 13:22:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 64E6228BB9; Wed, 27 Mar 2019 13:22:56 +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 E42FB28657 for ; Wed, 27 Mar 2019 13:22:55 +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=95R8oUk5CE24fy5NdGjuAXA8UvbbJXK6y7OzxAdvQyA=; b=KQd10mleWnpwCW Z2FNzR4Nq5Nl+sNmfDTBjDoBL+aJVdiNvyYj1fSbcEzog8iNIuSUoXfrWIbjHHncPM8JaBL/t0BSP GmxzGjNjQ9rojq6o+6XwCJNWBeqAyodHyEUn6upPb7eUIXrnq8yRpSUWA1DgEwpYs5vbIoMEcwFZr I74r+wd0ceKvIyqHKwM0jp7F7J5MBony+VfraXRLjXmQPKqAgUcnKPMWa+bpo3il26JNKocBrPcLS rn4q6gPUtuOS4rDFlfUsG79sqZ/qPnIJD8zSaDSuZTXtez7TrcQpA09tvNAez209Yz6ytIi8XsScI pTcCnxUnjmEso3dizn+A==; 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 1h98W4-0005Fr-54; Wed, 27 Mar 2019 13:22:52 +0000 Received: from mail-db5eur01on0618.outbound.protection.outlook.com ([2a01:111:f400:fe02::618] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h98Ul-0003YO-M9 for linux-arm-kernel@lists.infradead.org; Wed, 27 Mar 2019 13:21:37 +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=ro9O727XiFJ7pYrZbuEZxzdJtDA1YxkME8Y1TiR0iaw=; b=M3GiV2oj+EL1BHV0eEPpZnWCbbbmdv+Akvu7L+Ii/psActR/uNRH3MEnwR2g3mpeVO8YIxz29Qq9KoUKgOIR3CHhKNcLQYxvNLdLEDhV4gpUQ1bgNT6+rY6ox9sJBo30eCIgrx4DQn9g9zr3iNu9xa2Q+UPVmcSwKj8kScIQvDo= Received: from AM0PR04MB5779.eurprd04.prod.outlook.com (20.178.202.151) by AM0PR04MB5907.eurprd04.prod.outlook.com (20.178.202.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1730.18; Wed, 27 Mar 2019 13:21:15 +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:15 +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 5/7] cpuidle-arm: Add ops to support poke alonside enter Thread-Topic: [RFC 5/7] cpuidle-arm: Add ops to support poke alonside enter Thread-Index: AQHU5J/0oZvb5mpe4UOY+zfz3ulcdA== Date: Wed, 27 Mar 2019 13:21:14 +0000 Message-ID: <1553692845-20983-6-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] x-ms-exchange-messagesentrepresentingtype: 1 x-mailer: git-send-email 2.7.4 x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 31761e12-411b-4442-33d6-08d6b2b71690 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600127)(711020)(4605104)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:AM0PR04MB5907; x-ms-traffictypediagnostic: AM0PR04MB5907: x-microsoft-antispam-prvs: x-forefront-prvs: 0989A7979C x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(376002)(346002)(39860400002)(396003)(199004)(189003)(25786009)(2906002)(26005)(386003)(54906003)(8676002)(68736007)(102836004)(6512007)(71200400001)(7416002)(71190400001)(446003)(5660300002)(8936002)(50226002)(4326008)(81166006)(2616005)(476003)(81156014)(44832011)(97736004)(11346002)(6116002)(3846002)(36756003)(105586002)(86362001)(106356001)(2501003)(6486002)(76176011)(6636002)(14454004)(478600001)(6506007)(316002)(52116002)(7736002)(186003)(53936002)(110136005)(6346003)(66066001)(99286004)(14444005)(256004)(486006)(6436002)(305945005)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM0PR04MB5907; 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) authentication-results: spf=none (sender IP is ) smtp.mailfrom=abel.vesa@nxp.com; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: ms6hoU/zq6ahFQ6UiKW2lhRZHR966xH3XgXwf7jpcFj9HKf/1Q1TBxaipvjwvKM3j7ZRi+ifAf7KVB8olztyQW7L45ryhEO1jswLnfac5v3Ok4mbZk0WYX6wvgh+suAjXyPQKuZ+18EYwV/wZ/P4xVyNleN8DzMIxmgCqILiq2KoXV2LkICSTjc7QjNETAWteowAExlNgyI0WF61VDGOdSQzkfLyAYn0HBpP7gsJ+bm8U68vklFwg2jjFgIXrU93UoqQrz4R/0IWz4nSqiJh/Pl1VTGUR0sZHGOUZOGwOGyESnQvNCp6JTx+25jOcfPe1vNBYLkohfEFy4KObo/TplctKet1hHcwpGQy4cQGMDO3fy/ZKjQi5dxyGpPaU8qR2kfX380YUd6YqRt5rHC9KzmqbnndcA+nitZAErBAgdo= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 31761e12-411b-4442-33d6-08d6b2b71690 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Mar 2019 13:21:14.9744 (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: AM0PR04MB5907 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190327_062131_928228_999F768C X-CRM114-Status: GOOD ( 16.43 ) 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 In order to support poking alongside the enter operation, the cpuidle_dt_ops are added. On each state initialization, if the state has the property "local-wakeup-poke" set, then gets to have the poking mechanims enabled. For now, the arm_poke_idle_state doesn't do anything. Signed-off-by: Abel Vesa --- drivers/cpuidle/cpuidle-arm.c | 13 ++++++++++++- drivers/cpuidle/dt_idle_states.c | 15 ++++++++++----- drivers/cpuidle/dt_idle_states.h | 10 ++++++++++ 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/drivers/cpuidle/cpuidle-arm.c b/drivers/cpuidle/cpuidle-arm.c index 3a407a3..76ee7ac 100644 --- a/drivers/cpuidle/cpuidle-arm.c +++ b/drivers/cpuidle/cpuidle-arm.c @@ -45,6 +45,12 @@ static int arm_enter_idle_state(struct cpuidle_device *dev, return CPU_PM_CPU_IDLE_ENTER(arm_cpuidle_suspend, idx); } +static int arm_poke_idle_state(struct cpuidle_device *dev, + struct cpuidle_driver *drv, int cpu) +{ + return 0; +} + static struct cpuidle_driver arm_idle_driver __initdata = { .name = "arm_idle", .owner = THIS_MODULE, @@ -65,9 +71,14 @@ static struct cpuidle_driver arm_idle_driver __initdata = { } }; +static const struct cpuidle_dt_ops cpuidle_ops = { + .enter = arm_enter_idle_state, + .poke = arm_poke_idle_state +}; + static const struct of_device_id arm_idle_state_match[] __initconst = { { .compatible = "arm,idle-state", - .data = arm_enter_idle_state }, + .data = &cpuidle_ops }, { }, }; diff --git a/drivers/cpuidle/dt_idle_states.c b/drivers/cpuidle/dt_idle_states.c index add9569..6490ed4 100644 --- a/drivers/cpuidle/dt_idle_states.c +++ b/drivers/cpuidle/dt_idle_states.c @@ -27,19 +27,18 @@ static int init_state_node(struct cpuidle_state *idle_state, { int err; const char *desc; - + const struct cpuidle_dt_ops *ops = match_id->data; /* * CPUidle drivers are expected to initialize the const void *data - * pointer of the passed in struct of_device_id array to the idle - * state enter function. + * pointer of the passed in struct of_device_id array to the ops. */ - idle_state->enter = match_id->data; + idle_state->enter = ops->enter; /* * Since this is not a "coupled" state, it's safe to assume interrupts * won't be enabled when it exits allowing the tick to be frozen * safely. So enter() can be also enter_s2idle() callback. */ - idle_state->enter_s2idle = match_id->data; + idle_state->enter_s2idle = (void *)ops->enter; err = of_property_read_u32(state_node, "wakeup-latency-us", &idle_state->exit_latency); @@ -83,6 +82,12 @@ static int init_state_node(struct cpuidle_state *idle_state, idle_state->flags = 0; if (of_property_read_bool(state_node, "local-timer-stop")) idle_state->flags |= CPUIDLE_FLAG_TIMER_STOP; + + if (of_property_read_bool(state_node, "local-wakeup-poke")) { + WARN_ONCE(!ops->poke, "cpuidle driver: missing poke function\n"); + idle_state->poke = ops->poke; + } + /* * TODO: * replace with kstrdup and pointer assignment when name diff --git a/drivers/cpuidle/dt_idle_states.h b/drivers/cpuidle/dt_idle_states.h index 14ae88c..901a40e 100644 --- a/drivers/cpuidle/dt_idle_states.h +++ b/drivers/cpuidle/dt_idle_states.h @@ -2,6 +2,16 @@ #ifndef __DT_IDLE_STATES #define __DT_IDLE_STATES +struct cpuidle_dt_ops { + int (*enter) (struct cpuidle_device *dev, + struct cpuidle_driver *drv, + int index); + + int (*poke) (struct cpuidle_device *dev, + struct cpuidle_driver *drv, + int cpu); +}; + int dt_init_idle_driver(struct cpuidle_driver *drv, const struct of_device_id *matches, unsigned int start_idx); 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 = { From patchwork Wed Mar 27 13:21:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abel Vesa X-Patchwork-Id: 10873479 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 3A641139A for ; Wed, 27 Mar 2019 13:22:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20CD028AED for ; Wed, 27 Mar 2019 13:22:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 13D9528BBA; Wed, 27 Mar 2019 13:22:49 +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 0105F28AED for ; Wed, 27 Mar 2019 13:22:48 +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=RvPk+TBQNMIGG1rMISXKjZEO8vNa3DOMz9wEbufD4dc=; b=XPP+ryDTcNMmFN TDxPqJX35pyByAVJnXcM+Pls/W5h5ngyW1tj9P5Uqa7rq7h+xHUmFKKjepDGW5hCsqG4Ieniq/iIX 0jLK15K9jaZWphcchMyfPi21rBmHUaoqgX+wvuEOwQWIKRbTW8l0z4DJJhBR4vhy6sFx8CeeLdS8s Gmq+70qTvK5fol0wpxWmFosrIqqClb8oNz4KJ/WuK3pQc/GbFFRHnNO2yUW8lg3FbA97xfE/Fd6ML vRBVDkUXgOWbnEOyjpM0XXc0BlWcOWJ5o8V79WB1Nas9ONe1Hvjcro9bqSl7a36Zfwj79Xh3ws9PM sK4lPCWiJ9pcY1jQXDcQ==; 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 1h98Vr-0004yj-Vn; Wed, 27 Mar 2019 13:22:39 +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 1h98Ul-0003XW-1o for linux-arm-kernel@lists.infradead.org; Wed, 27 Mar 2019 13:21:34 +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=chzbau7PQniR3EdZFc5CRKQhYLFO8FHL1edsCSZByYQ=; b=bHBgFCWCuIE75sQYOIo8cpf8auZZVD8kQjRH1XXC/Vwa9tG9o6eLCQkjmi5u2YqWzWK/GfuV3KdXtkQrzYCTCcMv/At/YVy+/RxOl3Jr3LF+ewPrVey1v5D4tt/KMPvueqtFh4IhVfHCHoRTwq7qRZbpdqIbhElUwpe5qeo+h/8= 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:18 +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:18 +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 7/7] arm64: dts: imx8mq: Add cpu-sleep state with poke wake-up enabled Thread-Topic: [RFC 7/7] arm64: dts: imx8mq: Add cpu-sleep state with poke wake-up enabled Thread-Index: AQHU5J/2q/iaUo72jkeAq5bzHgxofw== Date: Wed, 27 Mar 2019 13:21:18 +0000 Message-ID: <1553692845-20983-8-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: 485101a1-9101-46ce-d4e1-08d6b2b718bf 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)(32563001)(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: ID2ZJyjZo9PTVXPQW4fabxhcOhw3pmNuS0nO58cxyR9zuhf0jCZ865NAHs4S13YzBvq+vvV71PF95FGrOpkYRXfSdyUFt8rjvHpNOM2QzpruQtObJqmlHV+h1ZYs/OU5WjBw2++96VHrqMZMyDvGGu6k4TD4xV8a/+ZP4OQ6eGbmsN6JoleckDS4PA/7+EOEeZLTHQs4gN8rUtUaF9/NtmXZ2eUXMjrbODP+agBt0KeV0ioXt6kMsF95KxJv4YXbXhMZzabcftlwmCutcm0Qe7rZN8bM5aOAOfLrp+hQ+yskvnwWvDtMZKbZw+2Sz0FHV2REQECKTekF3BWDBsoRYGzaWJmkzS14knUTFZ5WCAOQ+WLnuqb3ttBcVYPgjj4y5j5xsd1TE4cOrFK4MNF748uqSpB4sSrro0stGHICLeQ= MIME-Version: 1.0 X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 485101a1-9101-46ce-d4e1-08d6b2b718bf X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Mar 2019 13:21:18.6470 (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_062131_514397_3DD98101 X-CRM114-Status: GOOD ( 11.48 ) 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 Add the idle state cpu-sleep to each core. This idle state makes use of 'local-wakeup-poke' property which basically tells the cpuidle-arm driver to enable the poking for this state. Signed-off-by: Abel Vesa --- arch/arm64/boot/dts/freescale/imx8mq.dtsi | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mq.dtsi b/arch/arm64/boot/dts/freescale/imx8mq.dtsi index 230f198..8b7303d 100644 --- a/arch/arm64/boot/dts/freescale/imx8mq.dtsi +++ b/arch/arm64/boot/dts/freescale/imx8mq.dtsi @@ -84,6 +84,22 @@ #address-cells = <1>; #size-cells = <0>; + idle-states { + entry-method = "psci"; + + CPU_SLEEP: cpu-sleep { + compatible = "arm,idle-state"; + arm,psci-suspend-param = <0x0010033>; + local-timer-stop; + local-wakeup-poke; + entry-latency-us = <1000>; + exit-latency-us = <700>; + min-residency-us = <2700>; + wakeup-latency-us = <1500>; + }; + }; + + A53_0: cpu@0 { device_type = "cpu"; compatible = "arm,cortex-a53"; @@ -94,6 +110,7 @@ next-level-cache = <&A53_L2>; operating-points-v2 = <&a53_opp_table>; #cooling-cells = <2>; + cpu-idle-states = <&CPU_SLEEP>; }; A53_1: cpu@1 { @@ -106,6 +123,7 @@ next-level-cache = <&A53_L2>; operating-points-v2 = <&a53_opp_table>; #cooling-cells = <2>; + cpu-idle-states = <&CPU_SLEEP>; }; A53_2: cpu@2 { @@ -118,6 +136,7 @@ next-level-cache = <&A53_L2>; operating-points-v2 = <&a53_opp_table>; #cooling-cells = <2>; + cpu-idle-states = <&CPU_SLEEP>; }; A53_3: cpu@3 { @@ -130,6 +149,7 @@ next-level-cache = <&A53_L2>; operating-points-v2 = <&a53_opp_table>; #cooling-cells = <2>; + cpu-idle-states = <&CPU_SLEEP>; }; A53_L2: l2-cache0 {