[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220613032529-mutt-send-email-mst@kernel.org>
Date: Mon, 13 Jun 2022 03:25:44 -0400
From: "Michael S. Tsirkin" <mst@...hat.com>
To: Jason Wang <jasowang@...hat.com>
Cc: Vincent Whitchurch <vincent.whitchurch@...s.com>,
Richard Weinberger <richard@....at>,
Anton Ivanov <anton.ivanov@...bridgegreys.com>,
Johannes Berg <johannes@...solutions.net>, kernel@...s.com,
Xuan Zhuo <xuanzhuo@...ux.alibaba.com>,
linux-um@...ts.infradead.org,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] um: virt-pci: set device ready in probe()
On Mon, Jun 13, 2022 at 02:58:40PM +0800, Jason Wang wrote:
> On Fri, Jun 10, 2022 at 11:12 PM Vincent Whitchurch
> <vincent.whitchurch@...s.com> wrote:
> >
> > Call virtio_device_ready() to make this driver work after commit
> > b4ec69d7e09 ("virtio: harden vring IRQ"), since the driver uses the
> > virtqueues in the probe function. (The virtio core sets the device
> > ready when probe returns.)
> >
> > Fixes: 8b4ec69d7e09 ("virtio: harden vring IRQ")
> > Signed-off-by: Vincent Whitchurch <vincent.whitchurch@...s.com>
> > ---
> > arch/um/drivers/virt-pci.c | 7 ++++++-
> > 1 file changed, 6 insertions(+), 1 deletion(-)
> >
> > diff --git a/arch/um/drivers/virt-pci.c b/arch/um/drivers/virt-pci.c
> > index 5c092a9153ea..027847023184 100644
> > --- a/arch/um/drivers/virt-pci.c
> > +++ b/arch/um/drivers/virt-pci.c
> > @@ -544,6 +544,8 @@ static int um_pci_init_vqs(struct um_pci_device *dev)
> > dev->cmd_vq = vqs[0];
> > dev->irq_vq = vqs[1];
> >
> > + virtio_device_ready(dev->vdev);
> > +
> > for (i = 0; i < NUM_IRQ_MSGS; i++) {
> > void *msg = kzalloc(MAX_IRQ_MSG_SIZE, GFP_KERNEL);
> >
> > @@ -587,7 +589,7 @@ static int um_pci_virtio_probe(struct virtio_device *vdev)
> > dev->irq = irq_alloc_desc(numa_node_id());
> > if (dev->irq < 0) {
> > err = dev->irq;
> > - goto error;
> > + goto err_reset;
> > }
> > um_pci_devices[free].dev = dev;
> > vdev->priv = dev;
> > @@ -604,6 +606,9 @@ static int um_pci_virtio_probe(struct virtio_device *vdev)
> >
> > um_pci_rescan();
> > return 0;
> > +err_reset:
> > + virtio_reset_device(vdev);
> > + vdev->config->del_vqs(vdev);
>
> This part seems to be an independent fix.
>
> Thanks
Yes good point. I merged as is, oh well.
> > error:
> > mutex_unlock(&um_pci_mtx);
> > kfree(dev);
> > --
> > 2.34.1
> >
Powered by blists - more mailing lists