* [PATCH] powernv/npu-dma.c: Remove spurious WARN_ON when a PCI device has no of_node
@ 2017-06-14 4:47 Alistair Popple
2017-06-15 1:52 ` Alexey Kardashevskiy
2017-06-15 22:50 ` Michael Ellerman
0 siblings, 2 replies; 3+ messages in thread
From: Alistair Popple @ 2017-06-14 4:47 UTC (permalink / raw)
To: linuxppc-dev; +Cc: paulus, Alistair Popple
"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.
Signed-off-by: Alistair Popple <alistair@popple.id.au>
Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
---
arch/powerpc/platforms/powernv/npu-dma.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c
index 78fa939..e6f444b 100644
--- a/arch/powerpc/platforms/powernv/npu-dma.c
+++ b/arch/powerpc/platforms/powernv/npu-dma.c
@@ -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 */
--
2.1.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] powernv/npu-dma.c: Remove spurious WARN_ON when a PCI device has no of_node
2017-06-14 4:47 [PATCH] powernv/npu-dma.c: Remove spurious WARN_ON when a PCI device has no of_node Alistair Popple
@ 2017-06-15 1:52 ` Alexey Kardashevskiy
2017-06-15 22:50 ` Michael Ellerman
1 sibling, 0 replies; 3+ messages in thread
From: Alexey Kardashevskiy @ 2017-06-15 1:52 UTC (permalink / raw)
To: Alistair Popple, linuxppc-dev; +Cc: paulus
On 14/06/17 14:47, Alistair Popple wrote:
> "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.
>
> Signed-off-by: Alistair Popple <alistair@popple.id.au>
> Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
> ---
> arch/powerpc/platforms/powernv/npu-dma.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c
> index 78fa939..e6f444b 100644
> --- a/arch/powerpc/platforms/powernv/npu-dma.c
> +++ b/arch/powerpc/platforms/powernv/npu-dma.c
> @@ -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 */
>
--
Alexey
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: powernv/npu-dma.c: Remove spurious WARN_ON when a PCI device has no of_node
2017-06-14 4:47 [PATCH] powernv/npu-dma.c: Remove spurious WARN_ON when a PCI device has no of_node Alistair Popple
2017-06-15 1:52 ` Alexey Kardashevskiy
@ 2017-06-15 22:50 ` Michael Ellerman
1 sibling, 0 replies; 3+ messages in thread
From: Michael Ellerman @ 2017-06-15 22:50 UTC (permalink / raw)
To: Alistair Popple, linuxppc-dev; +Cc: Alistair Popple, paulus
On Wed, 2017-06-14 at 04:47:50 UTC, Alistair Popple wrote:
> "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.
>
> Signed-off-by: Alistair Popple <alistair@popple.id.au>
> Reported-by: Alexey Kardashevskiy <aik@ozlabs.ru>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/377aa6b0efbaa29cfeecd8b9244641
cheers
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-06-15 22:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-06-14 4:47 [PATCH] powernv/npu-dma.c: Remove spurious WARN_ON when a PCI device has no of_node Alistair Popple
2017-06-15 1:52 ` Alexey Kardashevskiy
2017-06-15 22:50 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).