All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/5] PCI: exynos: Properly handle optional PHYs
@ 2019-08-28 16:36 Thierry Reding
  2019-08-28 16:36 ` [PATCH 2/5] PCI: imx6: Properly handle optional regulators Thierry Reding
                   ` (5 more replies)
  0 siblings, 6 replies; 24+ messages in thread
From: Thierry Reding @ 2019-08-28 16:36 UTC (permalink / raw)
  To: Lorenzo Pieralisi, Bjorn Helgaas
  Cc: Andrew Murray, linux-pci, Jingoo Han, Kukjin Kim, Krzysztof Kozlowski

From: Thierry Reding <treding@nvidia.com>

devm_of_phy_get() can fail for a number of resides besides probe
deferral. It can for example return -ENOMEM if it runs out of memory as
it tries to allocate devres structures. Propagating only -EPROBE_DEFER
is problematic because it results in these legitimately fatal errors
being treated as "PHY not specified in DT".

What we really want is to ignore the optional PHYs only if they have not
been specified in DT. devm_of_phy_get() returns -ENODEV in this case, so
that's the special case that we need to handle. So we propagate all
errors, except -ENODEV, so that real failures will still cause the
driver to fail probe.

Cc: Jingoo Han <jingoohan1@gmail.com>
Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
---
 drivers/pci/controller/dwc/pci-exynos.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/pci/controller/dwc/pci-exynos.c b/drivers/pci/controller/dwc/pci-exynos.c
index cee5f2f590e2..14a6ba4067fb 100644
--- a/drivers/pci/controller/dwc/pci-exynos.c
+++ b/drivers/pci/controller/dwc/pci-exynos.c
@@ -465,7 +465,7 @@ static int __init exynos_pcie_probe(struct platform_device *pdev)
 
 	ep->phy = devm_of_phy_get(dev, np, NULL);
 	if (IS_ERR(ep->phy)) {
-		if (PTR_ERR(ep->phy) == -EPROBE_DEFER)
+		if (PTR_ERR(ep->phy) != -ENODEV)
 			return PTR_ERR(ep->phy);
 
 		ep->phy = NULL;
-- 
2.22.0


^ permalink raw reply related	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2019-08-29 17:55 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-28 16:36 [PATCH 1/5] PCI: exynos: Properly handle optional PHYs Thierry Reding
2019-08-28 16:36 ` [PATCH 2/5] PCI: imx6: Properly handle optional regulators Thierry Reding
2019-08-28 21:09   ` Andrew Murray
2019-08-28 16:36 ` [PATCH 3/5] PCI: armada8x: Properly handle optional PHYs Thierry Reding
2019-08-28 21:09   ` Andrew Murray
2019-08-28 16:36 ` [PATCH 4/5] PCI: histb: Properly handle optional regulators Thierry Reding
2019-08-28 21:09   ` Andrew Murray
2019-08-28 16:36 ` [PATCH 5/5] PCI: iproc: Properly handle optional PHYs Thierry Reding
2019-08-28 21:26   ` Andrew Murray
2019-08-28 21:49     ` Mark Brown
2019-08-29 10:09       ` Andrew Murray
2019-08-29 10:48         ` Thierry Reding
2019-08-29 12:13           ` Andrew Murray
2019-08-29 11:17         ` Mark Brown
2019-08-29 11:46           ` Thierry Reding
2019-08-29 12:08             ` Andrew Murray
2019-08-29 13:16               ` Mark Brown
2019-08-29 13:43                 ` Andrew Murray
2019-08-29 15:25                   ` Mark Brown
2019-08-29 13:03             ` Mark Brown
2019-08-29 14:58               ` Thierry Reding
2019-08-29 17:55                 ` Mark Brown
2019-08-28 17:54 ` [PATCH 1/5] PCI: exynos: " Bjorn Helgaas
2019-08-28 21:08 ` Andrew Murray

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.