Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drivers/vfio: Enable VFIO if EEH is not supported

The existing vfio_pci_open() fails upon error returned from
vfio_spapr_pci_eeh_open(), which breaks POWER7's P5IOC2 PHB
support which this patch brings back.

The patch fixes the issue by dropping the return value of
vfio_spapr_pci_eeh_open().

Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>

authored by

Alexey Kardashevskiy and committed by
Alex Williamson
9b936c96 89a2edd6

+5 -10
+1 -5
drivers/vfio/pci/vfio_pci.c
··· 200 200 if (ret) 201 201 goto error; 202 202 203 - ret = vfio_spapr_pci_eeh_open(vdev->pdev); 204 - if (ret) { 205 - vfio_pci_disable(vdev); 206 - goto error; 207 - } 203 + vfio_spapr_pci_eeh_open(vdev->pdev); 208 204 } 209 205 vdev->refcnt++; 210 206 error:
+2 -2
drivers/vfio/vfio_spapr_eeh.c
··· 19 19 #define DRIVER_DESC "VFIO IOMMU SPAPR EEH" 20 20 21 21 /* We might build address mapping here for "fast" path later */ 22 - int vfio_spapr_pci_eeh_open(struct pci_dev *pdev) 22 + void vfio_spapr_pci_eeh_open(struct pci_dev *pdev) 23 23 { 24 - return eeh_dev_open(pdev); 24 + eeh_dev_open(pdev); 25 25 } 26 26 EXPORT_SYMBOL_GPL(vfio_spapr_pci_eeh_open); 27 27
+2 -3
include/linux/vfio.h
··· 100 100 101 101 struct pci_dev; 102 102 #ifdef CONFIG_EEH 103 - extern int vfio_spapr_pci_eeh_open(struct pci_dev *pdev); 103 + extern void vfio_spapr_pci_eeh_open(struct pci_dev *pdev); 104 104 extern void vfio_spapr_pci_eeh_release(struct pci_dev *pdev); 105 105 extern long vfio_spapr_iommu_eeh_ioctl(struct iommu_group *group, 106 106 unsigned int cmd, 107 107 unsigned long arg); 108 108 #else 109 - static inline int vfio_spapr_pci_eeh_open(struct pci_dev *pdev) 109 + static inline void vfio_spapr_pci_eeh_open(struct pci_dev *pdev) 110 110 { 111 - return 0; 112 111 } 113 112 114 113 static inline void vfio_spapr_pci_eeh_release(struct pci_dev *pdev)