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 99678C54EBE for ; Fri, 13 Jan 2023 12:38:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241601AbjAMMiH (ORCPT ); Fri, 13 Jan 2023 07:38:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33736 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241159AbjAMMcV (ORCPT ); Fri, 13 Jan 2023 07:32:21 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BBCD2DE3; Fri, 13 Jan 2023 04:31:18 -0800 (PST) Date: Fri, 13 Jan 2023 12:31:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1673613076; 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=yehUuinpLJOMZYV+HC9TlNSX12bgIR7nh2+agnRE4WI=; b=rHguz8Csmn3EmR+bW30kTEUYY+emIDK5WpsWbJjyzDRD9SxXrbkEvhSRm2p1BeyLej2zcf Ob2UBjYH4oY6ZyN+3E/uRI4LW2sKZ7QclYxiXVgdpM8/vKap89XpOd6AzpgXZQ58sCZRJA JuNWyx4QfgcUzkTzMtzH69+0saJoO76YrLca1DymS+Hc+XOm6vrE1/wa5D/X7HENAFo3lR 0I0X7Ll/XjbKB91b9B3RHDQUekEAZrUXFieqtCWiLS7GkFI656FQKuTz6ON9Yx8PgYYt9c oXsh7xALvEgZJxuEcCTpxCg7N0ONlf1wzoELOY//ATIbjQ+eytuYglimEyREOQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1673613076; 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=yehUuinpLJOMZYV+HC9TlNSX12bgIR7nh2+agnRE4WI=; b=79GBXARECBMjPO74pLAZYQIZr20b4tGwiMXUKi6hH/Obnl/iSfVelfjgsxi2lsPTmm4wS/ cKP+faMhhsvTpBAg== 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/poll: Ensure IRQs stay disabled after cpuidle_state::enter() calls Cc: "Peter Zijlstra (Intel)" , Ingo Molnar , Tony Lindgren , Ulf Hansson , "Rafael J. Wysocki" , Frederic Weisbecker , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20230112195539.515253662@infradead.org> References: <20230112195539.515253662@infradead.org> MIME-Version: 1.0 Message-ID: <167361307636.4906.6193432024817736611.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: 5e26aa93391195a64871db5d96d7163f0062ca4f Gitweb: https://git.kernel.org/tip/5e26aa93391195a64871db5d96d7163f0= 062ca4f Author: Peter Zijlstra AuthorDate: Thu, 12 Jan 2023 20:43:17 +01:00 Committer: Ingo Molnar CommitterDate: Fri, 13 Jan 2023 11:03:21 +01:00 cpuidle/poll: Ensure IRQs stay disabled after cpuidle_state::enter() calls Make cpuidle_state::enter() methods IRQ state invariant on exit. Additionally make sure to use raw_local_irq_*() methods since this cpuidle callback will be called with RCU already disabled. Signed-off-by: Peter Zijlstra (Intel) Signed-off-by: Ingo Molnar Tested-by: Tony Lindgren Tested-by: Ulf Hansson Reviewed-by: Rafael J. Wysocki Reviewed-by: Frederic Weisbecker Link: https://lore.kernel.org/r/20230112195539.515253662@infradead.org --- drivers/cpuidle/poll_state.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/cpuidle/poll_state.c b/drivers/cpuidle/poll_state.c index f7e8361..1f578ed 100644 --- a/drivers/cpuidle/poll_state.c +++ b/drivers/cpuidle/poll_state.c @@ -17,7 +17,7 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev, =20 dev->poll_time_limit =3D false; =20 - local_irq_enable(); + raw_local_irq_enable(); if (!current_set_polling_and_test()) { unsigned int loop_count =3D 0; u64 limit; @@ -36,6 +36,8 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev, } } } + raw_local_irq_disable(); + current_clr_polling(); =20 return index;