From: Angus Chen <angus.chen@jaguarmicro.com>
To: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
Cc: "virtualization@lists.linux-foundation.org"
<virtualization@lists.linux-foundation.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"mst@redhat.com" <mst@redhat.com>,
"jasowang@redhat.com" <jasowang@redhat.com>
Subject: RE: [PATCH] virtio_pci: Wait for legacy device to be reset
Date: Tue, 11 Apr 2023 06:37:21 +0000 [thread overview]
Message-ID: <TY2PR06MB3424EB45AB598371D41CC669859A9@TY2PR06MB3424.apcprd06.prod.outlook.com> (raw)
In-Reply-To: <1681180912.9817035-2-xuanzhuo@linux.alibaba.com>
> -----Original Message-----
> From: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
> Sent: Tuesday, April 11, 2023 10:42 AM
> To: Angus Chen <angus.chen@jaguarmicro.com>
> Cc: virtualization@lists.linux-foundation.org; linux-kernel@vger.kernel.org;
> Angus Chen <angus.chen@jaguarmicro.com>; mst@redhat.com;
> jasowang@redhat.com
> Subject: Re: [PATCH] virtio_pci: Wait for legacy device to be reset
>
> On Tue, 11 Apr 2023 09:38:32 +0800, Angus Chen
> <angus.chen@jaguarmicro.com> wrote:
> > We read the status of device after reset,
> > It is not guaranteed that the device be reseted successfully.
> > We can use a while loop to make sure that,like the modern device did.
> > The spec is not request it ,but it work.
> >
> > Signed-off-by: Angus Chen <angus.chen@jaguarmicro.com>
>
> LGTM
Thank you for you reply.
>
> Reviewed-by: Xuan Zhuo <xuanzhuo@linux.alibaba.com>
>
>
> > ---
> > drivers/virtio/virtio_pci_legacy.c | 4 +++-
> > 1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/virtio/virtio_pci_legacy.c b/drivers/virtio/virtio_pci_legacy.c
> > index 2257f1b3d8ae..f2d241563e4f 100644
> > --- a/drivers/virtio/virtio_pci_legacy.c
> > +++ b/drivers/virtio/virtio_pci_legacy.c
> > @@ -14,6 +14,7 @@
> > * Michael S. Tsirkin <mst@redhat.com>
> > */
> >
> > +#include <linux/delay.h>
> > #include "linux/virtio_pci_legacy.h"
> > #include "virtio_pci_common.h"
> >
> > @@ -97,7 +98,8 @@ static void vp_reset(struct virtio_device *vdev)
> > vp_legacy_set_status(&vp_dev->ldev, 0);
> > /* Flush out the status write, and flush in device writes,
> > * including MSi-X interrupts, if any. */
> > - vp_legacy_get_status(&vp_dev->ldev);
> > + while (vp_legacy_get_status(&vp_dev->ldev))
> > + msleep(1);
> > /* Flush pending VQ/configuration callbacks. */
> > vp_synchronize_vectors(vdev);
> > }
> > --
> > 2.25.1
> >
next prev parent reply other threads:[~2023-04-11 6:37 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-11 1:38 Angus Chen
2023-04-11 1:47 ` Angus Chen
2023-04-11 2:41 ` Xuan Zhuo
2023-04-11 6:37 ` Angus Chen [this message]
2023-04-11 5:24 ` Jason Wang
2023-04-11 6:36 ` Angus Chen
2023-04-11 6:39 ` Jason Wang
2023-04-11 6:44 ` Michael S. Tsirkin
2023-04-11 6:45 ` Angus Chen
2023-04-11 6:47 ` Michael S. Tsirkin
2023-04-11 6:49 ` Angus Chen
2023-04-11 6:55 ` Michael S. Tsirkin
2023-04-11 7:17 ` Angus Chen
2023-04-11 7:21 ` Michael S. Tsirkin
2023-04-11 7:30 ` Angus Chen
2023-04-11 10:15 ` Michael S. Tsirkin
2023-04-11 10:57 ` Angus Chen
2023-04-11 11:13 ` Michael S. Tsirkin
2023-04-11 12:10 ` Angus Chen
2023-04-11 6:29 ` Michael S. Tsirkin
2023-04-11 6:39 ` Angus Chen
2023-04-11 6:41 ` Michael S. Tsirkin
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=TY2PR06MB3424EB45AB598371D41CC669859A9@TY2PR06MB3424.apcprd06.prod.outlook.com \
--to=angus.chen@jaguarmicro.com \
--cc=jasowang@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mst@redhat.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=xuanzhuo@linux.alibaba.com \
/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
all inboxes | Powered by JetHome®