Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp3393578ybp; Sun, 6 Oct 2019 10:58:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqzXRF3funDzgU7KNZpQHfVBoy+uB7vBGI55elMImQ1jJf8Vu/lv9H6KqoRcD3qObd803ojN X-Received: by 2002:a17:906:5c0c:: with SMTP id e12mr12588008ejq.317.1570384694187; Sun, 06 Oct 2019 10:58:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570384694; cv=none; d=google.com; s=arc-20160816; b=YGhWctwhQ7ZelCjpvA4ppZOrsTY4pp/uC2gbskmQRPKd/aqUoR7Cge2VqmYduqkgne /z1IeYm71xl3GbULrxiQmJHnZS66tJi4y8L/7QX8MtRrT6HImpSbvc3oEZYWTEzWyiOM g62+flW7q0aukgDb/O5uckkDiEy8bnu+9ie8Iq4gDJeJRAHaCq71ECcimDQNp1jRteOp Jup2li//j7znJhURxtdppR9EQ86QgYW36ot6dsGZqPLAMIuB1VBpQ7cAohWOx/+lWyXR A6FMWLHNMEn8jsAo7Icg4QXWR0KrvKK6NyPVoN7kutcWupnb6y/XFZJskwlFyJGbi//y mvQg== 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=zHTxM4RrMmo466OyyVHaiW3yZJL4E9fi1UdwsnUp5X8=; b=LdNO+5+40lncL1jnhFOJy39TQLosfOUTEGywbLdeMGJg95T93EmQuQJ37OvqsOvINT /Vmuj5JVNoVIgogT0ceKYEu8IbWfXq7YfiHNNrgYzwQu5P0HGaVU7fr19tOg9ZmmJp0c 27N892ZiKZ4TYswXuseSZ4hFcec6TTK0oVa6X/yNbZfNEp3S53Cc89iLWiERC+ijxPbB 2onemr/e0JmSawV6bP1s9UibLsJ6kN4ZXq/Qf8+awH3Hv7KMJhHQ3yXSTbUucnh8WeVN gn73IfGC9O4tjSnEraBrEeogfrcmQmHm+t3XZ0YVEqNjtZfcyNxTIWonH5zH7vsb/9R0 nP6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Y8HYbMN+; 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 m1si7474480edb.433.2019.10.06.10.57.50; Sun, 06 Oct 2019 10:58:14 -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=Y8HYbMN+; 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 S1727964AbfJFRzn (ORCPT + 99 others); Sun, 6 Oct 2019 13:55:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:34810 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730242AbfJFRgD (ORCPT ); Sun, 6 Oct 2019 13:36:03 -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 1F06A2064A; Sun, 6 Oct 2019 17:36:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570383362; bh=7n+wym7xP2UaLFtaocy+zLj89/hGGwRuD0CgKErsl84=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y8HYbMN+ykRvOwk2hYvRXevlPIIqHbnwKC6ct7D8UP+ftYD3XbgTgBG9ldEy3w0AL vWVEB7ViR7ybzmD2nyac6hflEhomfV/zMpi9heQR0hKt2tLAPE70kwOWKdlze6Hbla tQWd5Iz4yxakg9fjxgGWlzUJUmfB5Z1X4bLvAcDI= 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 5.2 075/137] powerpc/pseries: correctly track irq state in default idle Date: Sun, 6 Oct 2019 19:20:59 +0200 Message-Id: <20191006171215.286934954@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191006171209.403038733@linuxfoundation.org> References: <20191006171209.403038733@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 8fa012a65a712..cc682759feae8 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c @@ -344,6 +344,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