Received: by 10.192.165.148 with SMTP id m20csp2523250imm; Sun, 22 Apr 2018 08:48:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx49Dz4d2K3TnVUV7bArnSKmqw9dPE3LA5waGJ7JaahM5Fl3n3CsYTEsSqNVA0jOaURCg2Jt4 X-Received: by 2002:a17:902:b191:: with SMTP id s17-v6mr17582936plr.339.1524412121623; Sun, 22 Apr 2018 08:48:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524412121; cv=none; d=google.com; s=arc-20160816; b=QI0v+h+R9GTQP37QeI0ncIckzpnQfGBfERr9vk1UxEz1Q2YRcmGgxzkeX4plwVxvjY 1XMZzhgwzadrf2f3WPzVzuAci17KAbkbKNHyvfHrHsOg0OueYUQlCoenPIycncSLwGLf 3C0nd6MQhwfEhqwHYojmEu6WJXV/wy4+fCCXY9nB4qTcWGgPEa53zTaKB0328rK1JjMh BgoMMrSGEl9Pjir5mNoEKGmDrPHcGVukKFVlrZH/kJJ4+TLWh0bL4NollmuUuSOQYKpe sFpjJ3QiJ/SfpJPQ17cTGK8pH+cY3nxjJa5RLwSvEjKSCuniuUKPUspbHuVCskr1B1hu tyBw== 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=6LyRQHBzOJtQmhaxmQTe0fz0Wd2FJoE+wMFWy4plGCA=; b=riPZfgTrzVSSDljtOa5rBSLCCVB1IB5MehqqfZijgg1Cjn889SIdiVyX7g3xueKdIg qwp3z09ggR7UJ2upVzu/Ava6HNQAXcYwil1hEHVchvFeMRx89/SaIyvbWqgw6oBzFy/0 9Pv6/1DOOj63vn36/pWx93IAeZzOohc3zoG+skmq0ZGti/ailinu1EI4xHVHbWSuZUK1 tziZ3comMaLq9vX3Vw8dX+LYXn72Mnb4uj+DBqnbVkx5Chcs70s86ozyNQ0atng+UYa2 boKYuBhsrAO0AryG/UbULyUqUdUN6jEUWeJWdmHdjRiHLM7Co75JKLuaFTTDB5ZggMYW 8f0w== 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 z2si8209935pgp.532.2018.04.22.08.48.27; Sun, 22 Apr 2018 08:48: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; 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 S1754852AbeDVOC3 (ORCPT + 99 others); Sun, 22 Apr 2018 10:02:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:48514 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753879AbeDVOCX (ORCPT ); Sun, 22 Apr 2018 10:02:23 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 59F70CB7; Sun, 22 Apr 2018 14:02:22 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Benjamin Herrenschmidt , Michael Ellerman Subject: [PATCH 4.16 178/196] powerpc/xive: Fix trying to "push" an already active pool VP Date: Sun, 22 Apr 2018 15:53:18 +0200 Message-Id: <20180422135113.457346237@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180422135104.278511750@linuxfoundation.org> References: <20180422135104.278511750@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.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Benjamin Herrenschmidt commit b32e56e5a87a1f9243db92bc7a5df0ffb4627cfb upstream. When setting up a CPU, we "push" (activate) a pool VP for it. However it's an error to do so if it already has an active pool VP. This happens when doing soft CPU hotplug on powernv since we don't tear down the CPU on unplug. The HW flags the error which gets captured by the diagnostics. Fix this by making sure to "pull" out any already active pool first. Fixes: 243e25112d06 ("powerpc/xive: Native exploitation of the XIVE interrupt controller") Cc: stable@vger.kernel.org # v4.12+ Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Michael Ellerman Signed-off-by: Greg Kroah-Hartman --- arch/powerpc/sysdev/xive/native.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/arch/powerpc/sysdev/xive/native.c +++ b/arch/powerpc/sysdev/xive/native.c @@ -389,6 +389,10 @@ static void xive_native_setup_cpu(unsign if (xive_pool_vps == XIVE_INVALID_VP) return; + /* Check if pool VP already active, if it is, pull it */ + if (in_be32(xive_tima + TM_QW2_HV_POOL + TM_WORD2) & TM_QW2W2_VP) + in_be64(xive_tima + TM_SPC_PULL_POOL_CTX); + /* Enable the pool VP */ vp = xive_pool_vps + cpu; pr_debug("CPU %d setting up pool VP 0x%x\n", cpu, vp);