ACK/cmnt: [SRU][Zesty][PATCH 1/1] powerpc/npu-dma: Remove spurious WARN_ON when a PCI device has no of_node

Stefan Bader stefan.bader at canonical.com
Wed Jul 12 14:11:19 UTC 2017


On 12.07.2017 15:47, Joseph Salisbury wrote:
> From: Alistair Popple <alistair at popple.id.au>
> 
> BugLink: http://bugs.launchpad.net/bugs/1702768
> 
> Commit 4c3b89effc28 ("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: 4c3b89effc28 ("powerpc/powernv: Add sanity checks to pnv_pci_get_{gpu|npu}_dev")
> Reported-by: Alexey Kardashevskiy <aik at ozlabs.ru>
> Signed-off-by: Alistair Popple <alistair at popple.id.au>
> Signed-off-by: Michael Ellerman <mpe at ellerman.id.au>
> (cherry picked from commit 377aa6b0efbaa29cfeecd8b9244641217f9544ca)
> Signed-off-by: Joseph Salisbury <joseph.salisbury at canonical.com>
Acked-by: Stefan Bader <stefan.bader at canonical.com>

> ---

SRU justification should be added to bug report. Otherwise ok.

-Stefan

>  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 3184c9e..c10ad16 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 */
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20170712/e645cc06/attachment.sig>


More information about the kernel-team mailing list