linux-ide.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ATA: SATA_MV: Fix probe failure when no phy exists
@ 2014-01-30 20:50 Andrew Lunn
  2014-01-30 22:12 ` Ezequiel Garcia
  0 siblings, 1 reply; 11+ messages in thread
From: Andrew Lunn @ 2014-01-30 20:50 UTC (permalink / raw)
  To: tj; +Cc: linux-ide, Andrew Lunn

Armada 370 and XP do not have a SATA phy driver.  The generic phy
layer does not cleanly support optional phys. It is not possible to
determine from the error code if there is expected to be a phy
according to DT, but it cannot be found, or no phy is listed in
DT. All that can be determined is that a phy is expected, but the
driver has not been loaded yet, in which case -EPROBE_DEFER is
returned. Thus for 370 and XP the driver failed to probe.  Play safe,
consider all errors except -EPROBE_DEFER to be none fatal and keep
going, and in the case of -EPROBE_DEFER exit the probe function with
that error code.

Tested on Kirkwood with a sata phy driver and on 370 without a sata
phy driver.

Reported-by: Jean Pihet <jean.pihet@linaro.org>
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Tested-by: Gregory Clement <gregory.clement@free-electrons.com>
---
 drivers/ata/sata_mv.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c
index eaa21eddbe70..148ff5a82c8b 100644
--- a/drivers/ata/sata_mv.c
+++ b/drivers/ata/sata_mv.c
@@ -4115,9 +4115,8 @@ static int mv_platform_probe(struct platform_device *pdev)
 		if (IS_ERR(hpriv->port_phys[port])) {
 			rc = PTR_ERR(hpriv->port_phys[port]);
 			hpriv->port_phys[port] = NULL;
-			if ((rc != -EPROBE_DEFER) && (rc != -ENODEV))
-				dev_warn(&pdev->dev, "error getting phy");
-			goto err;
+			if (rc == -EPROBE_DEFER)
+				goto err;
 		} else
 			phy_power_on(hpriv->port_phys[port]);
 	}
-- 
1.8.5.2


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

end of thread, other threads:[~2014-02-03 18:43 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-30 20:50 [PATCH] ATA: SATA_MV: Fix probe failure when no phy exists Andrew Lunn
2014-01-30 22:12 ` Ezequiel Garcia
2014-01-31 10:54   ` Andrew Lunn
2014-01-31 11:04     ` Tejun Heo
2014-01-31 11:46       ` Andrew Lunn
2014-01-31 11:48         ` Tejun Heo
2014-02-03 15:32     ` Gregory CLEMENT
2014-02-03 16:50       ` Jason Cooper
2014-02-03 17:27         ` Gregory CLEMENT
2014-02-03 17:32         ` Tejun Heo
2014-02-03 18:43           ` Jason Cooper

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