From patchwork Thu Jul 23 16:37:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?C=C3=A9dric_Le_Goater?= X-Patchwork-Id: 1334989 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4BCJsW4G0Xz9sR4 for ; Fri, 24 Jul 2020 03:16:47 +1000 (AEST) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4BCJsW2JhPzDrS5 for ; Fri, 24 Jul 2020 03:16:47 +1000 (AEST) X-Original-To: skiboot@lists.ozlabs.org Delivered-To: skiboot@lists.ozlabs.org Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=kaod.org (client-ip=188.165.53.149; helo=2.mo2.mail-out.ovh.net; envelope-from=clg@kaod.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=kaod.org Received: from 2.mo2.mail-out.ovh.net (2.mo2.mail-out.ovh.net [188.165.53.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4BCJsF4yd0zDrQF for ; Fri, 24 Jul 2020 03:16:31 +1000 (AEST) Received: from player738.ha.ovh.net (unknown [10.108.35.74]) by mo2.mail-out.ovh.net (Postfix) with ESMTP id 7344B1E2BC9 for ; Thu, 23 Jul 2020 18:38:02 +0200 (CEST) Received: from kaod.org (bad36-1-78-202-132-1.fbx.proxad.net [78.202.132.1]) (Authenticated sender: clg@kaod.org) by player738.ha.ovh.net (Postfix) with ESMTPSA id 960AF14BC08CB; Thu, 23 Jul 2020 16:37:59 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-105G0064cf64c66-1a8c-4138-9a1a-c75440f2e6e1, 0360426414082D1FC3E0C3FF9A362FC9406E86E3) smtp.auth=clg@kaod.org From: =?utf-8?q?C=C3=A9dric_Le_Goater?= To: skiboot@lists.ozlabs.org Date: Thu, 23 Jul 2020 18:37:57 +0200 Message-Id: <20200723163757.1878994-1-clg@kaod.org> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Ovh-Tracer-Id: 13612411352971906009 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduiedrhedugddutdehucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffogggtgfesthekredtredtjeenucfhrhhomhepveorughrihgtucfnvgcuifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeeikeekleffteegleevveejheetuddviedvleejvedvueevtdfgieduieeviedugfenucfkpheptddrtddrtddrtddpjeekrddvtddvrddufedvrddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepphhlrgihvghrjeefkedrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpegtlhhgsehkrghougdrohhrghdprhgtphhtthhopehskhhisghoohhtsehlihhsthhsrdhoiihlrggsshdrohhrgh Subject: [Skiboot] [PATCH] xive/p9: Enforce thread enablement X-BeenThere: skiboot@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Mailing list for skiboot development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: skiboot-bounces+incoming=patchwork.ozlabs.org@lists.ozlabs.org Sender: "Skiboot" Make sure that the enablement has completed to guarantee that the TIMA accesses will see the latest state of the enable register. Signed-off-by: Cédric Le Goater --- hw/xive.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hw/xive.c b/hw/xive.c index 8d6095c02e7e..9a8d91482589 100644 --- a/hw/xive.c +++ b/hw/xive.c @@ -2741,6 +2741,7 @@ static void xive_reset_enable_thread(struct cpu_thread *c) struct proc_chip *chip = get_chip(c->chip_id); struct xive *x = chip->xive; uint32_t fc, bit; + uint64_t enable; /* Get fused core number */ fc = (c->pir >> 3) & 0xf; @@ -2752,9 +2753,16 @@ static void xive_reset_enable_thread(struct cpu_thread *c) if (fc < 8) { xive_regw(x, PC_THREAD_EN_REG0_CLR, PPC_BIT(bit)); xive_regw(x, PC_THREAD_EN_REG0_SET, PPC_BIT(bit)); + + enable = xive_regr(x, PC_THREAD_EN_REG0, PPC_BIT(bit)); + if (!(enable & PPC_BIT(bit))) + xive_cpu_err(c, "Failed to enable thread\n"); } else { xive_regw(x, PC_THREAD_EN_REG1_CLR, PPC_BIT(bit)); xive_regw(x, PC_THREAD_EN_REG1_SET, PPC_BIT(bit)); + enable = xive_regr(x, PC_THREAD_EN_REG1, PPC_BIT(bit)); + if (!(enable & PPC_BIT(bit))) + xive_cpu_err(c, "Failed to enable thread\n"); } }