From nobody Sun Apr 5 20:05:15 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D928EC54EBE for ; Fri, 13 Jan 2023 12:37:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241386AbjAMMhN (ORCPT ); Fri, 13 Jan 2023 07:37:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240802AbjAMMcU (ORCPT ); Fri, 13 Jan 2023 07:32:20 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D126A574C5; Fri, 13 Jan 2023 04:31:16 -0800 (PST) Date: Fri, 13 Jan 2023 12:31:15 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673613075; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/oyZgvO33ZtyKUfO22o+/oe9NkApuzXcK0D+XIHMSFg=; b=EYsMOvwnSZrkdiBLaho7e+R0+u2451f0UwPaQOjG2XcXZmq99Wt2XDeYPcGJ9+gEgNGqjp snnav7Rkjp7czRlnFjInWLvCEOyM2gIj5LtXbzLXTrkfhZ64ADW35avLPrstLXDb3gDPxX K3N8Z5HVHeB/rXQ1k4o7UWiLilr/LV1fN3fShkHvTkf7NFTC9ZouHIEIwp2Gab4ayvitSa m1VD98Cnp2pO8DAdwpV8XBaB5Xi18q2Lv8BZSZjL32hv6camNDd7cGc55QrM1ElrC5hwDb K+tn6Bf9jNFuYo+eH7f0wG6e4+h13eJZpHHXoXhbYTqq5CDH74VoCreM5NoBQA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673613075; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/oyZgvO33ZtyKUfO22o+/oe9NkApuzXcK0D+XIHMSFg=; b=Y2jE269CGToUVClMFXekdPdvzQrpzJF8TjlMYMb6Nt6D2VmizuhoeGSKLsmAnrevrFTUq3 CjSuHgBSP5LmnHAg== From: "tip-bot2 for Peter Zijlstra" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: sched/core] cpuidle, riscv: Push RCU-idle into driver Cc: "Peter Zijlstra (Intel)" , Ingo Molnar , Tony Lindgren , Ulf Hansson , Anup Patel , Frederic Weisbecker , "Rafael J. Wysocki" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230112195539.637185846@infradead.org> References: <20230112195539.637185846@infradead.org> MIME-Version: 1.0 Message-ID: <167361307515.4906.5088931102976542675.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the sched/core branch of tip: Commit-ID: 8e9ab9e8da1eae61fdff35690d998eaf8cd527dc Gitweb: https://git.kernel.org/tip/8e9ab9e8da1eae61fdff35690d998eaf8= cd527dc Author: Peter Zijlstra AuthorDate: Thu, 12 Jan 2023 20:43:19 +01:00 Committer: Ingo Molnar CommitterDate: Fri, 13 Jan 2023 11:03:22 +01:00 cpuidle, riscv: Push RCU-idle into driver Doing RCU-idle outside the driver, only to then temporarily enable it again, at least twice, before going idle is suboptimal. That is, once implicitly through the cpu_pm_*() calls and once explicitly doing ct_irq_*_irqon(). Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Tested-by: Tony Lindgren Tested-by: Ulf Hansson Reviewed-by: Anup Patel Reviewed-by: Frederic Weisbecker Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20230112195539.637185846@infradead.org --- drivers/cpuidle/cpuidle-riscv-sbi.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/cpuidle/cpuidle-riscv-sbi.c b/drivers/cpuidle/cpuidle-= riscv-sbi.c index 05fe290..cbdbb11 100644 --- a/drivers/cpuidle/cpuidle-riscv-sbi.c +++ b/drivers/cpuidle/cpuidle-riscv-sbi.c @@ -121,12 +121,12 @@ static int __sbi_enter_domain_idle_state(struct cpuid= le_device *dev, return -1; =20 /* Do runtime PM to manage a hierarchical CPU toplogy. */ - ct_irq_enter_irqson(); if (s2idle) dev_pm_genpd_suspend(pd_dev); else pm_runtime_put_sync_suspend(pd_dev); - ct_irq_exit_irqson(); + + ct_idle_enter(); =20 if (sbi_is_domain_state_available()) state =3D sbi_get_domain_state(); @@ -135,12 +135,12 @@ static int __sbi_enter_domain_idle_state(struct cpuid= le_device *dev, =20 ret =3D sbi_suspend(state) ? -1 : idx; =20 - ct_irq_enter_irqson(); + ct_idle_exit(); + if (s2idle) dev_pm_genpd_resume(pd_dev); else pm_runtime_get_sync(pd_dev); - ct_irq_exit_irqson(); =20 cpu_pm_exit(); =20 @@ -251,6 +251,7 @@ static int sbi_dt_cpu_init_topology(struct cpuidle_driv= er *drv, * of a shared state for the domain, assumes the domain states are all * deeper states. */ + drv->states[state_count - 1].flags |=3D CPUIDLE_FLAG_RCU_IDLE; drv->states[state_count - 1].enter =3D sbi_enter_domain_idle_state; drv->states[state_count - 1].enter_s2idle =3D sbi_enter_s2idle_domain_idle_state;