Skip to content

Commit 00bc509

Browse files
Sam Bobroffawilliam
authored andcommitted
vfio-pci/nvlink2: Allow fallback to ibm,mmio-atsd[0]
Older versions of skiboot only provide a single value in the device tree property "ibm,mmio-atsd", even when multiple Address Translation Shoot Down (ATSD) registers are present. This prevents NVLink2 devices (other than the first) from being used with vfio-pci because vfio-pci expects to be able to assign a dedicated ATSD register to each NVLink2 device. However, ATSD registers can be shared among devices. This change allows vfio-pci to fall back to sharing the register at index 0 if necessary. Fixes: 7f92891 ("vfio_pci: Add NVIDIA GV100GL [Tesla V100 SXM2] subdriver") Signed-off-by: Sam Bobroff <[email protected]> Reviewed-by: Alexey Kardashevskiy <[email protected]> Signed-off-by: Alex Williamson <[email protected]>
1 parent 4821979 commit 00bc509

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

drivers/vfio/pci/vfio_pci_nvlink2.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,8 +422,14 @@ int vfio_pci_ibm_npu2_init(struct vfio_pci_device *vdev)
422422

423423
if (of_property_read_u64_index(hose->dn, "ibm,mmio-atsd", nvlink_index,
424424
&mmio_atsd)) {
425-
dev_warn(&vdev->pdev->dev, "No available ATSD found\n");
426-
mmio_atsd = 0;
425+
if (of_property_read_u64_index(hose->dn, "ibm,mmio-atsd", 0,
426+
&mmio_atsd)) {
427+
dev_warn(&vdev->pdev->dev, "No available ATSD found\n");
428+
mmio_atsd = 0;
429+
} else {
430+
dev_warn(&vdev->pdev->dev,
431+
"Using fallback ibm,mmio-atsd[0] for ATSD.\n");
432+
}
427433
}
428434

429435
if (of_property_read_u64(npu_node, "ibm,device-tgt-addr", &tgt)) {

0 commit comments

Comments
 (0)