Commit d33bec7b authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost

Pull virtio/vdpa fixes from Michael Tsirkin:
 "Fixes up some issues in rc1"

* tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
  vdpa: potential uninitialized return in vhost_vdpa_va_map()
  vdpa/mlx5: Avoid executing set_vq_ready() if device is reset
  vdpa/mlx5: Clear ready indication for control VQ
  vduse: Cleanup the old kernel states after reset failure
  vduse: missing error code in vduse_init()
  virtio: don't fail on !of_device_is_compatible
parents 0c72b292 be9c6bad
...@@ -1714,6 +1714,9 @@ static void mlx5_vdpa_set_vq_ready(struct vdpa_device *vdev, u16 idx, bool ready ...@@ -1714,6 +1714,9 @@ static void mlx5_vdpa_set_vq_ready(struct vdpa_device *vdev, u16 idx, bool ready
struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev); struct mlx5_vdpa_net *ndev = to_mlx5_vdpa_ndev(mvdev);
struct mlx5_vdpa_virtqueue *mvq; struct mlx5_vdpa_virtqueue *mvq;
if (!mvdev->actual_features)
return;
if (!is_index_valid(mvdev, idx)) if (!is_index_valid(mvdev, idx))
return; return;
...@@ -2145,6 +2148,8 @@ static void clear_vqs_ready(struct mlx5_vdpa_net *ndev) ...@@ -2145,6 +2148,8 @@ static void clear_vqs_ready(struct mlx5_vdpa_net *ndev)
for (i = 0; i < ndev->mvdev.max_vqs; i++) for (i = 0; i < ndev->mvdev.max_vqs; i++)
ndev->vqs[i].ready = false; ndev->vqs[i].ready = false;
ndev->mvdev.cvq.ready = false;
} }
static void mlx5_vdpa_set_status(struct vdpa_device *vdev, u8 status) static void mlx5_vdpa_set_status(struct vdpa_device *vdev, u8 status)
......
...@@ -665,13 +665,11 @@ static void vduse_vdpa_set_config(struct vdpa_device *vdpa, unsigned int offset, ...@@ -665,13 +665,11 @@ static void vduse_vdpa_set_config(struct vdpa_device *vdpa, unsigned int offset,
static int vduse_vdpa_reset(struct vdpa_device *vdpa) static int vduse_vdpa_reset(struct vdpa_device *vdpa)
{ {
struct vduse_dev *dev = vdpa_to_vduse(vdpa); struct vduse_dev *dev = vdpa_to_vduse(vdpa);
int ret = vduse_dev_set_status(dev, 0);
if (vduse_dev_set_status(dev, 0))
return -EIO;
vduse_dev_reset(dev); vduse_dev_reset(dev);
return 0; return ret;
} }
static u32 vduse_vdpa_get_generation(struct vdpa_device *vdpa) static u32 vduse_vdpa_get_generation(struct vdpa_device *vdpa)
...@@ -1593,8 +1591,10 @@ static int vduse_init(void) ...@@ -1593,8 +1591,10 @@ static int vduse_init(void)
vduse_irq_wq = alloc_workqueue("vduse-irq", vduse_irq_wq = alloc_workqueue("vduse-irq",
WQ_HIGHPRI | WQ_SYSFS | WQ_UNBOUND, 0); WQ_HIGHPRI | WQ_SYSFS | WQ_UNBOUND, 0);
if (!vduse_irq_wq) if (!vduse_irq_wq) {
ret = -ENOMEM;
goto err_wq; goto err_wq;
}
ret = vduse_domain_init(); ret = vduse_domain_init();
if (ret) if (ret)
......
...@@ -640,7 +640,7 @@ static int vhost_vdpa_va_map(struct vhost_vdpa *v, ...@@ -640,7 +640,7 @@ static int vhost_vdpa_va_map(struct vhost_vdpa *v,
u64 offset, map_size, map_iova = iova; u64 offset, map_size, map_iova = iova;
struct vdpa_map_file *map_file; struct vdpa_map_file *map_file;
struct vm_area_struct *vma; struct vm_area_struct *vma;
int ret; int ret = 0;
mmap_read_lock(dev->mm); mmap_read_lock(dev->mm);
......
...@@ -345,8 +345,13 @@ static int virtio_device_of_init(struct virtio_device *dev) ...@@ -345,8 +345,13 @@ static int virtio_device_of_init(struct virtio_device *dev)
ret = snprintf(compat, sizeof(compat), "virtio,device%x", dev->id.device); ret = snprintf(compat, sizeof(compat), "virtio,device%x", dev->id.device);
BUG_ON(ret >= sizeof(compat)); BUG_ON(ret >= sizeof(compat));
/*
* On powerpc/pseries virtio devices are PCI devices so PCI
* vendor/device ids play the role of the "compatible" property.
* Simply don't init of_node in this case.
*/
if (!of_device_is_compatible(np, compat)) { if (!of_device_is_compatible(np, compat)) {
ret = -EINVAL; ret = 0;
goto out; goto out;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment