Skip to content

Commit 97f854b

Browse files
Wu Zongyongmstsirkin
authored andcommitted
vhost_vdpa: unset vq irq before freeing irq
Currently we unset vq irq after freeing irq and that will result in error messages: pi_update_irte: failed to update PI IRTE irq bypass consumer (token 000000005a07a12b) unregistration fails: -22 This patch solves this. Signed-off-by: Wu Zongyong <[email protected]> Link: https://lore.kernel.org/r/02637d38dcf4e4b836c5b3a65055fe92bf812b3b.1631687872.git.wuzongyong@linux.alibaba.com Signed-off-by: Michael S. Tsirkin <[email protected]> Acked-by: Jason Wang <[email protected]>
1 parent 2f9a174 commit 97f854b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/vhost/vdpa.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,10 @@ static long vhost_vdpa_set_status(struct vhost_vdpa *v, u8 __user *statusp)
173173
if (status != 0 && (ops->get_status(vdpa) & ~status) != 0)
174174
return -EINVAL;
175175

176+
if ((status_old & VIRTIO_CONFIG_S_DRIVER_OK) && !(status & VIRTIO_CONFIG_S_DRIVER_OK))
177+
for (i = 0; i < nvqs; i++)
178+
vhost_vdpa_unsetup_vq_irq(v, i);
179+
176180
if (status == 0) {
177181
ret = ops->reset(vdpa);
178182
if (ret)
@@ -184,10 +188,6 @@ static long vhost_vdpa_set_status(struct vhost_vdpa *v, u8 __user *statusp)
184188
for (i = 0; i < nvqs; i++)
185189
vhost_vdpa_setup_vq_irq(v, i);
186190

187-
if ((status_old & VIRTIO_CONFIG_S_DRIVER_OK) && !(status & VIRTIO_CONFIG_S_DRIVER_OK))
188-
for (i = 0; i < nvqs; i++)
189-
vhost_vdpa_unsetup_vq_irq(v, i);
190-
191191
return 0;
192192
}
193193

0 commit comments

Comments
 (0)