Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1157472imm; Wed, 1 Aug 2018 11:07:54 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfv9M6iBNSxgV5HSgoNI6htDqX4CMYuYrr6wBwuP2JBdbCHQfN0kNJBVCZGcT40SmYTXFt0 X-Received: by 2002:a63:1811:: with SMTP id y17-v6mr25550229pgl.356.1533146874652; Wed, 01 Aug 2018 11:07:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533146874; cv=none; d=google.com; s=arc-20160816; b=cgVxIL1qj3S6+TIClSkHUMKyQdBVQsTuUjXQHrsnBT9wztOj906NSGfEVHqqfCpcKV tQYVYAzbMOgGKyTx+MrZ86Ow1sVs4csuMoZ9Qre5yNf1VjncOrlog7JKQFEi/MXV7FVD GQmBZQjY7vfxW14GToLjaNIP7PCKtR0L5Sck+SUIzwLDe3j7liNscs/wCMu+KDF77VEI 2dA9utj4ntD3jBIrTyiBdRg8pAL0pmn3dm0C+MAUAb6uUS9oKGG0Pqq6tu/b9p76lHvk BojOouWrQ9Eex35oNQdzoawCVsmtwdarAcKgGGWH+X1u6H9ww0RQS73jAg/z1VMLO7WA vOOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=jfP+Gl7Lh1F1xAye2/h2c/esY72FgnCTisIZT1L35kY=; b=dPC04Ez45RYVnGgNTBuS/UcQDp71AmEPOJ7mVgw8Kzsbm1zKdK6J26nCZnxmnENgiD /NRbcC4spRetfSOFrMeiF1C+icFL9jSOF9whC94UzECRb2PrT74/8BakgAgaHWQc1ebs bPH8OBlj4YoKO7QkS9FiafBvW7hUYuxBsU+FheNIvUvOISiO/oUZkvpmuO1xRX+CX/Af /IYQl7i/oJBf2j5FquV+caWSMj6j6wr4UTl5aovn0/TpVVsypvqqQEyM1KbR8vGPUNKE 5m5sBFXvoUXJq20agdJWKaG+fn+d3txQjz6/UXu87ZiZV/4KRUjqI8rPekfCh3BDYGgq 30Bg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b13-v6si15445427plz.467.2018.08.01.11.07.40; Wed, 01 Aug 2018 11:07:54 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732828AbeHATxo (ORCPT + 99 others); Wed, 1 Aug 2018 15:53:44 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:50082 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405784AbeHATIh (ORCPT ); Wed, 1 Aug 2018 15:08:37 -0400 Received: from localhost (D57E6652.static.ziggozakelijk.nl [213.126.102.82]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id E1B5413D5; Wed, 1 Aug 2018 17:16:10 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sebastian Andrzej Siewior , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.14 087/246] PM / wakeup: Make s2idle_lock a RAW_SPINLOCK Date: Wed, 1 Aug 2018 18:49:57 +0200 Message-Id: <20180801165015.883225015@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180801165011.700991984@linuxfoundation.org> References: <20180801165011.700991984@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sebastian Andrzej Siewior [ Upstream commit 62fc00a6611a0014c85763f9def1fc07c15d1302 ] The `s2idle_lock' is acquired during suspend while interrupts are disabled even on RT. The lock is acquired for short sections only. Make it a RAW lock which avoids "sleeping while atomic" warnings on RT. Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- kernel/power/suspend.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) --- a/kernel/power/suspend.c +++ b/kernel/power/suspend.c @@ -60,7 +60,7 @@ static const struct platform_s2idle_ops static DECLARE_WAIT_QUEUE_HEAD(s2idle_wait_head); enum s2idle_states __read_mostly s2idle_state; -static DEFINE_SPINLOCK(s2idle_lock); +static DEFINE_RAW_SPINLOCK(s2idle_lock); void s2idle_set_ops(const struct platform_s2idle_ops *ops) { @@ -78,12 +78,12 @@ static void s2idle_enter(void) { trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, true); - spin_lock_irq(&s2idle_lock); + raw_spin_lock_irq(&s2idle_lock); if (pm_wakeup_pending()) goto out; s2idle_state = S2IDLE_STATE_ENTER; - spin_unlock_irq(&s2idle_lock); + raw_spin_unlock_irq(&s2idle_lock); get_online_cpus(); cpuidle_resume(); @@ -97,11 +97,11 @@ static void s2idle_enter(void) cpuidle_pause(); put_online_cpus(); - spin_lock_irq(&s2idle_lock); + raw_spin_lock_irq(&s2idle_lock); out: s2idle_state = S2IDLE_STATE_NONE; - spin_unlock_irq(&s2idle_lock); + raw_spin_unlock_irq(&s2idle_lock); trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, false); } @@ -156,12 +156,12 @@ void s2idle_wake(void) { unsigned long flags; - spin_lock_irqsave(&s2idle_lock, flags); + raw_spin_lock_irqsave(&s2idle_lock, flags); if (s2idle_state > S2IDLE_STATE_NONE) { s2idle_state = S2IDLE_STATE_WAKE; wake_up(&s2idle_wait_head); } - spin_unlock_irqrestore(&s2idle_lock, flags); + raw_spin_unlock_irqrestore(&s2idle_lock, flags); } EXPORT_SYMBOL_GPL(s2idle_wake);