Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 58FC0C4332F for ; Fri, 14 Oct 2022 16:13:46 +0000 (UTC) Received: from localhost ([::1]:52078 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ojNJh-0001SI-AH for qemu-devel@archiver.kernel.org; Fri, 14 Oct 2022 12:13:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:36610) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojNII-0008PY-2P; Fri, 14 Oct 2022 12:12:18 -0400 Received: from 2.mo548.mail-out.ovh.net ([178.33.255.19]:54195) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojNIF-00030m-Vt; Fri, 14 Oct 2022 12:12:17 -0400 Received: from mxplan5.mail.ovh.net (unknown [10.109.138.210]) by mo548.mail-out.ovh.net (Postfix) with ESMTPS id 18465215AA; Fri, 14 Oct 2022 16:12:04 +0000 (UTC) Received: from kaod.org (37.59.142.108) by DAG4EX2.mxp5.local (172.16.2.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 14 Oct 2022 18:12:03 +0200 Authentication-Results: garm.ovh; auth=pass (GARM-108S002d381e8e0-2f28-4ac2-a664-279664c301c9, 441924D7B23C2DC67B6A5EA8CC9218B60B8FFD55) smtp.auth=clg@kaod.org X-OVh-ClientIp: 82.64.250.170 Message-ID: Date: Fri, 14 Oct 2022 18:12:02 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH] hw/ppc/spapr_pci.c: Use device_cold_reset() rather than device_legacy_reset() Content-Language: en-US To: Peter Maydell , CC: , Greg Kurz , Daniel Henrique Barboza , David Gibson References: <20221014142841.2092784-1-peter.maydell@linaro.org> From: =?UTF-8?Q?C=c3=a9dric_Le_Goater?= In-Reply-To: <20221014142841.2092784-1-peter.maydell@linaro.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [37.59.142.108] X-ClientProxiedBy: DAG3EX2.mxp5.local (172.16.2.22) To DAG4EX2.mxp5.local (172.16.2.32) X-Ovh-Tracer-GUID: abc21845-a080-4ff0-85e6-07bfdd257663 X-Ovh-Tracer-Id: 9967310400446106406 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvfedrfeekvddgleelucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgihesthekredttdefjeenucfhrhhomhepveorughrihgtpgfnvggpifhorghtvghruceotghlgheskhgrohgurdhorhhgqeenucggtffrrghtthgvrhhnpeekteejtdelkeejvdevffduhfetteelieefgeefffeugffhfeekheffueefledujeenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoegtlhhgsehkrghougdrohhrgheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepphgvthgvrhdrmhgrhiguvghllheslhhinhgrrhhordhorhhgpdhqvghmuhdquggvvhgvlhesnhhonhhgnhhurdhorhhgpdhqvghmuhdqphhptgesnhhonhhgnhhurdhorhhgpdgurghnihgvlhhhsgegudefsehgmhgrihhlrdgtohhmpdgurghvihgusehgihgsshhonhdrughrohhpsggvrghrrdhiugdrrghupdhgrhhouhhgsehkrghougdrohhrghdpoffvtefjohhsthepmhhoheegkedpmhhouggvpehsmhhtphhouhht Received-SPF: pass client-ip=178.33.255.19; envelope-from=clg@kaod.org; helo=2.mo548.mail-out.ovh.net X-Spam_score_int: -47 X-Spam_score: -4.8 X-Spam_bar: ---- X-Spam_report: (-4.8 / 5.0 requ) BAYES_00=-1.9, NICE_REPLY_A=-2.856, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On 10/14/22 16:28, Peter Maydell wrote: > In spapr_phb_children_reset() we call device_legacy_reset() to reset any > QOM children of the SPAPR PCI host bridge device. This will not reset > any qbus such a child might own. Switch to device_cold_reset(), which will > reset both the device and its buses. (If the child has no qbuses then > there will be no change in behaviour.) > > Signed-off-by: Peter Maydell > --- > I couldn't figure out what exactly the QOM child objects are in this > case -- the comment in spapr_phb_reset() suggests there's only one and > it's the IOMMU? My guess is that they don't have any qbuses in any case. > This patch was tested with 'make check' and 'make check-avocado' only. If I understand correctly commit e28c16f61fee ("spapr_pci: Allow multiple TCE tables per PHB"), spapr_phb_children_reset() was introduced to reset the TYPE_SPAPR_TCE_TABLE objects. Reviewed-by: Cédric Le Goater Thanks, C. > --- > hw/ppc/spapr_pci.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/hw/ppc/spapr_pci.c b/hw/ppc/spapr_pci.c > index 57c8a4f0855..7b7618d5da0 100644 > --- a/hw/ppc/spapr_pci.c > +++ b/hw/ppc/spapr_pci.c > @@ -2045,7 +2045,7 @@ static int spapr_phb_children_reset(Object *child, void *opaque) > DeviceState *dev = (DeviceState *) object_dynamic_cast(child, TYPE_DEVICE); > > if (dev) { > - device_legacy_reset(dev); > + device_cold_reset(dev); > } > > return 0;