Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 130812
b: refs/heads/master
c: 9913ff8
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Feb 3, 2009
1 parent f6cee81 commit 593f62a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 678afac678061ee41bc3007885003c125912a8e2
refs/heads/master: 9913ff8abf1c70a8d52560dc931e1901d025ad27
11 changes: 8 additions & 3 deletions trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ MODULE_LICENSE("GPL");
MODULE_VERSION(DRV_VERSION);


static bool ata_sstatus_online(u32 sstatus)
{
return (sstatus & 0xf) == 0x3;
}

/**
* ata_link_next - link iteration helper
* @link: the previous link, NULL to start
Expand Down Expand Up @@ -2891,7 +2896,7 @@ int sata_down_spd_limit(struct ata_link *link)
* If not, use cached value in link->sata_spd.
*/
rc = sata_scr_read(link, SCR_STATUS, &sstatus);
if (rc == 0)
if (rc == 0 && ata_sstatus_online(sstatus))
spd = (sstatus >> 4) & 0xf;
else
spd = link->sata_spd;
Expand Down Expand Up @@ -5162,7 +5167,7 @@ bool ata_phys_link_online(struct ata_link *link)
u32 sstatus;

if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0 &&
(sstatus & 0xf) == 0x3)
ata_sstatus_online(sstatus))
return true;
return false;
}
Expand All @@ -5186,7 +5191,7 @@ bool ata_phys_link_offline(struct ata_link *link)
u32 sstatus;

if (sata_scr_read(link, SCR_STATUS, &sstatus) == 0 &&
(sstatus & 0xf) != 0x3)
!ata_sstatus_online(sstatus))
return true;
return false;
}
Expand Down

0 comments on commit 593f62a

Please sign in to comment.