From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_2 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7695AC433DB for ; Mon, 1 Mar 2021 14:16:04 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1008C64DF5 for ; Mon, 1 Mar 2021 14:16:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1008C64DF5 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kaod.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Received: from localhost ([::1]:38222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lGjL9-0006Xb-37 for qemu-devel@archiver.kernel.org; Mon, 01 Mar 2021 09:16:03 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39166) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGjIl-0004o2-T5 for qemu-devel@nongnu.org; Mon, 01 Mar 2021 09:13:35 -0500 Received: from 7.mo52.mail-out.ovh.net ([188.165.59.253]:43758) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lGjIe-0000UV-04 for qemu-devel@nongnu.org; Mon, 01 Mar 2021 09:13:35 -0500 Received: from mxplan5.mail.ovh.net (unknown [10.108.16.68]) by mo52.mail-out.ovh.net (Postfix) with ESMTPS id B344524691F; Mon, 1 Mar 2021 15:13:25 +0100 (CET) Received: from kaod.org (37.59.142.102) by DAG8EX1.mxp5.local (172.16.2.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2106.2; Mon, 1 Mar 2021 15:13:25 +0100 Authentication-Results: garm.ovh; auth=pass (GARM-102R004dc091803-810c-4e6a-b76a-248a406b0601, 479CA1392526D135F52AAC0E93683906E8F354F3) smtp.auth=groug@kaod.org X-OVh-ClientIp: 78.197.208.248 Date: Mon, 1 Mar 2021 15:13:24 +0100 From: Greg Kurz To: Daniel Henrique Barboza Subject: Re: [PATCH 2/5] spapr.c: check unplug_request flag in spapr_memory_unplug_request() Message-ID: <20210301151324.3003e6a4@bahia.lan> In-Reply-To: <20210226163301.419727-3-danielhb413@gmail.com> References: <20210226163301.419727-1-danielhb413@gmail.com> <20210226163301.419727-3-danielhb413@gmail.com> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Originating-IP: [37.59.142.102] X-ClientProxiedBy: DAG5EX1.mxp5.local (172.16.2.41) To DAG8EX1.mxp5.local (172.16.2.71) X-Ovh-Tracer-GUID: 2e19bfc0-46a4-4a30-ae95-974b7b870eae X-Ovh-Tracer-Id: 17763604307183835616 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduledrleekgdeitdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpeffhffvuffkjghfofggtgfgihesthejredtredtvdenucfhrhhomhepifhrvghgucfmuhhriicuoehgrhhouhhgsehkrghougdrohhrgheqnecuggftrfgrthhtvghrnhepfedutdeijeejveehkeeileetgfelteekteehtedtieefffevhffflefftdefleejnecukfhppedtrddtrddtrddtpdefjedrheelrddugedvrddutddvnecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepmhigphhlrghnhedrmhgrihhlrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehgrhhouhhgsehkrghougdrohhrghdprhgtphhtthhopegurghvihgusehgihgsshhonhdrughrohhpsggvrghrrdhiugdrrghu Received-SPF: pass client-ip=188.165.59.253; envelope-from=groug@kaod.org; helo=7.mo52.mail-out.ovh.net X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-ppc@nongnu.org, qemu-devel@nongnu.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Fri, 26 Feb 2021 13:32:58 -0300 Daniel Henrique Barboza wrote: > Now that we're asserting the first DRC LMB earlier, use it to query if > the DRC is already pending unplug and, in this case, issue the same > error we already do. > > The previous check was introduced in commit 2a129767ebb1 and it works, > but it's easier to check the unplug_requested flag instead of looking > for the existence of the sPAPRDIMMState. It's also compliant with what > is already done in other unplug_request functions for other devices. > > Signed-off-by: Daniel Henrique Barboza > --- Reviewed-by: Greg Kurz > hw/ppc/spapr.c | 8 +------- > 1 file changed, 1 insertion(+), 7 deletions(-) > > diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c > index 74e046b522..149dc2113f 100644 > --- a/hw/ppc/spapr.c > +++ b/hw/ppc/spapr.c > @@ -3681,13 +3681,7 @@ static void spapr_memory_unplug_request(HotplugHandler *hotplug_dev, > addr_start / SPAPR_MEMORY_BLOCK_SIZE); > g_assert(drc_start); > > - /* > - * An existing pending dimm state for this DIMM means that there is an > - * unplug operation in progress, waiting for the spapr_lmb_release > - * callback to complete the job (BQL can't cover that far). In this case, > - * bail out to avoid detaching DRCs that were already released. > - */ > - if (spapr_pending_dimm_unplugs_find(spapr, dimm)) { > + if (spapr_drc_unplug_requested(drc_start)) { > error_setg(errp, "Memory unplug already in progress for device %s", > dev->id); > return;