[tip:,sched/core] cpuidle/poll: Ensure IRQs stay disabled after cpuidle_state::enter() calls
Message ID | 167361307636.4906.6193432024817736611.tip-bot2@tip-bot2 |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp245391wrt; Fri, 13 Jan 2023 04:40:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXuRyKaDE30dxJRfa8mxoTp0CHwLu/OUhPYCGfJAotWVNPNZkBomjz8SCkN97YS5z98kA1mK X-Received: by 2002:a17:907:a64b:b0:7c1:13b7:a5a1 with SMTP id vu11-20020a170907a64b00b007c113b7a5a1mr73667877ejc.46.1673613636645; Fri, 13 Jan 2023 04:40:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673613636; cv=none; d=google.com; s=arc-20160816; b=dTSejZ0fWpkRP73vc0VTZktO3sZpxCu+bSpKrsOaUDDc6Wjs61jIfI+4MOcx69nr2E 9kuKyadqVb53kzWy3Xfh/Nqmn6bpatvP9P+cslXwCvGxTcRusTcrSl26Z8FQQ+nGDiQm OhrQAEAS1Btb/IUk1fuOP+sPMs4WiSFwvvV7sCmfWktGSjAwgnsqlIbsP+Mt+oTNeNNk qMJHrmZrr/E1UcLV1OSnowtEaUbQJbK+YSc5WgQ41syJhLVtqjYxdAUaHqwJlp5q+7K0 6cE0glKx1C3Bt80xPI+DlVxEU5SOzQ1Gx6YYpsbeLOYs6nIEmO7gsvfLbJplTkb2IfUn 3WNQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=yehUuinpLJOMZYV+HC9TlNSX12bgIR7nh2+agnRE4WI=; b=G3r5onOJDriyyWzYqICzqGldFQou6dwvLzl9q2/yKdk7J/O/y4S4SFr3m1OoXdfgfJ rcd/U054/v+y2y5qV0jG8cZ6Vm6ljQe0o5H8tz0UCbMhqBD5d/SjSw8Xjk7pz6tQA3er zKREgKoLtqRATIfLFY3gSW4ZZIxrjhk+BD5waFJ7MGsRrqnUcfWGvosio+zVtSdjYHjA 4Ri/PUaM4EL4ia7PCEf3hGnuU+uCChtNa4AkgWJPlLTs2fJpX57PrijEj6Gu7J7Cas8M 65QM5E+STnqcBEU0avXd4/DfBNiX+S6HkoII7dqsRWMH6Ut2GUHV2yhN4Nb2D6fIuT3v REpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=rHguz8Cs; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=79GBXARE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id xe6-20020a170907318600b0084cbde35b2fsi21803130ejb.465.2023.01.13.04.40.12; Fri, 13 Jan 2023 04:40:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=rHguz8Cs; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=79GBXARE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241735AbjAMMiF (ORCPT <rfc822;callmefire3@gmail.com> + 99 others); Fri, 13 Jan 2023 07:38:05 -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 <rfc822;linux-kernel@vger.kernel.org>); 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" <tip-bot2@linutronix.de> 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)" <peterz@infradead.org>, Ingo Molnar <mingo@kernel.org>, Tony Lindgren <tony@atomide.com>, Ulf Hansson <ulf.hansson@linaro.org>, "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>, Frederic Weisbecker <frederic@kernel.org>, 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: <tip-bot2@linutronix.de> Robot-Unsubscribe: Contact <mailto:tglx@linutronix.de> to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754911092648745630?= X-GMAIL-MSGID: =?utf-8?q?1754911092648745630?= |
Series |
[tip:,sched/core] cpuidle/poll: Ensure IRQs stay disabled after cpuidle_state::enter() calls
|
|
Commit Message
tip-bot2 for Thomas Gleixner
Jan. 13, 2023, 12:31 p.m. UTC
The following commit has been merged into the sched/core branch of tip: Commit-ID: 5e26aa93391195a64871db5d96d7163f0062ca4f Gitweb: https://git.kernel.org/tip/5e26aa93391195a64871db5d96d7163f0062ca4f Author: Peter Zijlstra <peterz@infradead.org> AuthorDate: Thu, 12 Jan 2023 20:43:17 +01:00 Committer: Ingo Molnar <mingo@kernel.org> 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) <peterz@infradead.org> Signed-off-by: Ingo Molnar <mingo@kernel.org> Tested-by: Tony Lindgren <tony@atomide.com> Tested-by: Ulf Hansson <ulf.hansson@linaro.org> Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Frederic Weisbecker <frederic@kernel.org> 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, dev->poll_time_limit = false; - local_irq_enable(); + raw_local_irq_enable(); if (!current_set_polling_and_test()) { unsigned int loop_count = 0; u64 limit; @@ -36,6 +36,8 @@ static int __cpuidle poll_idle(struct cpuidle_device *dev, } } } + raw_local_irq_disable(); + current_clr_polling(); return index;