diff options
author | Richard Zhu <r65037@freescale.com> | 2011-11-30 15:28:52 +0800 |
---|---|---|
committer | Richard Zhu <r65037@freescale.com> | 2011-11-30 15:28:52 +0800 |
commit | 10ac1466de8473eff10f4bc8a1df7993ba88b86a (patch) | |
tree | 6a5407f8daf620070bf70418a476a3d6e735d64f /arch/arm/mach-mx6/board-mx6q_arm2.c | |
parent | 7b9fa7a9241d6d968c74aa5b2f50887ea38c0101 (diff) |
ENGR00163510 MX6Q: AHCI: One brand 1T HDD can't pwr up properly
More time is required by one brand 1T HDD,
change the delay mechanism to fix it.
Signed-off-by: Richard Zhu <r65037@freescale.com>
Diffstat (limited to 'arch/arm/mach-mx6/board-mx6q_arm2.c')
-rw-r--r-- | arch/arm/mach-mx6/board-mx6q_arm2.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/arch/arm/mach-mx6/board-mx6q_arm2.c b/arch/arm/mach-mx6/board-mx6q_arm2.c index 8adf623e74eb..c80699995b21 100644 --- a/arch/arm/mach-mx6/board-mx6q_arm2.c +++ b/arch/arm/mach-mx6/board-mx6q_arm2.c @@ -816,7 +816,7 @@ static struct viv_gpu_platform_data imx6q_gpu_pdata __initdata = { static int mx6q_arm2_sata_init(struct device *dev, void __iomem *addr) { u32 tmpdata; - int ret = 0; + int ret = 0, iterations = 20; struct clk *clk; /* Enable SATA PWR CTRL_0 of MAX7310 */ @@ -868,12 +868,18 @@ static int mx6q_arm2_sata_init(struct device *dev, void __iomem *addr) sata_init(addr, tmpdata); /* Release resources when there is no device on the port */ - msleep(200); - if ((readl(addr + PORT_SATA_SR) & 0xF) == 0) { - dev_info(dev, "NO sata disk.\n"); - ret = -ENODEV; - goto release_sata_clk; - } + do { + if ((readl(addr + PORT_SATA_SR) & 0xF) == 0) + msleep(25); + else + break; + + if (iterations == 0) { + dev_info(dev, "NO sata disk.\n"); + ret = -ENODEV; + goto release_sata_clk; + } + } while (iterations-- > 0); return ret; |