Skip to contentSkip to conversation

PCI: imx6: Use dev_err_probe() when parsing Root Port nodes

PATCH In review Stefan Ghetu 3 participants 3 messages Nov 23

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 PCI: imx6: Use dev_err_probe() when parsing Root Port nodes

pci_host_common_parse_ports() returns -EPROBE_DEFER when the PERST# GPIO of a Root Port node is provided by a GPIO controller that has not probed yet, e.g. an I2C GPIO expander. imx_pcie_host_init() logs this at error level on every probe attempt:

imx6q-pcie 4c300000.pcie: Failed to parse Root Port nodes: -517

Probe deferral is expected and not an error, but these messages flood the kernel log during boot on boards like the i.MX95 19x19 EVK.

Use dev_err_probe() so that deferral is only recorded as the deferred probe reason, while other errors are still reported.

---
 drivers/pci/controller/dwc/pci-imx6.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/pci/controller/dwc/pci-imx6.c +3 -4
index 865438ffde879..2a7f09630d14c 100644
@@ -1395,10 +1395,9 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp)
 	if (bridge && list_empty(&bridge->ports)) {
 		/* Parse Root Port nodes if present */
 		ret = pci_host_common_parse_ports(dev, bridge);
-		if (ret) {
-			dev_err(dev, "Failed to parse Root Port nodes: %d\n", ret);
-			return ret;
-		}
+		if (ret)
+			return dev_err_probe(dev, ret,
+					     "Failed to parse Root Port nodes\n");
 
 		/* Fall back to legacy binding for DT backwards compatibility */
 		if (!imx_pcie_perst_found(bridge)) {

base-commit: 7bf2db752515a9020b310984ae3bce1089cfdf20

Signature · 1 line
2.53.0
#1 lore raw
Sashiko has reviewed this patch and found no issues.
Quoted 7 lines

pci_host_common_parse_ports() returns -EPROBE_DEFER when the PERST# GPIO of a Root Port node is provided by a GPIO controller that has not probed yet, e.g. an I2C GPIO expander. imx_pcie_host_init() logs this at error level on every probe attempt:

imx6q-pcie 4c300000.pcie: Failed to parse Root Port nodes: -517

Quoted 7 lines

Probe deferral is expected and not an error, but these messages flood the kernel log during boot on boards like the i.MX95 19x19 EVK.

Use dev_err_probe() so that deferral is only recorded as the deferred probe reason, while other errors are still reported.

Sashiko has reviewed this patch and found no issues.

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Stefan Ghetu
Quoted 7 lines · Stefan Ghetu

pci_host_common_parse_ports() returns -EPROBE_DEFER when the PERST# GPIO of a Root Port node is provided by a GPIO controller that has not probed yet, e.g. an I2C GPIO expander. imx_pcie_host_init() logs this at error level on every probe attempt:

imx6q-pcie 4c300000.pcie: Failed to parse Root Port nodes: -517

Quoted 8 lines

Probe deferral is expected and not an error, but these messages flood the kernel log during boot on boards like the i.MX95 19x19 EVK.

Use dev_err_probe() so that deferral is only recorded as the deferred probe reason, while other errors are still reported.

---

Quoted 27 lines
 drivers/pci/controller/dwc/pci-imx6.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/pci/controller/dwc/pci-imx6.c +3 -4
index 865438ffde879..2a7f09630d14c 100644
@@ -1395,10 +1395,9 @@ static int imx_pcie_host_init(struct dw_pcie_rp *pp)
 	if (bridge && list_empty(&bridge->ports)) {
 		/* Parse Root Port nodes if present */
 		ret = pci_host_common_parse_ports(dev, bridge);
-		if (ret) {
-			dev_err(dev, "Failed to parse Root Port nodes: %d\n", ret);
-			return ret;
-		}
+		if (ret)
+			return dev_err_probe(dev, ret,
+					     "Failed to parse Root Port nodes\n");
 
 		/* Fall back to legacy binding for DT backwards compatibility */
 		if (!imx_pcie_perst_found(bridge)) {

base-commit: 7bf2db752515a9020b310984ae3bce1089cfdf20 --
2.53.0