From 25f2e830f2975ab0d8a6681d0cf8d0ea1ce2e3e1 Mon Sep 17 00:00:00 2001 From: Shawn Guo Date: Sat, 17 May 2014 20:46:01 +0800 Subject: [PATCH] ahci: imx: PLL clock needs 100us to settle down The commit e783c51 (ahci: imx: software workaround for phy reset issue in resume) calls imx_sata_phy_reset() to reset phy immediately after SATA MPLL is enabled. It seems working fine mostly, but fails in some case as below. ... ahci-imx 2200000.sata: failed to reset phy: -110 ahci-imx: probe of 2200000.sata failed with error -110 After talking to the designer, we learnt that when enabling i.MX6Q SATA MPLL, we need to wait 100us for it to settle down for safety. Add this required delay to fix above failure. Signed-off-by: Shawn Guo Tested-by: Fabio Estevam Signed-off-by: Tejun Heo (cherry picked from commit 3685f2516116c5f3b9d498d531955ad70216ad84) --- drivers/ata/ahci_imx.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c index ced8b1a4c267..3a901520c62b 100644 --- a/drivers/ata/ahci_imx.c +++ b/drivers/ata/ahci_imx.c @@ -258,6 +258,8 @@ static int imx_sata_enable(struct ahci_host_priv *hpriv) IMX6Q_GPR13_SATA_MPLL_CLK_EN, IMX6Q_GPR13_SATA_MPLL_CLK_EN); + usleep_range(100, 200); + ret = imx_sata_phy_reset(hpriv); if (ret) { dev_err(dev, "failed to reset phy: %d\n", ret); -- 2.39.2