From patchwork Fri Dec 16 21:42:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 634487 Delivered-To: patch@linaro.org Received: by 2002:a17:522:c983:b0:460:3032:e3c4 with SMTP id kr3csp1086969pvb; Fri, 16 Dec 2022 14:29:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXtjgEOssmryvZEPJiQGE4i4fON6hK8G3cuFDrfuxi6NCApB2+45dkBRSikk2kV2gt/b2WxY X-Received: by 2002:a05:622a:254:b0:3a7:f93a:df8 with SMTP id c20-20020a05622a025400b003a7f93a0df8mr2138526qtx.61.1671229740666; Fri, 16 Dec 2022 14:29:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671229740; cv=none; d=google.com; s=arc-20160816; b=hLvrcYjFN96B+F68ziF34jpTDx6v4eaS9u6FaeBpWmB0ZuOXFzxcRLU9p7D53NGmD5 WcWYlvDP2Nq4dNPxe+YOLPCEY4t4aOOyYvc9W2JaOCW/Mw+1kxBRojEm7VYRlNjAimNu 7cYN0W+yEyr342NA1gUtSEWLwsETTgLAV1PqNhXORotVPBMITGG2wuJZVuVOEPAftbES lzsYVqS0ET7LeRonWNtuBuZnEOE0/ccW04I9e0Z0Qe03BF9iyy+Dspq2q/66Rgigba5F jxzSkX15OWorKYVeGm3faCnEYo+yFbed75xVDqRl+v504MFK8A6X9OHXrl1cavXnhTvz eZOQ== 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:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=bRq697OJRpkwMKWFeobURUSNyr0IVAGEj4jxSGYd0BA=; b=qPK9coeGhnpqlBSn7biwvR2Gz3ChWP7Vp2yzVXe0lu4f63LtBWsBUe30gK3E+3JzdE vjwR6SX/plVTqSpGVh8VweTx9f/d2dXHWhGY1rizxkQKvPoP5kgzISVZuzqQFbgycTBl RmK3gcKiwuaLQe46IblEZF8yrwJLU/++eFG3lbD9ZGWKBGT1p0C7kcP0l1X2h3O/HmQr TxdnU1+tarFucXbtKialhm+2unf5A5fJxRkyv3VbDxjRv1IHXSG5xi5a9viYcYt3bf6J Ft4ubJ8w97YKZXzsIIV2U9kw9trJJtIi6kbRplz7pWJpBoF6plLGsQQcv72PbFEB4RC9 Q9hQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hVWKA9fQ; 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 q14-20020a05620a2a4e00b006fc5ded6d1esi1619437qkp.325.2022.12.16.14.29.00 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 16 Dec 2022 14:29:00 -0800 (PST) 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=hVWKA9fQ; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p6IV6-0006lu-3F; Fri, 16 Dec 2022 16:44:16 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p6IUJ-00067K-68 for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:33 -0500 Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p6IUC-0000b3-HH for qemu-devel@nongnu.org; Fri, 16 Dec 2022 16:43:26 -0500 Received: by mail-wm1-x32a.google.com with SMTP id ja17so2736807wmb.3 for ; Fri, 16 Dec 2022 13:43:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=bRq697OJRpkwMKWFeobURUSNyr0IVAGEj4jxSGYd0BA=; b=hVWKA9fQ2t/WFzhF/LlZVMHlVn0VG9JBFIsixsL2xWnlUkVBqFUCy34yn9c1BZEHgf /Hb886HyO0fuuez9TQhaARasogVrq90p3AGqDYmjWqxLrdnC1zVKE2ynvAU/2JdlFhXT Xq1Q+zrAk4T4RBUN2sMEBTYinlyDtVBeSbVGMuWCHBVLQbrf1KlKFLjk2wwc9f70I374 6ZG2z93ZAaBYg+iA6aIb0+43Rg7A22UQGe2pjBx/Y9zgro67W+mDYUs0a8HSQT9umZ9c uTqIiSMH9qeJEJV864cxVfeRJbH+60cB12e1rBAbWcTKKGexvYATHpQcTnx5J+dmgYFf 79ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=bRq697OJRpkwMKWFeobURUSNyr0IVAGEj4jxSGYd0BA=; b=jbCnVtRdo2HT9atZ9NV7caEX/5jtiH4/hmWAXMOmkUEgekC/mSl2/+TGVCTIGtPtky qIKIJbwHqkAij+/zqnxz26P17Xn+2jdWhB3/nDyYfs67y2AViL7JB7MVNBUbg+LvIPep jRZ0vjTmHntbwugEKyafXWz5jugdoa9GRHVMtfpATblipoVPy3jDld/m34zpQCCFofxS MES9Qll32V+R104ozAgx3ynuDyz0ri+KJmtWZhKNd9HO54PczPubKJPWFEC1CIE2aS/O saRGWHRdqOOGZCGnJStmOZYXGIZCtKPFBsZs3B4YSp0+2X+lSuaG/TH+6ap8o92nw/yY F7kQ== X-Gm-Message-State: AFqh2krbhogsUtQatvDYXwXFwc0xW7UBnGHKZOJGeSx6D9bMTmKLaoid d5OPEnDiAfEB0SiRWT8UxPT8BgukTQAikspf X-Received: by 2002:a05:600c:5126:b0:3d3:3c60:b2bb with SMTP id o38-20020a05600c512600b003d33c60b2bbmr5903150wms.23.1671226999786; Fri, 16 Dec 2022 13:43:19 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id y7-20020a05600c364700b003d33ab317dasm4135263wmq.14.2022.12.16.13.43.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Dec 2022 13:43:19 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Subject: [PULL 36/36] hw/pci-host/pnv_phb3_msi: Convert TYPE_PHB3_MSI to 3-phase reset Date: Fri, 16 Dec 2022 21:42:44 +0000 Message-Id: <20221216214244.1391647-37-peter.maydell@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221216214244.1391647-1-peter.maydell@linaro.org> References: <20221216214244.1391647-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32a.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=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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Convert the TYPE_PHB3_MSI class to 3-phase reset, so we can avoid using the device_class_set_parent_reset() function. Signed-off-by: Peter Maydell Tested-by: Daniel Henrique Barboza Reviewed-by: Cédric Le Goater Reviewed-by: Philippe Mathieu-Daudé Message-id: 20221125115240.3005559-8-peter.maydell@linaro.org --- include/hw/ppc/xics.h | 2 +- hw/pci-host/pnv_phb3_msi.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/include/hw/ppc/xics.h b/include/hw/ppc/xics.h index 00b80b08c27..95ead0dd7c9 100644 --- a/include/hw/ppc/xics.h +++ b/include/hw/ppc/xics.h @@ -95,7 +95,7 @@ struct ICSStateClass { DeviceClass parent_class; DeviceRealize parent_realize; - DeviceReset parent_reset; + ResettablePhases parent_phases; void (*reject)(ICSState *s, uint32_t irq); void (*resend)(ICSState *s); diff --git a/hw/pci-host/pnv_phb3_msi.c b/hw/pci-host/pnv_phb3_msi.c index ae908fd9e41..41e63b066f9 100644 --- a/hw/pci-host/pnv_phb3_msi.c +++ b/hw/pci-host/pnv_phb3_msi.c @@ -228,12 +228,14 @@ static void phb3_msi_resend(ICSState *ics) } } -static void phb3_msi_reset(DeviceState *dev) +static void phb3_msi_reset_hold(Object *obj) { - Phb3MsiState *msi = PHB3_MSI(dev); - ICSStateClass *icsc = ICS_GET_CLASS(dev); + Phb3MsiState *msi = PHB3_MSI(obj); + ICSStateClass *icsc = ICS_GET_CLASS(obj); - icsc->parent_reset(dev); + if (icsc->parent_phases.hold) { + icsc->parent_phases.hold(obj); + } memset(msi->rba, 0, sizeof(msi->rba)); msi->rba_sum = 0; @@ -287,11 +289,12 @@ static void phb3_msi_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); ICSStateClass *isc = ICS_CLASS(klass); + ResettableClass *rc = RESETTABLE_CLASS(klass); device_class_set_parent_realize(dc, phb3_msi_realize, &isc->parent_realize); - device_class_set_parent_reset(dc, phb3_msi_reset, - &isc->parent_reset); + resettable_class_set_parent_phases(rc, NULL, phb3_msi_reset_hold, NULL, + &isc->parent_phases); isc->reject = phb3_msi_reject; isc->resend = phb3_msi_resend;