Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3397097ybp; Sun, 6 Oct 2019 11:02:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqwJq0wHbdyXOGQRbIiPuw6DIQW2DsSsAIe84fkUTNDTJzRGBYLFESIcbk3UOu3fIBp2p3yt X-Received: by 2002:aa7:c98a:: with SMTP id c10mr26138486edt.23.1570384943585; Sun, 06 Oct 2019 11:02:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384943; cv=none; d=google.com; s=arc-20160816; b=v65SY0c02UGGwVGiCeWEgW3rIUt3lmOIoiDMIzCvmHthpefexjTGooON9Rkx3kivcK t1CIwypvPQdRooM3creXKLrDr4U3N18l5u/G/j3RSYxpwq5ZLsuzh8xMG3THD+6R7hbk EyfkbgBACjFxjyTqwaB7mVvklXvsBEz+P0EL9YUh2sQi0wrz91vBMTZ2Hcv79pvq4+wa PPx1q3EtOwLIWRpn3Sk+FhjLkGfssRS+2bVyIzwNZhh6nEnbH66XbcWrTcRq2lslYnBV QIkq2OF28I7QYbo2er5JryE8wiUJaY/EUXBK9lh8WOD8tbvxa3AXdxqyWQQvMM53D9sA o9Aw== 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=D4e2XmsZNacgtvc7Lxh5AvSBBgSGCJ0inagYqtS7Lpw=; b=dJTurei9JAvIVzpTVFI7nVP8LbwPW0KIYmlG0Ml3qGcCW+naVA3eNs6W/Zp+wwOiAR yCnfOgrBtF5khrNaVkaHTWue0Ucg9Hfq/tcvB6hEN+eVO/o4waLntQ5EGgh9idwRBinu qMiMEKE60+0+ntmt7Pl6cCaQ4gHdZf4zK/Y5FawlNUdhqyRAFJ6zcKNG6j9TUeDJ6N9Q hNPQULTxGBbyeUnDoDPu9c8syTkyLlqTrBwt5SurN07t35odkgNsuZ+iYxIjNR+eFL3u FuV+jZZhMapymlmKVMF1Iro2ku4xY41g2pYYsFgqUl4HrqAm/4qTkMPizTHwAGPpW06G WWhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1AHsUn1z; 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 j11si7385264edj.43.2019.10.06.11.01.59; Sun, 06 Oct 2019 11:02:23 -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=1AHsUn1z; 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 S1727922AbfJFR7l (ORCPT + 99 others); Sun, 6 Oct 2019 13:59:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:56188 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729206AbfJFRaQ (ORCPT ); Sun, 6 Oct 2019 13:30:16 -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 DFF412133F; Sun, 6 Oct 2019 17:30:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383016; bh=j8Ts51ouzUORb/g+SI+XF3GofZDMGyDqpfF2SFwJASg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1AHsUn1zqXENJsKeZLjOfwk4Rf8DaJSraGNrDbKlrelekmY2guPNxj+ANzwuFRH0k 40MCh9bNszmk5WtQO7oXuuxlsr5YGKbxOFV39b2nE5axeqYlhasqdZWAFpVt1MZePp +o3SW7dqHjZGOBBDnYoOosSwaiUpt/B5SwccWrn8= 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.19 038/106] powerpc/pseries: correctly track irq state in default idle Date: Sun, 6 Oct 2019 19:20:44 +0200 Message-Id: <20191006171141.397412915@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171124.641144086@linuxfoundation.org> References: <20191006171124.641144086@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 ba1791fd3234d..67f49159ea708 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c @@ -325,6 +325,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