Skip to content

Commit

Permalink
[libata] sata_mv: errata check buglet fix
Browse files Browse the repository at this point in the history
Fix a buglet; the errata check below this code is assuming the value in
the sstatus variable is what was pulled out of the SCR_STATUS register.
However, the status checks in the timeout loop clobber everything
but the first 4 bits of sstatus, so the errata checks are invalid.

This patch changes it to not clobber SStatus.

Signed-off-by: Andres Salomon <dilinger@debian.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Andres Salomon authored and Jeff Garzik committed Sep 11, 2006
1 parent c336923 commit 62f1d0e
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/scsi/sata_mv.c
Original file line number Diff line number Diff line change
Expand Up @@ -1961,8 +1961,7 @@ static void __mv_phy_reset(struct ata_port *ap, int can_sleep)
timeout = jiffies + msecs_to_jiffies(200);
do {
sata_scr_read(ap, SCR_STATUS, &sstatus);
sstatus &= 0x3;
if ((sstatus == 3) || (sstatus == 0))
if (((sstatus & 0x3) == 3) || ((sstatus & 0x3) == 0))
break;

__msleep(1, can_sleep);
Expand Down

0 comments on commit 62f1d0e

Please sign in to comment.