From nobody Sun Apr 5 20:05:09 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 8A7F0C54EBE for ; Fri, 13 Jan 2023 12:37:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241547AbjAMMhA (ORCPT ); Fri, 13 Jan 2023 07:37:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234305AbjAMMcU (ORCPT ); Fri, 13 Jan 2023 07:32:20 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A59BB568B4; Fri, 13 Jan 2023 04:31:16 -0800 (PST) Date: Fri, 13 Jan 2023 12:31:14 -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=+Em/upRwf6NflqJlzTFO6BPlqz+xZRZUvqFMgMDGUHM=; b=MW1kIx9CCA/fhCq5GHyTGytCWTRaYnoc+ZRDhNLnrq2Ok3fsF6l2tzUt6ufJI3uFCAJY1s DRgr4GPZEhnYyEyy0ytIMg/zvZdMBWu1jgqfiHE/KGlfeOj4G1IErSKvoUey91xj4ZN6U7 VUkbKN1o72+Vh7BY9IY8TYF2tXscKMjg7/ptNt76qyHbulJhca6yrgFN3c+IIGgmsdr3y6 33hNKKSWWnCty7/h4oglFg+EBiuw7X5geufoMZn08+kKymUuY99xbH3nMPNpr/BmpUu2gU oZly01NYfauGT+Q1tz1D1fQNph5Ht+Nxyf5MU+9Yc7dQPS2Xbz+HjcYpOksQRQ== 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=+Em/upRwf6NflqJlzTFO6BPlqz+xZRZUvqFMgMDGUHM=; b=vTOf1bGOXMFrl8pGWApIwPp0WpN+g8hFXmbGV24rZvkzVkioJmJ38boFC9CF1vT1mAqWX9 OWdyZXhRouj+VjCg== 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, tegra: Push RCU-idle into driver Cc: "Peter Zijlstra (Intel)" , Ingo Molnar , Tony Lindgren , Ulf Hansson , Frederic Weisbecker , "Rafael J. Wysocki" , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230112195539.699546331@infradead.org> References: <20230112195539.699546331@infradead.org> MIME-Version: 1.0 Message-ID: <167361307498.4906.17470136901910908116.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: 5fca0d9f5d76664786ca6c09076341def165a677 Gitweb: https://git.kernel.org/tip/5fca0d9f5d76664786ca6c09076341def= 165a677 Author: Peter Zijlstra AuthorDate: Thu, 12 Jan 2023 20:43:20 +01:00 Committer: Ingo Molnar CommitterDate: Fri, 13 Jan 2023 11:03:22 +01:00 cpuidle, tegra: 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. Notably once implicitly through the cpu_pm_*() calls and once explicitly doing RCU_NONIDLE(). Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Tested-by: Tony Lindgren Tested-by: Ulf Hansson Reviewed-by: Frederic Weisbecker Acked-by: Rafael J. Wysocki Link: https://lore.kernel.org/r/20230112195539.699546331@infradead.org --- drivers/cpuidle/cpuidle-tegra.c | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) diff --git a/drivers/cpuidle/cpuidle-tegra.c b/drivers/cpuidle/cpuidle-tegr= a.c index 9845629..3ca5cfb 100644 --- a/drivers/cpuidle/cpuidle-tegra.c +++ b/drivers/cpuidle/cpuidle-tegra.c @@ -180,9 +180,11 @@ static int tegra_cpuidle_state_enter(struct cpuidle_de= vice *dev, } =20 local_fiq_disable(); - RCU_NONIDLE(tegra_pm_set_cpu_in_lp2()); + tegra_pm_set_cpu_in_lp2(); cpu_pm_enter(); =20 + ct_idle_enter(); + switch (index) { case TEGRA_C7: err =3D tegra_cpuidle_c7_enter(); @@ -197,8 +199,10 @@ static int tegra_cpuidle_state_enter(struct cpuidle_de= vice *dev, break; } =20 + ct_idle_exit(); + cpu_pm_exit(); - RCU_NONIDLE(tegra_pm_clear_cpu_in_lp2()); + tegra_pm_clear_cpu_in_lp2(); local_fiq_enable(); =20 return err ?: index; @@ -226,6 +230,7 @@ static int tegra_cpuidle_enter(struct cpuidle_device *d= ev, struct cpuidle_driver *drv, int index) { + bool do_rcu =3D drv->states[index].flags & CPUIDLE_FLAG_RCU_IDLE; unsigned int cpu =3D cpu_logical_map(dev->cpu); int ret; =20 @@ -233,9 +238,13 @@ static int tegra_cpuidle_enter(struct cpuidle_device *= dev, if (dev->states_usage[index].disable) return -1; =20 - if (index =3D=3D TEGRA_C1) + if (index =3D=3D TEGRA_C1) { + if (do_rcu) + ct_idle_enter(); ret =3D arm_cpuidle_simple_enter(dev, drv, index); - else + if (do_rcu) + ct_idle_exit(); + } else ret =3D tegra_cpuidle_state_enter(dev, index, cpu); =20 if (ret < 0) { @@ -285,7 +294,8 @@ static struct cpuidle_driver tegra_idle_driver =3D { .exit_latency =3D 2000, .target_residency =3D 2200, .power_usage =3D 100, - .flags =3D CPUIDLE_FLAG_TIMER_STOP, + .flags =3D CPUIDLE_FLAG_TIMER_STOP | + CPUIDLE_FLAG_RCU_IDLE, .name =3D "C7", .desc =3D "CPU core powered off", }, @@ -295,6 +305,7 @@ static struct cpuidle_driver tegra_idle_driver =3D { .target_residency =3D 10000, .power_usage =3D 0, .flags =3D CPUIDLE_FLAG_TIMER_STOP | + CPUIDLE_FLAG_RCU_IDLE | CPUIDLE_FLAG_COUPLED, .name =3D "CC6", .desc =3D "CPU cluster powered off",