summaryrefslogtreecommitdiff
path: root/drivers/ata
diff options
context:
space:
mode:
authorJerry Huang <Chang-Ming.Huang@freescale.com>2013-03-07 01:58:25 (GMT)
committerFleming Andrew-AFLEMING <AFLEMING@freescale.com>2013-03-26 21:49:10 (GMT)
commit828753fc8358e88597e13fce1b75f67fa794f776 (patch)
treeca24a02e93102f12ca7db676b2becc656a3467e8 /drivers/ata
parentc1e34bdfd9e2a701f91318709f7651c1ef4cf25c (diff)
downloadlinux-fsl-qoriq-828753fc8358e88597e13fce1b75f67fa794f776.tar.xz
libata-pmp: add schedule timeout to support some PMP cards
With Freescale SATA controller, some PMP cards(e.g JMB393 PMP card) can't work on some platforms (e.g mpc837x, p1022): During PMP initialize, when reading the PMP SCR, we will observe the TIMEOUT error because PMP card SCR is not ready. Therefore, we need enough time to wait for the PMP card ready for SCR read. below is the error log: fsl-sata e0018000.sata: Sata FSL Platform/CSB Driver init scsi0 : sata_fsl ata1: SATA max UDMA/133 irq 44 ata1: Signature Update detected @ 504 msecs ata1: SATA link up 3.0 Gbps (SStatus 123 SControl 300) ata2.15: Port Multiplier 1.2, 0x197b:0x0325 r0, 15 ports, feat 0x5/0xf ata2.00: hard resetting link ata2.15: qc timeout (cmd 0xe4) ata2.00: failed to read SCR 0 (Emask=0x4) ata2.00: failed to read SCR 0 (Emask=0x40) ata2.00: failed to read SCR 0 (Emask=0x40) ata2: ATA_SRST issue failed ata2.00: failed to read SCR 0 (Emask=0x40) ata2.00: reset failed, giving up ata2.15: hard resetting link ata2: Hardreset failed, not off-lined 0 ata2: No Signature Update ata2.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300) ata2.00: hard resetting link ata2.15: qc timeout (cmd 0xe4) ata2.00: failed to read SCR 0 (Emask=0x4) ata2.00: failed to read SCR 0 (Emask=0x40) ata2.00: failed to read SCR 0 (Emask=0x40) ata2: ATA_SRST issue failed ata2.00: failed to read SCR 0 (Emask=0x40) ata2.00: reset failed, giving up ata2.15: hard resetting link ata2: Hardreset failed, not off-lined 0 ata2: No Signature Update ata2.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300) ata2.00: hard resetting link ata2.15: qc timeout (cmd 0xe4) ata2.00: failed to read SCR 0 (Emask=0x4) ata2.00: failed to read SCR 0 (Emask=0x40) ata2.00: failed to read SCR 0 (Emask=0x40) ata2: ATA_SRST issue failed ata2.00: failed to read SCR 0 (Emask=0x40) ata2.00: reset failed, giving up ata2.00: failed to recover link after 3 tries, disabling ata2.15: hard resetting link ata2: Hardreset failed, not off-lined 0 ata2: No Signature Update ata2.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300) ata2.15: qc timeout (cmd 0xe4) ata2.00: failed to read SCR 0 (Emask=0x4) ata2.00: failed to write SCR 1 (Emask=0x40) ata2.00: failed to clear SError.N (errno=-5) ata2.15: hard resetting link ata2: Hardreset failed, not off-lined 0 ata2: No Signature Update ata2.15: SATA link up 3.0 Gbps (SStatus 123 SControl 300) ata2.01: hard resetting link ata2.01: failed to resume link (SControl 0) ata2.01: SATA link down (SStatus 0 SControl 0) ata2.02: hard resetting link ata2.02: failed to resume link (SControl 0) ata2.02: SATA link down (SStatus 0 SControl 0) ...... ata2.14: hard resetting link ata2.14: failed to resume link (SControl 0) ata2.14: SATA link down (SStatus 0 SControl 0) ata2: EH complete Signed-off-by: Jerry Huang <Chang-Ming.Huang@freescale.com> Change-Id: I1ab7d5ca9b57c9a482bb1ba99858814963d4816a Reviewed-on: http://git.am.freescale.net:8181/323 Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-pmp.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/ata/libata-pmp.c b/drivers/ata/libata-pmp.c
index 61c59ee..6efe3a7 100644
--- a/drivers/ata/libata-pmp.c
+++ b/drivers/ata/libata-pmp.c
@@ -146,6 +146,13 @@ int sata_pmp_scr_read(struct ata_link *link, int reg, u32 *r_val)
if (reg > SATA_PMP_PSCR_CONTROL)
return -EINVAL;
+ /* For some PMP card, we need delay some time */
+ if (link->flags & ATA_LFLAG_DELAY) {
+ set_current_state(TASK_INTERRUPTIBLE);
+ /* sleep 50 msecond */
+ schedule_timeout(msecs_to_jiffies(50));
+ }
+
err_mask = sata_pmp_read(link, reg, r_val);
if (err_mask) {
ata_link_warn(link, "failed to read SCR %d (Emask=0x%x)\n",
@@ -456,6 +463,11 @@ static void sata_pmp_quirks(struct ata_port *ap)
ATA_LFLAG_NO_SRST |
ATA_LFLAG_ASSUME_ATA;
}
+ } else if (vendor == 0x197b && devid == 0x0325) {
+ /* For jmicron JMB393 card, need some time to ready the PMP */
+ ata_for_each_link(link, ap, EDGE) {
+ link->flags |= ATA_LFLAG_DELAY;
+ }
}
}