Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3400356ybp; Sun, 6 Oct 2019 11:05:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1hpbjr7MMeZOJGvkxyBIcA1IM1Srf8eOj5VvKHRcq2k38HUU7adliNf4faocjFwV8T353 X-Received: by 2002:a17:906:c742:: with SMTP id fk2mr21063114ejb.44.1570385141993; Sun, 06 Oct 2019 11:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570385141; cv=none; d=google.com; s=arc-20160816; b=oBqKvytiOWHWQ/HBrnVHcFbhgz3VtRqiRUdZofvS+An3prnxcW1oRwXFn+FssRuXdD 1hvxXIO/i32e6vx5CcdMWnSXJw7ZFHPB0sOV+Ior7+Fu5yZSpvcpeYOaGhT3X2Oa8iwX BLTKkHwIJjs7jNtYJt9CKF25JBW6lHe0DKT83emC3m9X7GtEH/BCORhCM3EJQndWzsa6 ITH11Iuir2Jd7Y4v+Se0kGjSGx+UeC0PFpO019Ss6hsPD+f7R1RbvbFpKekkNUwX1GX8 tflvcjjVo/tV75cE6QnbGSHj/iJU9Rqd9q/Umj738AedjwA8xmepZ2ptwMW2VsWQr0Ky 1Ryw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=02aNqgDj+Kp+Pm+ot8F1+KoqUj/zrGsaRGm3Wf9uPRI=; b=XY7ecBndeaMIJUuHiMWcq6RvrY+QLUgIz87OnH5t6dB+QLAPJAtLZ4fK6gsPPc2T0a cYW8O5VphrYjl5KaV588NdWjiF4r7bXzCK5j3CMnwTQ01/4pWa3UQK0HfpAsFpQVOrbL H2VUhEGOj/v+hvE520eq2M2lQWl0f8pEfTnC5c9OPb9Gfh7g+IAx4cY4hS73HBK+NmXT 6WZrxF+ko5CvYlP/71yebn71es7BSn3oTPVJY3tYpVKN9uZXqn4e0XVqYB/P11ezwWyM 4uePoQOvpg6NZCkvHoLEHFXiWym1z0Jh8LolDa4C9YWC7IHMNGV974wlM3cNPRD+gbpV YNHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2vx7vrif; 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 f17si8033706eda.232.2019.10.06.11.05.18; Sun, 06 Oct 2019 11:05:41 -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; dkim=pass header.i=@kernel.org header.s=default header.b=2vx7vrif; 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 S1728148AbfJFRZ6 (ORCPT + 99 others); Sun, 6 Oct 2019 13:25:58 -0400 Received: from mail.kernel.org ([198.145.29.99]:50778 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728107AbfJFRZr (ORCPT ); Sun, 6 Oct 2019 13:25:47 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B9D3820867; Sun, 6 Oct 2019 17:25:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570382746; bh=WZWvLpu91GzMfveMKVhwBFKltwv+EJOdKuq185tjW3k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2vx7vrifXKHhenN1d0pSTYsAtJesxDnciZ1b3adfa53GgFVDLt8MChmli6ZY10jKo G121WVGYjcuNPVj9/5Em5fdcrB/zW7T/kZ1IgSPBZutn1pIsyUYfm+d/SfDBOhBUbZ lCmW6TVF+XJA/WcxRu3//CHyuO3PTpRrOiksZko4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Nathan Lynch , Michael Ellerman , Sasha Levin Subject: [PATCH 4.14 24/68] powerpc/pseries: correctly track irq state in default idle Date: Sun, 6 Oct 2019 19:21:00 +0200 Message-Id: <20191006171119.261595375@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171108.150129403@linuxfoundation.org> References: <20191006171108.150129403@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Nathan Lynch [ Upstream commit 92c94dfb69e350471473fd3075c74bc68150879e ] prep_irq_for_idle() is intended to be called before entering H_CEDE (and it is used by the pseries cpuidle driver). However the default pseries idle routine does not call it, leading to mismanaged lazy irq state when the cpuidle driver isn't in use. Manifestations of this include: * Dropped IPIs in the time immediately after a cpu comes online (before it has installed the cpuidle handler), making the online operation block indefinitely waiting for the new cpu to respond. * Hitting this WARN_ON in arch_local_irq_restore(): /* * We should already be hard disabled here. We had bugs * where that wasn't the case so let's dbl check it and * warn if we are wrong. Only do that when IRQ tracing * is enabled as mfmsr() can be costly. */ if (WARN_ON_ONCE(mfmsr() & MSR_EE)) __hard_irq_disable(); Call prep_irq_for_idle() from pseries_lpar_idle() and honor its result. Fixes: 363edbe2614a ("powerpc: Default arch idle could cede processor on pseries") Signed-off-by: Nathan Lynch Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20190910225244.25056-1-nathanl@linux.ibm.com Signed-off-by: Sasha Levin --- arch/powerpc/platforms/pseries/setup.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 6a0ad56e89b93..7a9945b350536 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c @@ -307,6 +307,9 @@ static void pseries_lpar_idle(void) * low power mode by ceding processor to hypervisor */ + if (!prep_irq_for_idle()) + return; + /* Indicate to hypervisor that we are idle. */ get_lppaca()->idle = 1; -- 2.20.1