Skip to content

Commit

Permalink
Merge tag 'vfio-v5.6-rc1' of git://github.com/awilliam/linux-vfio
Browse files Browse the repository at this point in the history
Pull VFIO updates from Alex Williamson:

 - Fix nvlink error path (Alexey Kardashevskiy)

 - Update nvlink and spapr to use mmgrab() (Julia Lawall)

 - Update static declaration (Ben Dooks)

 - Annotate __iomem to fix sparse warnings (Ben Dooks)

* tag 'vfio-v5.6-rc1' of git://github.com/awilliam/linux-vfio:
  vfio: platform: fix __iomem in vfio_platform_amdxgbe.c
  vfio/mdev: make create attribute static
  vfio/spapr_tce: use mmgrab
  vfio: vfio_pci_nvlink2: use mmgrab
  vfio/spapr/nvlink2: Skip unpinning pages on error exit
  • Loading branch information
Linus Torvalds committed Feb 3, 2020
2 parents f4a6365 + 7b5372b commit a6d5f9d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion drivers/vfio/mdev/mdev_sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ static ssize_t create_store(struct kobject *kobj, struct device *dev,
return count;
}

MDEV_TYPE_ATTR_WO(create);
static MDEV_TYPE_ATTR_WO(create);

static void mdev_type_release(struct kobject *kobj)
{
Expand Down
8 changes: 5 additions & 3 deletions drivers/vfio/pci/vfio_pci_nvlink2.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,8 +97,10 @@ static void vfio_pci_nvgpu_release(struct vfio_pci_device *vdev,

/* If there were any mappings at all... */
if (data->mm) {
ret = mm_iommu_put(data->mm, data->mem);
WARN_ON(ret);
if (data->mem) {
ret = mm_iommu_put(data->mm, data->mem);
WARN_ON(ret);
}

mmdrop(data->mm);
}
Expand Down Expand Up @@ -159,7 +161,7 @@ static int vfio_pci_nvgpu_mmap(struct vfio_pci_device *vdev,
data->useraddr = vma->vm_start;
data->mm = current->mm;

atomic_inc(&data->mm->mm_count);
mmgrab(data->mm);
ret = (int) mm_iommu_newdev(data->mm, data->useraddr,
vma_pages(vma), data->gpu_hpa, &data->mem);

Expand Down
4 changes: 2 additions & 2 deletions drivers/vfio/platform/reset/vfio_platform_amdxgbe.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#define MDIO_AN_INT 0x8002
#define MDIO_AN_INTMASK 0x8001

static unsigned int xmdio_read(void *ioaddr, unsigned int mmd,
static unsigned int xmdio_read(void __iomem *ioaddr, unsigned int mmd,
unsigned int reg)
{
unsigned int mmd_address, value;
Expand All @@ -35,7 +35,7 @@ static unsigned int xmdio_read(void *ioaddr, unsigned int mmd,
return value;
}

static void xmdio_write(void *ioaddr, unsigned int mmd,
static void xmdio_write(void __iomem *ioaddr, unsigned int mmd,
unsigned int reg, unsigned int value)
{
unsigned int mmd_address;
Expand Down
2 changes: 1 addition & 1 deletion drivers/vfio/vfio_iommu_spapr_tce.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static long tce_iommu_mm_set(struct tce_container *container)
}
BUG_ON(!current->mm);
container->mm = current->mm;
atomic_inc(&container->mm->mm_count);
mmgrab(container->mm);

return 0;
}
Expand Down

0 comments on commit a6d5f9d

Please sign in to comment.