LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Rob Herring <robh@kernel.org>
Cc: linuxarm@huawei.com, mauro.chehab@huawei.com,
	Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
	Bjorn Helgaas <bhelgaas@google.com>,
	linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org
Subject: [PATCH 3/3] PCI: of: Add some debug printks to track problems with of_node setup
Date: Thu,  5 Aug 2021 10:29:00 +0200	[thread overview]
Message-ID: <c4f873203f8811b8657fc4a01cd1410977e68b84.1628151761.git.mchehab+huawei@kernel.org> (raw)
In-Reply-To: <cover.1628151760.git.mchehab+huawei@kernel.org>

In order to be able to identify why some of_nodes are not created,
we need to add some debug prints.

Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
---
 drivers/pci/of.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/pci/of.c b/drivers/pci/of.c
index b6fa3bd46ae6..7b8c2b87eb25 100644
--- a/drivers/pci/of.c
+++ b/drivers/pci/of.c
@@ -18,6 +18,9 @@
 #ifdef CONFIG_PCI
 void pci_set_of_node(struct pci_dev *dev)
 {
+	dev_dbg(&dev->dev, "%s: of_node: %pOF\n",
+		__func__, dev->bus->dev.of_node);
+
 	if (!dev->bus->dev.of_node)
 		return;
 	dev->dev.of_node = of_pci_find_child_device(dev->bus->dev.of_node,
@@ -41,12 +44,16 @@ void pci_set_bus_of_node(struct pci_bus *bus)
 		node = pcibios_get_phb_of_node(bus);
 	} else {
 		node = of_node_get(bus->self->dev.of_node);
-		if (!node)
+		if (!node) {
 			node = of_node_get(bus->self->dev.parent->of_node);
+			dev_dbg(&bus->dev, "%s: use of_node of the parent",
+				__func__);
+		}
 		if (node && of_property_read_bool(node, "external-facing"))
 			bus->self->external_facing = true;
 	}
 
+	dev_dbg(&bus->dev, "%s: of_node: %pOF\n", __func__, node);
 	bus->dev.of_node = node;
 
 	if (bus->dev.of_node)
-- 
2.31.1


      parent reply	other threads:[~2021-08-05  8:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-05  8:28 [PATCH 0/3] Fix handling of multi-level OF nodes Mauro Carvalho Chehab
2021-08-05  8:28 ` [PATCH 1/3] PCI: of: Fix handling of multi-level PCI devices Mauro Carvalho Chehab
2021-08-06 22:52   ` Bjorn Helgaas
2021-08-05  8:28 ` [PATCH 2/3] PCI: of: Setup PCI before setting the OF node Mauro Carvalho Chehab
2021-08-05  8:29 ` Mauro Carvalho Chehab [this message]

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=c4f873203f8811b8657fc4a01cd1410977e68b84.1628151761.git.mchehab+huawei@kernel.org \
    --to=mchehab+huawei@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mauro.chehab@huawei.com \
    --cc=robh@kernel.org \
    --subject='Re: [PATCH 3/3] PCI: of: Add some debug printks to track problems with of_node setup' \
    /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

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).