From: Matthew Rosato <mjrosato@linux.ibm.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: qemu-s390x@nongnu.org, Eric Farman <farman@linux.ibm.com>
Subject: Re: [PATCH] hw/s390x/s390-pci-inst.c: Use device_cold_reset() to reset PCI devices
Date: Thu, 13 Oct 2022 14:36:41 -0400 [thread overview]
Message-ID: <906b6fdc-5b09-8cb6-cd6b-4b11317bd6ee@linux.ibm.com> (raw)
In-Reply-To: <20221013172123.1448288-1-peter.maydell@linaro.org>
On 10/13/22 1:21 PM, Peter Maydell wrote:
> The semantic difference between the deprecated device_legacy_reset()
> function and the newer device_cold_reset() function is that the new
> function resets both the device itself and any qbuses it owns,
> whereas the legacy function resets just the device itself and nothing
> else.
>
> In s390-pci-inst.c we use device_legacy_reset() to reset an
> S390PCIBusDevice. This device doesn't have any child qbuses, so the
> functions do the same thing and we can stop using the deprecated one.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> NB: tested only with 'make check' and 'make check-avocado', which
> probably don't exercise this codepath.
>
I exercised the codepath by triggering the associated clp using both virtio and vfio pci devices on s390x; looks good to me.
Reviewed-by: Matthew Rosato <mjrosato@linux.ibm.com>
> hw/s390x/s390-pci-inst.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/hw/s390x/s390-pci-inst.c b/hw/s390x/s390-pci-inst.c
> index 20a9bcc7afb..16f5a3e81b4 100644
> --- a/hw/s390x/s390-pci-inst.c
> +++ b/hw/s390x/s390-pci-inst.c
> @@ -272,7 +272,7 @@ int clp_service_call(S390CPU *cpu, uint8_t r2, uintptr_t ra)
> stw_p(&ressetpci->hdr.rsp, CLP_RC_SETPCIFN_FHOP);
> goto out;
> }
> - device_legacy_reset(DEVICE(pbdev));
> + device_cold_reset(DEVICE(pbdev));
> pbdev->fh &= ~FH_MASK_ENABLE;
> pbdev->state = ZPCI_FS_DISABLED;
> stl_p(&ressetpci->fh, pbdev->fh);
prev parent reply other threads:[~2022-10-13 18:39 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-13 17:21 [PATCH] hw/s390x/s390-pci-inst.c: Use device_cold_reset() to reset PCI devices Peter Maydell
2022-10-13 18:36 ` Matthew Rosato [this message]
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=906b6fdc-5b09-8cb6-cd6b-4b11317bd6ee@linux.ibm.com \
--to=mjrosato@linux.ibm.com \
--cc=farman@linux.ibm.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@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).