From: Alexey Kardashevskiy <aik@ozlabs.ru>
To: Alistair Popple <alistair@popple.id.au>, linuxppc-dev@ozlabs.org
Cc: paulus@samba.org
Subject: Re: [PATCH] powernv/npu-dma.c: Remove spurious WARN_ON when a PCI device has no of_node
Date: Thu, 15 Jun 2017 11:52:21 +1000 [thread overview]
Message-ID: <22ecf96f-1a09-df03-fa37-22ee878284a0@ozlabs.ru> (raw)
In-Reply-To: <1497415670-723-1-git-send-email-alistair@popple.id.au>
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
next prev parent reply other threads:[~2017-06-15 1:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
2017-06-15 22:50 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=22ecf96f-1a09-df03-fa37-22ee878284a0@ozlabs.ru \
--to=aik@ozlabs.ru \
--cc=alistair@popple.id.au \
--cc=linuxppc-dev@ozlabs.org \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).