From: Zhao Liu <zhao1.liu@intel.com>
To: Peter Maydell <peter.maydell@linaro.org>
Cc: qemu-devel@nongnu.org,
"Maciej S. Szmigiero" <maciej.szmigiero@oracle.com>,
"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Halil Pasic" <pasic@linux.ibm.com>,
"Christian Borntraeger" <borntraeger@linux.ibm.com>,
"Eric Farman" <farman@linux.ibm.com>,
"Peter Xu" <peterx@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>
Subject: Re: [PATCH 1/5] pci: Switch bus reset to 3-phase-reset
Date: Wed, 31 Jan 2024 11:52:45 +0800 [thread overview]
Message-ID: <ZbnEDTH2IP4xKNFx@intel.com> (raw)
In-Reply-To: <20240119163512.3810301-2-peter.maydell@linaro.org>
On Fri, Jan 19, 2024 at 04:35:08PM +0000, Peter Maydell wrote:
> Date: Fri, 19 Jan 2024 16:35:08 +0000
> From: Peter Maydell <peter.maydell@linaro.org>
> Subject: [PATCH 1/5] pci: Switch bus reset to 3-phase-reset
> X-Mailer: git-send-email 2.34.1
>
> 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 <peter.maydell@linaro.org>
> ---
> hw/pci/pci.c | 10 ++++++----
> 1 file changed, 6 insertions(+), 4 deletions(-)
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
>
> 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 = true;
>
> 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);
>
> static Property pci_props[] = {
> @@ -202,13 +202,15 @@ static void pci_bus_class_init(ObjectClass *klass, void *data)
> {
> BusClass *k = BUS_CLASS(klass);
> PCIBusClass *pbc = PCI_BUS_CLASS(klass);
> + ResettableClass *rc = RESETTABLE_CLASS(klass);
>
> k->print_dev = pcibus_dev_print;
> k->get_dev_path = pcibus_get_dev_path;
> k->get_fw_dev_path = pcibus_get_fw_dev_path;
> k->realize = pci_bus_realize;
> k->unrealize = pci_bus_unrealize;
> - k->reset = pcibus_reset;
> +
> + rc->phases.hold = pcibus_reset_hold;
>
> pbc->bus_num = pcibus_num;
> pbc->numa_node = 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 = DO_UPCAST(PCIBus, qbus, qbus);
> + PCIBus *bus = PCI_BUS(obj);
> int i;
>
> for (i = 0; i < ARRAY_SIZE(bus->devices); ++i) {
> --
> 2.34.1
>
>
next prev parent reply other threads:[~2024-01-31 3:40 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-19 16:35 [PATCH 0/5] buses: switch to 3-phase-reset Peter Maydell
2024-01-19 16:35 ` [PATCH 1/5] pci: Switch bus reset " Peter Maydell
2024-01-31 3:52 ` Zhao Liu [this message]
2024-01-19 16:35 ` [PATCH 2/5] vmbus: " Peter Maydell
2024-01-22 14:30 ` Maciej S. Szmigiero
2024-01-31 3:53 ` Zhao Liu
2024-01-19 16:35 ` [PATCH 3/5] adb: " Peter Maydell
2024-01-29 21:42 ` Mark Cave-Ayland
2024-01-31 3:53 ` Zhao Liu
2024-01-19 16:35 ` [PATCH 4/5] hw/s390x/css-bridge: switch virtual-css bus " Peter Maydell
2024-01-22 9:18 ` Halil Pasic
2024-01-22 21:49 ` Eric Farman
2024-01-31 3:54 ` Zhao Liu
2024-01-19 16:35 ` [PATCH 5/5] hw/core: Remove transitional infrastructure from BusClass Peter Maydell
2024-01-31 3:58 ` Zhao Liu
2024-02-01 13:31 ` Peter Maydell
2024-01-21 11:37 ` [PATCH 0/5] buses: switch to 3-phase-reset Michael S. Tsirkin
2024-01-22 2:06 ` Peter Xu
2024-01-22 14:19 ` Cédric Le Goater
2024-01-31 17:36 ` Cédric Le Goater
2024-02-01 13:20 ` Peter Maydell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZbnEDTH2IP4xKNFx@intel.com \
--to=zhao1.liu@intel.com \
--cc=borntraeger@linux.ibm.com \
--cc=farman@linux.ibm.com \
--cc=maciej.szmigiero@oracle.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mark.cave-ayland@ilande.co.uk \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).