From patchwork Fri Oct 14 14:28:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 615071 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp338184pvb; Fri, 14 Oct 2022 07:34:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4Q/jp74dT49frkbg3aJkfRWZSRXJQgg8TYP8cqxsGiEeXDIA85zG/OXKAzawy1MpFiXP30 X-Received: by 2002:a0c:a9d0:0:b0:4b4:3f85:f282 with SMTP id c16-20020a0ca9d0000000b004b43f85f282mr4630444qvb.24.1665758064979; Fri, 14 Oct 2022 07:34:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665758064; cv=none; d=google.com; s=arc-20160816; b=sJIwx5igF1P7gCy942Yo2xHv4Qvt6iWbh2e98Ulizgma6qL7CSW31+Q7waGMa5Oc1k IoTfGmpBVWY4cpyMFrcqQ07MFA1IeSTktIeYT/K7bUy0RH2innAl04+3/p4FnMU1RPLs WaWShwYd+uVBrUK6S8WiZZevUH6sblsNbwN2tGn85yvqE17UDFL2SZY5/sycSMbn8TI2 EoYxQvCV5IdrJ7Ki8OTpt9YKnZi8cq2C2o/XJ2qHM3ZH/mIDsr8LpQkChS7HUhw50XI/ 6RoZwdAwydJn2A6CrDZ4dUwFClUNez/VICm4gXRWYDbxQ4jORoyzQ7tHorvKJyWJ/teo jdBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=9BVL8lIrmB6e94ewrgZ2edOtQrRa/f+DyHdENfUpMUM=; b=nyH0mWLO2a/AUF4BngJbJFxXaO3AliM5E33XVpuMS+D5q1Y4A/zYFG1txOdma9dO4c pQWletXaIDsMxdIxdco+uNh795t810BYSI1fxsfe/HhCz/XvHOCfi8Gf2VANb1/St2ov WBAa11Xzb0iqQ+tDe5jJfQ6Phbd2JcXq4j816w9Yoeh4sqqQchnbQfAKDyozDwrenzUh ecSzJShMgcGr7XcLDZK/WD7tC92K3Mvm8UJpKcS2jJfvfC2XuNPWj6R5xz617FKYW4FY UCm/AQe/c0kEmrUHe5VclYrCpx1PW88pCozH3xCT44XsZmzKs4FTyAZZlNGW7SEbYcOT exiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tkMjuCuo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id r2-20020a05620a298200b006cdf9e29f52si1583684qkp.582.2022.10.14.07.34.24 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 14 Oct 2022 07:34:24 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=tkMjuCuo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:45274 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ojLlY-0004pE-Gn for patch@linaro.org; Fri, 14 Oct 2022 10:34:24 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:43050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ojLg8-0000jT-Bh for qemu-devel@nongnu.org; Fri, 14 Oct 2022 10:28:48 -0400 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:38433) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ojLg5-0000EE-Ak for qemu-devel@nongnu.org; Fri, 14 Oct 2022 10:28:48 -0400 Received: by mail-wr1-x430.google.com with SMTP id j16so7840390wrh.5 for ; Fri, 14 Oct 2022 07:28:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=9BVL8lIrmB6e94ewrgZ2edOtQrRa/f+DyHdENfUpMUM=; b=tkMjuCuoj/MdJ5jzxnzQpsrCAFaxnn1WrGSZGE6vL/d8qwmdXABd9MrmhyLBnFpBSp Uc0XMSpVBAYCSskjtCtWp1TAxPLEpO/3M+u5KunFz1S6+YxMV6Q41Q3rp+g0HRkKFVq5 +tHm/veQKUQRYhF4tQa5zGGr1DrKOUnCNhzfKsVwyXBHxT5C0fum+g5WvJkFGUUuMVZT k9YZqEc9nGLAh2w4G9cK2NdfkL8E03KmxxmzJ7oIt7D46a/+HdtZYuzkPx41cNe0BP7T oNy9zSK+RVpQ19HKbdFprZFMlPyN/96a5ii+DB4hWFew5eFyTq0wWDLWEaVTlmwir+2V ktgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9BVL8lIrmB6e94ewrgZ2edOtQrRa/f+DyHdENfUpMUM=; b=aacyYR+FPCI0EFGa55nu2j7+xUZ7Htf/thjgLO8xsccSEacowDnQDvfEK5Ndtuvzf8 I4R0vEEvyqqAzxPOYtDFA4r3997Uq+YYv8KUH8wWrJXt/C4komKyaV9CZ9aubpIyGiC1 PQmfDxz4/CV+iLSbnGHB3qzN4y6vEjcUSJfv/UcUHk9yFxoaI9JnMXnYdazf1yR0JgTE HEKhGkIIqQAcHtLHRltY9JRNZqOxopHmPL4alTHBO+S3fj9odoLS2YmISaiLdv7xugi7 572a7jm5dJH6swRvO04pM3tQTro28O0edpQmUSeC2o/Z3IippYLa2kt3ORrCigK4v9u1 SO4Q== X-Gm-Message-State: ACrzQf0Z0rmC+muicrEpZJNVlSFlV9EQgPOn+LzmW5710pSRWKt2IQXD tBivszKMDUBRhJv4IY743bx6YnIwR65Geg== X-Received: by 2002:a5d:5249:0:b0:230:1ba4:b6cc with SMTP id k9-20020a5d5249000000b002301ba4b6ccmr3607923wrc.197.1665757723532; Fri, 14 Oct 2022 07:28:43 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id j28-20020a5d6e5c000000b0022cd27bc8c1sm2566356wrz.9.2022.10.14.07.28.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 14 Oct 2022 07:28:42 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Greg Kurz , Daniel Henrique Barboza , =?utf-8?q?C=C3=A9dric_Le_G?= =?utf-8?q?oater?= , David Gibson Subject: [PATCH] hw/ppc/spapr_pci.c: Use device_cold_reset() rather than device_legacy_reset() Date: Fri, 14 Oct 2022 15:28:41 +0100 Message-Id: <20221014142841.2092784-1-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, 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.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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 Reviewed-by: Cédric Le Goater Reviewed-by: Daniel Henrique Barboza --- 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. --- 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;