From nobody Tue Nov 26 16:30:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1705682199; cv=none; d=zohomail.com; s=zohoarc; b=aAfxnjZSTJnvuLrgXdaxfTPd0QVkJ/wdWA5PEtJY9H9An5MIccaQkEVn4zOx08VHJw/fkQFrgWKhG/tL1r9IfsEZrDadeE7PbZwWaoc8+yjvm5HVppjj8GDlD41kyXx2etgMpMNy6bQhkeOp/cAGEEJfGEBfmg47ws9kcb/fQbo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705682199; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=fK9dmAwnACqE12D5kcXMqNrcgKcFC5XpZxT2a1RWnEY=; b=OFcDN67l14UWRMVSMPz1e+4goMM1EU7lMW+DsG/epdwkyKJGX22z+ogJlxA90RbqvQdQe91C8f2PJ2XY/SmXpw2I6t7FBTA9RE7NhYJtTP9DnZ07l+ziniPqOMWSnMSuV7ib9bcJtO/HoOWSzPVCnvxjYAhUVlUlCQh1PnSDB14= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1705682199149610.787934486027; Fri, 19 Jan 2024 08:36:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQrpv-0000lW-V9; Fri, 19 Jan 2024 11:35:19 -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 1rQrpu-0000kd-U3 for qemu-devel@nongnu.org; Fri, 19 Jan 2024 11:35:18 -0500 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rQrps-0004lq-N3 for qemu-devel@nongnu.org; Fri, 19 Jan 2024 11:35:18 -0500 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40e76626170so10240725e9.2 for ; Fri, 19 Jan 2024 08:35:16 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id fc11-20020a05600c524b00b0040e86fbd772sm10979260wmb.38.2024.01.19.08.35.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 08:35:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705682115; x=1706286915; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=fK9dmAwnACqE12D5kcXMqNrcgKcFC5XpZxT2a1RWnEY=; b=mcawH57T7wasvrC5jMvcLjSqtP6YElv/xntYCGznysOzaovoESBbIHMX6tKkkj9lAR 0LDEee8EI1k+qmo6cB/CcBgmLbMAof95XyUPkAo1/j/Y9Kxvafb1PtphyTw5irwF4+YS mpTTOZ1dEAgv4Do/GJHebnIX56WghWgiqqazeusBQmv10ZNoGL0IvOdTR3px8kX01QWl m3meebqpFHV4J6uPLiyCtaR51RY96eXUqXE7dkUbzdudP1shzNFI0akyiE9IEhh19TAT IstpcSCD3q+Vaf4zdP4Mqs9sSI1H278hZzhW1MO4qtVGz4r+sK6tgCppVL2kUeoWK0cS FZtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705682115; x=1706286915; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fK9dmAwnACqE12D5kcXMqNrcgKcFC5XpZxT2a1RWnEY=; b=N0DA9kXmz6QKQnki/W5Q7JSBs6DR/nGC+7GaPmOQ5TFFetIzvyzntmEI+s4a/NLeyK bd3LnUUZK+Kppc3iq1ayr2qgNehLAG3R0DYAW/sl9XfsnuJYanttrdE5rXWKYZT+NwxV nrtqU1a0Kdn7ic5OW4DGEYP1PIX2+t9oWlQSFiwjDvtB0K+ZWeWrUkh17LT4Cn8Z+5oO 4palND68hKMLFPk0va2TOHuhJ4i8X3AhY6doKyNZoe9aKx5vr3DQ62qmZ+MldJa8FhD0 q5memufbGcCftgxA/xoreC5Z6NNCJ1FweHHdhALAvuu3YFIXC32NwgMD8fdMsHLNyfGP 7eEw== X-Gm-Message-State: AOJu0Yw8kGEOsKMDon5WgSl7axVKVtk8ps4cwO94xWK36sPQzZt1YksU ZLHldKwZ4ZBPgrPU8CBNp2ySE8RSM/AcEFzItEflFQ581YYq9CYjXz/sgoMAlojZiQxf2eclp9J M X-Google-Smtp-Source: AGHT+IGrRRHdaIIPlHVAKKIdsh71yyrK1uNlbyeMeJf+oi349grv87hV1SvD5XBsTEMpV6SXKPx2Wg== X-Received: by 2002:a05:600c:6a82:b0:40e:68a6:7bdb with SMTP id jl2-20020a05600c6a8200b0040e68a67bdbmr18703wmb.62.1705682114742; Fri, 19 Jan 2024 08:35:14 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: "Maciej S. Szmigiero" , Mark Cave-Ayland , "Michael S. Tsirkin" , Marcel Apfelbaum , Halil Pasic , Christian Borntraeger , Eric Farman , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/5] pci: Switch bus reset to 3-phase-reset Date: Fri, 19 Jan 2024 16:35:08 +0000 Message-Id: <20240119163512.3810301-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240119163512.3810301-1-peter.maydell@linaro.org> References: <20240119163512.3810301-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::329; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x329.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, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1705682200251100006 Content-Type: text/plain; charset="utf-8" Switch the PCI bus from using BusClass::reset to the Resettable interface. This has no behavioural change, because the BusClass code to support subclasses that use the legacy BusClass::reset will call that method in the hold phase of 3-phase reset. Signed-off-by: Peter Maydell Acked-by: C=C3=A9dric Le Goater Acked-by: Michael S. Tsirkin Reviewed-by: Zhao Liu Tested-by: C=C3=A9dric Le Goater --- hw/pci/pci.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 76080af580d..05c2e46bda5 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -64,7 +64,7 @@ bool pci_available =3D true; =20 static char *pcibus_get_dev_path(DeviceState *dev); static char *pcibus_get_fw_dev_path(DeviceState *dev); -static void pcibus_reset(BusState *qbus); +static void pcibus_reset_hold(Object *obj); static bool pcie_has_upstream_port(PCIDevice *dev); =20 static Property pci_props[] =3D { @@ -202,13 +202,15 @@ static void pci_bus_class_init(ObjectClass *klass, vo= id *data) { BusClass *k =3D BUS_CLASS(klass); PCIBusClass *pbc =3D PCI_BUS_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 k->print_dev =3D pcibus_dev_print; k->get_dev_path =3D pcibus_get_dev_path; k->get_fw_dev_path =3D pcibus_get_fw_dev_path; k->realize =3D pci_bus_realize; k->unrealize =3D pci_bus_unrealize; - k->reset =3D pcibus_reset; + + rc->phases.hold =3D pcibus_reset_hold; =20 pbc->bus_num =3D pcibus_num; pbc->numa_node =3D pcibus_numa_node; @@ -424,9 +426,9 @@ void pci_device_reset(PCIDevice *dev) * Called via bus_cold_reset on RST# assert, after the devices * have been reset device_cold_reset-ed already. */ -static void pcibus_reset(BusState *qbus) +static void pcibus_reset_hold(Object *obj) { - PCIBus *bus =3D DO_UPCAST(PCIBus, qbus, qbus); + PCIBus *bus =3D PCI_BUS(obj); int i; =20 for (i =3D 0; i < ARRAY_SIZE(bus->devices); ++i) { --=20 2.34.1 From nobody Tue Nov 26 16:30:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1705682131; cv=none; d=zohomail.com; s=zohoarc; b=OBA5AdZHshYlBBI/1zrw3PhleY/x5RDKtmWEm5sn7LgbN8eqxnkUzqJdkweeS3YESRJHIJehH7z6Tf8/Mhls2ThfznTBgVHiO0TdkhjT0EOUEkiTJp/7peuwme3d+JHQ3vWVYjH9EhcZ7BIwqPAtfz8h1PUufN8K40yOo9V8fZo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705682131; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=wLWOOCsvWKB0fq6rzd5QzssHwCuxhyOKho4Poa5gytE=; b=P8aba7ZQkfSeJBWC4XSjUBCAXSJP8iZ1pRbRSGXU5RQlvLdS0ITbTCGohbKMO2CApJ5WyJJ+tAqkW4FKil4ZgnTH2wDvKfgwxX6jRfnFSipRoFsM0HBj2kOvmEV5z1dfM3MS39p539TriZowmt805zxHqXSiLqqJqQVJ2Vlzxc8= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1705682130903534.8260601841871; Fri, 19 Jan 2024 08:35:30 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQrpx-0000mC-5h; Fri, 19 Jan 2024 11:35:21 -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 1rQrpu-0000kZ-RJ for qemu-devel@nongnu.org; Fri, 19 Jan 2024 11:35:18 -0500 Received: from mail-wm1-x336.google.com ([2a00:1450:4864:20::336]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rQrps-0004lz-OQ for qemu-devel@nongnu.org; Fri, 19 Jan 2024 11:35:18 -0500 Received: by mail-wm1-x336.google.com with SMTP id 5b1f17b1804b1-40e8801221cso8759375e9.1 for ; Fri, 19 Jan 2024 08:35:16 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id fc11-20020a05600c524b00b0040e86fbd772sm10979260wmb.38.2024.01.19.08.35.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 08:35:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705682115; x=1706286915; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=wLWOOCsvWKB0fq6rzd5QzssHwCuxhyOKho4Poa5gytE=; b=fuEGenAOd7SfKoknSV1TTyD9k1olsYyvQoVkKQn5XJTLgxLOoq9fh2Jqrw/w+waI+V zhyrhQbkg1e6noIgk4oyTAw7dzXwqK4uRNq548ggci5yEi88S+hbC/dAInyxCXtvDiMo NvE87ZbzfyXJ8VUfXJVI5NqWg8CVkuFVZjuJYcGwc9Oqxy0HG1xMasZHkAAul051lcGY g5aZQnVA/9tTiJ3juCbG+R+/cl0buS89XiJW/f7iXxmbY9cTw7ytWfPI7Ee401UHvcZx J03NQA73XquWm3CrV+eSEcPK3RGAGRlLmEL0C+vKdL3If/VDRPoy2tylEEEPX8rEW0Ne o14g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705682115; x=1706286915; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=wLWOOCsvWKB0fq6rzd5QzssHwCuxhyOKho4Poa5gytE=; b=qcGf3t6552OutJ9RW1+nTJUJS+4e4tH7yAzXw7Q1x9D42v/fwNEJ/mkDDyB30m+KhP aEXu8CvGMKDOwVvpXtAAHU5lqG384/78w2AmcijTw6Y0dS4sy+vsQT2fNnq/KdJpEfVD eqORBLz2YEYwtH06+b1IAg+HAVy4nic7UbIAExA2HvEKVEdwkDriqxS5uAo6E++lYtQ8 XW/XAGGL++R+3jUMnki5bJ9joog3urHjyO7wxJy9mecJOBGAhaB+cSnA3UNLGeXvZWkK X5UnBKWI45wlvEMBoHDCobc1PzxCg5oVMlbxFlClT3wLRbhDL47w+gUfNqG6iLQWXouc ZvpA== X-Gm-Message-State: AOJu0YysRnxSSiqrBEEDuNpDJQU87HtQtXs2FgMb327DdNpb8c9ix16z wYkWb9JLx1yqz1iXD89vCEGNa08ngd1J+fYtiI0T0rZWY+L0V0VZm6G7xhwIQrmBvARkzS0o/oB G X-Google-Smtp-Source: AGHT+IHtKgrlG2Hv2zZwgK2Kh6syHi8M6MSl4Dak5M0E52IkY5T1SJ2EIVWEwzA8fj2FbqV5BpHqrA== X-Received: by 2002:a05:600c:1c06:b0:40e:88be:4ef0 with SMTP id j6-20020a05600c1c0600b0040e88be4ef0mr33004wms.0.1705682115282; Fri, 19 Jan 2024 08:35:15 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: "Maciej S. Szmigiero" , Mark Cave-Ayland , "Michael S. Tsirkin" , Marcel Apfelbaum , Halil Pasic , Christian Borntraeger , Eric Farman , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 2/5] vmbus: Switch bus reset to 3-phase-reset Date: Fri, 19 Jan 2024 16:35:09 +0000 Message-Id: <20240119163512.3810301-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240119163512.3810301-1-peter.maydell@linaro.org> References: <20240119163512.3810301-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::336; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x336.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, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1705682132131100003 Content-Type: text/plain; charset="utf-8" Switch vmbus from using BusClass::reset to the Resettable interface. This has no behavioural change, because the BusClass code to support subclasses that use the legacy BusClass::reset will call that method in the hold phase of 3-phase reset. Signed-off-by: Peter Maydell Acked-by: C=C3=A9dric Le Goater Acked-by: Maciej S. Szmigiero Acked-by: Michael S. Tsirkin Reviewed-by: Zhao Liu Tested-by: C=C3=A9dric Le Goater --- hw/hyperv/vmbus.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/hyperv/vmbus.c b/hw/hyperv/vmbus.c index c86d1895bae..380239af2c7 100644 --- a/hw/hyperv/vmbus.c +++ b/hw/hyperv/vmbus.c @@ -2453,9 +2453,9 @@ static void vmbus_unrealize(BusState *bus) qemu_mutex_destroy(&vmbus->rx_queue_lock); } =20 -static void vmbus_reset(BusState *bus) +static void vmbus_reset_hold(Object *obj) { - vmbus_deinit(VMBUS(bus)); + vmbus_deinit(VMBUS(obj)); } =20 static char *vmbus_get_dev_path(DeviceState *dev) @@ -2476,12 +2476,13 @@ static char *vmbus_get_fw_dev_path(DeviceState *dev) static void vmbus_class_init(ObjectClass *klass, void *data) { BusClass *k =3D BUS_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 k->get_dev_path =3D vmbus_get_dev_path; k->get_fw_dev_path =3D vmbus_get_fw_dev_path; k->realize =3D vmbus_realize; k->unrealize =3D vmbus_unrealize; - k->reset =3D vmbus_reset; + rc->phases.hold =3D vmbus_reset_hold; } =20 static int vmbus_pre_load(void *opaque) --=20 2.34.1 From nobody Tue Nov 26 16:30:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1705682155; cv=none; d=zohomail.com; s=zohoarc; b=l92PNOOurD0Bs3MCTQG3KH4Y5a6pTxiWFwa7Vo3v00WKsEhmofR4WSNCmIJFfUrP5GJZfMnLKhN6MsHadz5TfWfVmDwg0SmDrTLyXBYb0VK828q6DhoSLtWrZEwtXrxk6cMDUg4VUq9PBdKoLomwzBapg7xo5uNjXQvHPSuuWvc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705682155; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=MYGIrHOejkd+TofSo5x+fRzzFA+cgX19jZT/zdJeLDM=; b=FKcOBLJ94K09np/QtMcBzXODQ6bGHr1yeKCjXGFHB4kHfvALNkaOaNExoiuE/7vqlDadlAmsXvR8Tw+EW947R2YeREWiqS4f96Zne3owRznWGN4aiMwRGR8eKrHmxAfh5dXdGR8a1pkr0HovFyEtxbtROLNYkpi6JqQ1+e2krUs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1705682155378629.649060129001; Fri, 19 Jan 2024 08:35:55 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQrpw-0000m1-M1; Fri, 19 Jan 2024 11:35:20 -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 1rQrpv-0000l4-8b for qemu-devel@nongnu.org; Fri, 19 Jan 2024 11:35:19 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rQrpt-0004m2-8T for qemu-devel@nongnu.org; Fri, 19 Jan 2024 11:35:18 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40e80046246so6126805e9.1 for ; Fri, 19 Jan 2024 08:35:16 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id fc11-20020a05600c524b00b0040e86fbd772sm10979260wmb.38.2024.01.19.08.35.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 08:35:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705682115; x=1706286915; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MYGIrHOejkd+TofSo5x+fRzzFA+cgX19jZT/zdJeLDM=; b=egGM0n7W9XpUmX/dzkHLLd8hXL3xw3SFZLTDJVo4v9LF0eqLD0kzyVYc8frJwVewBe pqbHKgKiBp/v5rmbbl/l3pT+qbhi8PwsqF300obrsiqK73CxEzTkWyv1B2Bx8hGDrrMI HNGWLPVU0FMstANtTE2JiiOvMXVWWfm5IPt2G+rnLINGIaeFAXiFRDl6vE/0Ig7Y41jp 7p5C/XHmPmcWerh/qjXQQeTiiP3ZAogaaEEDngF/OcOp70upJZ5Jmy9IoChp3bM2lC8v dr7PX9GYeeySQCQtGOneR16S2D8vKWnQM3ITZhri0x3TY1zB5pOD+zfOM8UjfJxA+vcV EkNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705682115; x=1706286915; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MYGIrHOejkd+TofSo5x+fRzzFA+cgX19jZT/zdJeLDM=; b=jhWBS+KEAoIVPAzQzcRK8/MrWXbv3AptlJXYBwCFkUtVLS/CAq1ge1/sW2UqjVh1PK p0MZt5FvoRXjWqLnwZuUy0dRs2HvB8x6DN3c2KpBCIXw/M1UzDpJEOEKb6NsYSsM2Uk9 HqJh+vKhP0+p0lc0Hmf/qjGaAX6pSiacF1QN6ibMqFpJfbMQktxdMPL+tbg+k6ZGeo05 3V0vEDoFN07iIniyT60/R2JtJdFoyQE54eR5GgvV91aGWQvx/04kYqtYD4oPAzlYxoJr 9otZKnTnx8mRt5i/zkLR4fT+KJ6sTLYuhlCRjqOH7VU9qaMxAkiJdh3Qpp7xJxYfixpn IWhw== X-Gm-Message-State: AOJu0YxJIuhQJrJZWKJ7On6tXdObOAjkniot5npVINgQ/5XAH9bhWU2m N9QVHZOV9arib43hDxhKt6KNeakSULMGnDPyLp1kZ0S3X2EwfLJJrqDEoq61pqQI5gohlLtxKJA t X-Google-Smtp-Source: AGHT+IHk6XwwYUwnuq4FdBlD+opHdPAQLyyXaET6Tz3ZtYndE1LHA1FwknIvmcLYTWkJcSHDagjtBQ== X-Received: by 2002:a7b:c3d5:0:b0:40e:59e9:98d0 with SMTP id t21-20020a7bc3d5000000b0040e59e998d0mr91544wmj.154.1705682115808; Fri, 19 Jan 2024 08:35:15 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: "Maciej S. Szmigiero" , Mark Cave-Ayland , "Michael S. Tsirkin" , Marcel Apfelbaum , Halil Pasic , Christian Borntraeger , Eric Farman , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 3/5] adb: Switch bus reset to 3-phase-reset Date: Fri, 19 Jan 2024 16:35:10 +0000 Message-Id: <20240119163512.3810301-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240119163512.3810301-1-peter.maydell@linaro.org> References: <20240119163512.3810301-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1705682156210100001 Content-Type: text/plain; charset="utf-8" Switch the ADB bus from using BusClass::reset to the Resettable interface. This has no behavioural change, because the BusClass code to support subclasses that use the legacy BusClass::reset will call that method in the hold phase of 3-phase reset. Signed-off-by: Peter Maydell Acked-by: C=C3=A9dric Le Goater Acked-by: Michael S. Tsirkin Reviewed-by: Mark Cave-Ayland Reviewed-by: Zhao Liu Tested-by: C=C3=A9dric Le Goater --- hw/input/adb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/hw/input/adb.c b/hw/input/adb.c index 0f3c73d6d00..98f39b4281a 100644 --- a/hw/input/adb.c +++ b/hw/input/adb.c @@ -231,9 +231,9 @@ static const VMStateDescription vmstate_adb_bus =3D { } }; =20 -static void adb_bus_reset(BusState *qbus) +static void adb_bus_reset_hold(Object *obj) { - ADBBusState *adb_bus =3D ADB_BUS(qbus); + ADBBusState *adb_bus =3D ADB_BUS(obj); =20 adb_bus->autopoll_enabled =3D false; adb_bus->autopoll_mask =3D 0xffff; @@ -262,10 +262,11 @@ static void adb_bus_unrealize(BusState *qbus) static void adb_bus_class_init(ObjectClass *klass, void *data) { BusClass *k =3D BUS_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 k->realize =3D adb_bus_realize; k->unrealize =3D adb_bus_unrealize; - k->reset =3D adb_bus_reset; + rc->phases.hold =3D adb_bus_reset_hold; } =20 static const TypeInfo adb_bus_type_info =3D { --=20 2.34.1 From nobody Tue Nov 26 16:30:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1705682141; cv=none; d=zohomail.com; s=zohoarc; b=bOIua2elpxqHcaw+NUYzWmsaf0xVrHVjosLhDpkTvFkgB5dYvexlNp2Nx9s7UdfAT/EojPHF2o/sALz9nJxPpduK6QAEvKr0WrYWOOom7K3JhsNT/cD0KJ55zvI23uKSVXubX9mBU0OOG4oCjN24L/nCojYhTWwCAm5PKbUhnhA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705682141; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=xeQ/bMA7W62y/SM3vuOP/JDUaEJLEfPl9aVZLxbSh4I=; b=SepUfHp2xzMGlkCh6/bSmFvFcOKp5jgWpnbZdKdvl1//TEpvUvjsVclrH6HG34Z6fi8RXqOdqlbvL6qSUgQZVkXBUYB6HRrnySfdJ70y2momNh5ZqMEQmikqoqfdB7D76OLMBXEysYsRmWccwUOFUrpUrs4YVTz0oUintIijgRI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1705682141596643.1447019541158; Fri, 19 Jan 2024 08:35:41 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQrpy-0000nZ-RR; Fri, 19 Jan 2024 11:35:22 -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 1rQrpv-0000lU-Ot for qemu-devel@nongnu.org; Fri, 19 Jan 2024 11:35:19 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rQrpt-0004mP-W7 for qemu-devel@nongnu.org; Fri, 19 Jan 2024 11:35:19 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-40e7065b692so9795165e9.3 for ; Fri, 19 Jan 2024 08:35:17 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id fc11-20020a05600c524b00b0040e86fbd772sm10979260wmb.38.2024.01.19.08.35.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 08:35:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705682116; x=1706286916; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=xeQ/bMA7W62y/SM3vuOP/JDUaEJLEfPl9aVZLxbSh4I=; b=pmcRm1uSjNu/lfXaFBsMP+btolE9DO33WFu85pGE1RYbTZQZLFYy7hCjDucQqwUqA6 EIR93oD0vvwuc/IBPUaRHXwISEfGdcmZj0r0EKmVwAAanTGm0OtV9PEnRMx0HLhzbZMf 2X1ccdu0+TEEEyZhbg+Wr8t3mCYe2ve5QVDVvTqAMNU2w6ieZ0sNAaALdAwtES3w9X0L 0ylAfXiUuJaFtGaerc0jSEJWY3U7MIR813t6X/mFIVwpsjnygD4EFqZclgUjMUFnvNTJ 0KBwP5GpCV/ivi+IvG6txqi5MfTJe7fmetOHwZkPOVLm8Cxx5G+1hqJvk4/IsK0G3Ahq p6gw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705682116; x=1706286916; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=xeQ/bMA7W62y/SM3vuOP/JDUaEJLEfPl9aVZLxbSh4I=; b=WUuF5ETFqEa8OhqruYUDgOs65Zre3OovXXiIjveLrS/TbcGg+nDZk0t8dBeB1rb0ZI lfn6si2D4e5JrIX1EWXaKo9+n2VPW6Mq7cPHIaTsVul+cCS+iSKi9bFUi+QeZwbkgLKL wLBMbLj7ASgH3q/MAnH5trZGsgED4upv8Ly5XvwAkfF38KapkMc4rPpfeKCVJ7A3N9Om TsOqKJDL+GExy6m3EFpTBvS1nkQJKZ3WPf11isT6FBlLJuvFcKer9WnhXyYen6+njRoY iplFpJu4iiI+9U6C69WRu70k/CiLSSFoVK/1RKryy8++Pl2zzXwlhmWASMcXsn1iHy2u yOSA== X-Gm-Message-State: AOJu0YwTyN0LY38lfyBq+/Ma6Dz2cf6sndtTKzixmzHVhS9iHlf9TqCu 0W8XHEX0Ek2AmyQ1cceD+ApS1p9B8iTPde1sI9thCDXC9X4vPH2WuvuhcAinpn0t3hZxa/ZIrJl u X-Google-Smtp-Source: AGHT+IFCg/uHYQ6CdIarPXrMPK7I0kY5WFXcWwOzquQltxWT3V6BbkOgABdyUWYglSsFV0dzboOPPA== X-Received: by 2002:a05:600c:2194:b0:40e:628f:96fb with SMTP id e20-20020a05600c219400b0040e628f96fbmr10369wme.168.1705682116376; Fri, 19 Jan 2024 08:35:16 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: "Maciej S. Szmigiero" , Mark Cave-Ayland , "Michael S. Tsirkin" , Marcel Apfelbaum , Halil Pasic , Christian Borntraeger , Eric Farman , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 4/5] hw/s390x/css-bridge: switch virtual-css bus to 3-phase-reset Date: Fri, 19 Jan 2024 16:35:11 +0000 Message-Id: <20240119163512.3810301-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240119163512.3810301-1-peter.maydell@linaro.org> References: <20240119163512.3810301-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1705682142103100001 Content-Type: text/plain; charset="utf-8" Switch the s390x virtual-css bus from using BusClass::reset to the Resettable interface. This has no behavioural change, because the BusClass code to support subclasses that use the legacy BusClass::reset will call that method in the hold phase of 3-phase reset. Signed-off-by: Peter Maydell Acked-by: C=C3=A9dric Le Goater Acked-by: Michael S. Tsirkin Reviewed-by: Eric Farman Reviewed-by: Halil Pasic Reviewed-by: Zhao Liu Tested-by: C=C3=A9dric Le Goater --- hw/s390x/css-bridge.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/s390x/css-bridge.c b/hw/s390x/css-bridge.c index 15d26efc951..34639f21435 100644 --- a/hw/s390x/css-bridge.c +++ b/hw/s390x/css-bridge.c @@ -56,7 +56,7 @@ static void ccw_device_unplug(HotplugHandler *hotplug_dev, qdev_unrealize(dev); } =20 -static void virtual_css_bus_reset(BusState *qbus) +static void virtual_css_bus_reset_hold(Object *obj) { /* This should actually be modelled via the generic css */ css_reset(); @@ -81,8 +81,9 @@ static char *virtual_css_bus_get_dev_path(DeviceState *de= v) static void virtual_css_bus_class_init(ObjectClass *klass, void *data) { BusClass *k =3D BUS_CLASS(klass); + ResettableClass *rc =3D RESETTABLE_CLASS(klass); =20 - k->reset =3D virtual_css_bus_reset; + rc->phases.hold =3D virtual_css_bus_reset_hold; k->get_dev_path =3D virtual_css_bus_get_dev_path; } =20 --=20 2.34.1 From nobody Tue Nov 26 16:30:02 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1705682199; cv=none; d=zohomail.com; s=zohoarc; b=Xj1xvHlIR5vrZspkSlhy2fPOYhDDNnVesVp4cCQ0yRODFhziYxY3L9qkwVy9oMcWyoc6cpQrHKAEZ596ushZsMVSygrgFNzD5/w5wJC4MalxoPndDhsr68ybEfO5vzJad4CPyTrj51awKEXsbjU4NUliA4p7+tZv2FtqRTS+1dg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1705682199; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=tyBXToJHpERthhZrSNsFcfkP84TYfgOcTgP/HWJh+Ms=; b=GMNkLu8+fjgwXmUsDtTsI7q8r7xzRE8h2VMSAR67qIyVj9xCOHrarim0IrzulQOlBlaQQI+aywOHoaIFnUJRzX5jGQ3nlsV0IXZVzCuUGKW+iFKSdYSNhO4EFTiVs+0Db5N6GDz9B8mSEv5ECPGPKCWWQ/W3CAsPihzjEgjvzy0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1705682199193680.258313674953; Fri, 19 Jan 2024 08:36:39 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rQrpx-0000n8-QJ; Fri, 19 Jan 2024 11:35:21 -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 1rQrpw-0000lh-8P for qemu-devel@nongnu.org; Fri, 19 Jan 2024 11:35:20 -0500 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rQrpu-0004mY-9T for qemu-devel@nongnu.org; Fri, 19 Jan 2024 11:35:19 -0500 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-40e72a567eeso10739735e9.0 for ; Fri, 19 Jan 2024 08:35:17 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id fc11-20020a05600c524b00b0040e86fbd772sm10979260wmb.38.2024.01.19.08.35.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Jan 2024 08:35:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1705682117; x=1706286917; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=tyBXToJHpERthhZrSNsFcfkP84TYfgOcTgP/HWJh+Ms=; b=n2pa5JkGq8zjQAqJNCk1joHUQtV+jYa76KV3WW/EJ8L1UlYF/QE21DlWbGuaPaexHR wz7b9mL7jN5gvR7X/vgSuns5bEfvj3P3mlg1qs0pf+4HMnJg/oCLKilwO6q24+WRRdIQ YUTxdlxS/oPv5RZQk06CC2p4YLnIRSKYnBqs1J1x8mfRfVwXMlODr6viU+80m50vyV0Z E4Hm2+oPzhf9oorb4NvWFf5eXHY5iNwcF4/aPgpCHM3Zrp9OtBSvImlJI2Cw5PrayKKV pgU0a9iNWQtNuCyJZ+z2icO1m2hCpJbxb5S/SFFL62MpwLZkwBuaSq/IyaaT7vwBBJza Z2fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705682117; x=1706286917; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tyBXToJHpERthhZrSNsFcfkP84TYfgOcTgP/HWJh+Ms=; b=XR9eg/8tARFM8WLj6Ve0dUvMUE5FYvDQ1gI/6nyVCmL/QPqtluymFWaYXaUc/hsTV1 ZCCztGN73qoQlNDIGAOneg2Dzb/0x53p+jQFYPjH/qGa80/winjcmI3eog0XG6Tc58FN 9wkSqN3HDkwHZKEm5ib5e2xMUPcGe/BAQBD1J+pJ4vKp0SdXlV2iRUW9iWeoPPsR3Anl KOEmBEIzbdakx1JSmdJCeReVV9lMGm0tJMH9i9nkUs0Qxvt4eMATcnKAfPPcb4ioH/mG nD+s3OGhVozHwTMUsqQsmQIXNIFSW7WgxUXnpXNN4Kfo8xl6/TwO2kopTmTAp5uhgnAN 0RRw== X-Gm-Message-State: AOJu0Ywr+hgiShxmmCH6SO7tRxGt3KbuD9I3QtSKzgc/qNfUMAeWslqX n8/aqSAf+1VQMNxDKPlRFifM4wDip3kvVBjtceFxbttWhgXTUa2lysamYF2stxoMFODIDcgneyS P X-Google-Smtp-Source: AGHT+IH3a+tlM5QPbqyDtWEfGdrAH79HECjArr30S2qR6lnNedKtNWuRgVMQbAGHW2puUtaR6AFVwA== X-Received: by 2002:a05:600c:29a:b0:40e:586b:e980 with SMTP id 26-20020a05600c029a00b0040e586be980mr6365wmk.271.1705682116910; Fri, 19 Jan 2024 08:35:16 -0800 (PST) From: Peter Maydell To: qemu-devel@nongnu.org Cc: "Maciej S. Szmigiero" , Mark Cave-Ayland , "Michael S. Tsirkin" , Marcel Apfelbaum , Halil Pasic , Christian Borntraeger , Eric Farman , Peter Xu , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 5/5] hw/core: Remove transitional infrastructure from BusClass Date: Fri, 19 Jan 2024 16:35:12 +0000 Message-Id: <20240119163512.3810301-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240119163512.3810301-1-peter.maydell@linaro.org> References: <20240119163512.3810301-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2a00:1450:4864:20::331; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x331.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, T_SCC_BODY_TEXT_LINE=-0.01 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+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1705682200234100005 Content-Type: text/plain; charset="utf-8" BusClass currently has transitional infrastructure to support subclasses which implement the legacy BusClass::reset method rather than the Resettable interface. We have now removed all the users of BusClass::reset in the tree, so we can remove the transitional infrastructure. Signed-off-by: Peter Maydell Acked-by: C=C3=A9dric Le Goater Acked-by: Michael S. Tsirkin Reviewed-by: Zhao Liu Tested-by: C=C3=A9dric Le Goater --- include/hw/qdev-core.h | 2 -- hw/core/bus.c | 67 ------------------------------------------ 2 files changed, 69 deletions(-) diff --git a/include/hw/qdev-core.h b/include/hw/qdev-core.h index 151d9682380..986c924fa55 100644 --- a/include/hw/qdev-core.h +++ b/include/hw/qdev-core.h @@ -329,8 +329,6 @@ struct BusClass { */ char *(*get_fw_dev_path)(DeviceState *dev); =20 - void (*reset)(BusState *bus); - /* * Return whether the device can be added to @bus, * based on the address that was set (via device properties) diff --git a/hw/core/bus.c b/hw/core/bus.c index c7831b5293b..b9d89495cdf 100644 --- a/hw/core/bus.c +++ b/hw/core/bus.c @@ -232,57 +232,6 @@ static char *default_bus_get_fw_dev_path(DeviceState *= dev) return g_strdup(object_get_typename(OBJECT(dev))); } =20 -/** - * bus_phases_reset: - * Transition reset method for buses to allow moving - * smoothly from legacy reset method to multi-phases - */ -static void bus_phases_reset(BusState *bus) -{ - ResettableClass *rc =3D RESETTABLE_GET_CLASS(bus); - - if (rc->phases.enter) { - rc->phases.enter(OBJECT(bus), RESET_TYPE_COLD); - } - if (rc->phases.hold) { - rc->phases.hold(OBJECT(bus)); - } - if (rc->phases.exit) { - rc->phases.exit(OBJECT(bus)); - } -} - -static void bus_transitional_reset(Object *obj) -{ - BusClass *bc =3D BUS_GET_CLASS(obj); - - /* - * This will call either @bus_phases_reset (for multi-phases transitio= ned - * buses) or a bus's specific method for not-yet transitioned buses. - * In both case, it does not reset children. - */ - if (bc->reset) { - bc->reset(BUS(obj)); - } -} - -/** - * bus_get_transitional_reset: - * check if the bus's class is ready for multi-phase - */ -static ResettableTrFunction bus_get_transitional_reset(Object *obj) -{ - BusClass *dc =3D BUS_GET_CLASS(obj); - if (dc->reset !=3D bus_phases_reset) { - /* - * dc->reset has been overridden by a subclass, - * the bus is not ready for multi phase yet. - */ - return bus_transitional_reset; - } - return NULL; -} - static void bus_class_init(ObjectClass *class, void *data) { BusClass *bc =3D BUS_CLASS(class); @@ -293,22 +242,6 @@ static void bus_class_init(ObjectClass *class, void *d= ata) =20 rc->get_state =3D bus_get_reset_state; rc->child_foreach =3D bus_reset_child_foreach; - - /* - * @bus_phases_reset is put as the default reset method below, allowing - * to do the multi-phase transition from base classes to leaf classes.= It - * allows a legacy-reset Bus class to extend a multi-phases-reset - * Bus class for the following reason: - * + If a base class B has been moved to multi-phase, then it does not - * override this default reset method and may have defined phase met= hods. - * + A child class C (extending class B) which uses - * bus_class_set_parent_reset() (or similar means) to override the - * reset method will still work as expected. @bus_phases_reset funct= ion - * will be registered as the parent reset method and effectively call - * parent reset phases. - */ - bc->reset =3D bus_phases_reset; - rc->get_transitional_function =3D bus_get_transitional_reset; } =20 static void qbus_finalize(Object *obj) --=20 2.34.1