Skip to content

Commit

Permalink
powerpc/npu-dma: Remove spurious WARN_ON when a PCI device has no of_…
Browse files Browse the repository at this point in the history
…node

Commit 4c3b89e ("powerpc/powernv: Add sanity checks to
pnv_pci_get_{gpu|npu}_dev") introduced explicit warnings in
pnv_pci_get_npu_dev() when a PCIe device has no associated device-tree
node. However not all PCIe devices have an of_node and
pnv_pci_get_npu_dev() gets indirectly called at least once for every
PCIe device in the system. This results in spurious WARN_ON()'s so
remove it.

The same situation should not exist for pnv_pci_get_gpu_dev() as any
NPU based PCIe device requires a device-tree node.

Fixes: 4c3b89e ("powerpc/powernv: Add sanity checks to pnv_pci_get_{gpu|npu}_dev")
Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Alistair Popple authored and Michael Ellerman committed Jun 14, 2017
1 parent c6ee961 commit 377aa6b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/powerpc/platforms/powernv/npu-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ struct pci_dev *pnv_pci_get_npu_dev(struct pci_dev *gpdev, int index)
if (WARN_ON(!gpdev))
return NULL;

if (WARN_ON(!gpdev->dev.of_node))
/* Not all PCI devices have device-tree nodes */
if (!gpdev->dev.of_node)
return NULL;

/* Get assoicated PCI device */
Expand Down

0 comments on commit 377aa6b

Please sign in to comment.