diff options
author | Mark Lord <liml@rtr.ca> | 2009-04-06 15:24:57 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@redhat.com> | 2009-04-06 20:13:50 -0400 |
commit | 2009177329ae565d9e9efd31b399d2f4ed4f0c44 (patch) | |
tree | dc68c765e3295802e69a96c52ed0e08f604121cd /drivers/ata/sata_mv.c | |
parent | 65ad7fef10b50b6c06d6165fa847e2d3636b0a66 (diff) |
sata_mv: workaround errata SATA#26
Workaround for errata SATA#26.
Prevents accidently putting a drive to sleep when attempting COMRESET,
by ORing 0xf000 with the values written to SCR_CONTROL.
Signed-off-by: Mark Lord <mlord@pobox.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata/sata_mv.c')
-rw-r--r-- | drivers/ata/sata_mv.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index b0c929d36234..d689fb9ceb96 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -1296,7 +1296,25 @@ static int mv_scr_write(struct ata_link *link, unsigned int sc_reg_in, u32 val) | |||
1296 | unsigned int ofs = mv_scr_offset(sc_reg_in); | 1296 | unsigned int ofs = mv_scr_offset(sc_reg_in); |
1297 | 1297 | ||
1298 | if (ofs != 0xffffffffU) { | 1298 | if (ofs != 0xffffffffU) { |
1299 | writelfl(val, mv_ap_base(link->ap) + ofs); | 1299 | void __iomem *addr = mv_ap_base(link->ap) + ofs; |
1300 | if (sc_reg_in == SCR_CONTROL) { | ||
1301 | /* | ||
1302 | * Workaround for 88SX60x1 FEr SATA#26: | ||
1303 | * | ||
1304 | * COMRESETs have to take care not to accidently | ||
1305 | * put the drive to sleep when writing SCR_CONTROL. | ||
1306 | * Setting bits 12..15 prevents this problem. | ||
1307 | * | ||
1308 | * So if we see an outbound COMMRESET, set those bits. | ||
1309 | * Ditto for the followup write that clears the reset. | ||
1310 | * | ||
1311 | * The proprietary driver does this for | ||
1312 | * all chip versions, and so do we. | ||
1313 | */ | ||
1314 | if ((val & 0xf) == 1 || (readl(addr) & 0xf) == 1) | ||
1315 | val |= 0xf000; | ||
1316 | } | ||
1317 | writelfl(val, addr); | ||
1300 | return 0; | 1318 | return 0; |
1301 | } else | 1319 | } else |
1302 | return -EINVAL; | 1320 | return -EINVAL; |