From patchwork Fri Sep 1 04:29:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicholas Piggin X-Patchwork-Id: 9933417 X-Patchwork-Delegate: rjw@sisk.pl Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B4FB36016C for ; Fri, 1 Sep 2017 04:30:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 957952841D for ; Fri, 1 Sep 2017 04:30:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A59D28448; Fri, 1 Sep 2017 04:30:11 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 104F22841D for ; Fri, 1 Sep 2017 04:30:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750759AbdIAEaJ (ORCPT ); Fri, 1 Sep 2017 00:30:09 -0400 Received: from mail-pg0-f66.google.com ([74.125.83.66]:33018 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750707AbdIAEaI (ORCPT ); Fri, 1 Sep 2017 00:30:08 -0400 Received: by mail-pg0-f66.google.com with SMTP id m15so1025185pgc.0; Thu, 31 Aug 2017 21:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=wmhR4gwjIkzp3u+0uSZI7EH4m9UuH8FJyK1xABoPdU8=; b=ly6rFbCInjG2BNbIv+IgloJ5SoLLkKit5nvNmW286ccMYGjG0yt9wZZ3DFMV07154v I+r9F8CjKpgd6kvM/yU6g+UNjXqVELKM0H7hGBAz3JPKaVhPKfgrK9ojph7W4K1pOX64 tjFtVqJwqjk99THXiyGJbHasekPhPpC2O0+O5XLkCOBUz6srP/RCeRWEdWES/C621tE9 NUbJOf4DiX2bB3sl1CMEYVMaUbYzE6ZjtEPghhqoZozugc8NxzEtEqNGJDhiTgVE6YDM cXHfsGKDkSnpJNQsrF6eArDrV4+vThN/vy26cwh1mb4IIdNzKHhJH7b1nIQsHkniImGs rs1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=wmhR4gwjIkzp3u+0uSZI7EH4m9UuH8FJyK1xABoPdU8=; b=TQ2JQxxnPYghcRojiagszQTL9PgXKsjuyYIf8xOz5cQK24cNLuiFVBCs04SD/Dqlse WT3+nhBjJUGhTXF+R9+UZtaYSD6fj9+JqPafXkmZIi4F9hJyTPlVtVK9mybevEyrBXIV fO9zHZ4IrG2r1kForZm1h2PdgYhH/He7ZEDL0Ny0Kmf4lFDuCGvThKSWCyrBLA3WZuAF OtG+t+KgORsUKXBIUqGjAgqaQ118r62qf9L6DfHcB/ju8oRB34g05WrOpseCvqOvPYEh AA2CmYTrwrI0OMyGuQjM0RsACMUjZUjDbjTxRqyXLNIGb4enHvGXUOmpy1JyKeXXpZpT NGZA== X-Gm-Message-State: AHPjjUib3jVAoP6SU3PdD4aUe8MAMAY+1Jqjxqen5oMVa3ihFPvomzhL 4mZScxWRlOKNWQ== X-Google-Smtp-Source: ADKCNb475WcgY/9cixAkeZRzy76MdBQW85DX+WV8LXokngHFcrqCVr5j9MeqieaoBSipd+bci6v2RA== X-Received: by 10.99.60.80 with SMTP id i16mr935535pgn.98.1504240207876; Thu, 31 Aug 2017 21:30:07 -0700 (PDT) Received: from roar.au.ibm.com (203-219-56-202.tpgi.com.au. [203.219.56.202]) by smtp.gmail.com with ESMTPSA id g85sm1520178pfe.77.2017.08.31.21.30.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 31 Aug 2017 21:30:06 -0700 (PDT) From: Nicholas Piggin To: "Rafael J. Wysocki" , Daniel Lezcano Cc: Nicholas Piggin , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Thomas Gleixner Subject: [PATCH] cpuidle: fix broadcast control when broadcast can not be entered Date: Fri, 1 Sep 2017 14:29:56 +1000 Message-Id: <20170901042956.29594-1-npiggin@gmail.com> X-Mailer: git-send-email 2.13.3 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When failing to enter broadcast timer mode for an idle state that requires it, a new state is selected that does not require broadcast, but the broadcast variable remains set. This causes tick_broadcast_exit to be called despite not having entered broadcast mode. This causes the WARN_ON_ONCE(!irqs_disabled()) to trigger in some cases. It does not appear to cause problems for code today, but seems to violate the interface so should be fixed. Signed-off-by: Nicholas Piggin Reviewed-by: Thomas Gleixner --- drivers/cpuidle/cpuidle.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/cpuidle/cpuidle.c b/drivers/cpuidle/cpuidle.c index 60bb64f4329d..4453e27f855e 100644 --- a/drivers/cpuidle/cpuidle.c +++ b/drivers/cpuidle/cpuidle.c @@ -208,6 +208,7 @@ int cpuidle_enter_state(struct cpuidle_device *dev, struct cpuidle_driver *drv, return -EBUSY; } target_state = &drv->states[index]; + broadcast = false; } /* Take note of the planned idle state. */