Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 73062
b: refs/heads/master
c: 5270222
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Nov 3, 2007
1 parent 80aa245 commit 9024796
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 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: db64bcf387aae6c7afad122a529d7d0513d3c5db
refs/heads/master: 5270222f96608818e431b5c4029b1f12020ab719
22 changes: 16 additions & 6 deletions trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -2751,17 +2751,27 @@ int sata_down_spd_limit(struct ata_link *link)

static int __sata_set_spd_needed(struct ata_link *link, u32 *scontrol)
{
u32 spd, limit;
struct ata_link *host_link = &link->ap->link;
u32 limit, target, spd;

if (link->sata_spd_limit == UINT_MAX)
limit = 0;
limit = link->sata_spd_limit;

/* Don't configure downstream link faster than upstream link.
* It doesn't speed up anything and some PMPs choke on such
* configuration.
*/
if (!ata_is_host_link(link) && host_link->sata_spd)
limit &= (1 << host_link->sata_spd) - 1;

if (limit == UINT_MAX)
target = 0;
else
limit = fls(link->sata_spd_limit);
target = fls(limit);

spd = (*scontrol >> 4) & 0xf;
*scontrol = (*scontrol & ~0xf0) | ((limit & 0xf) << 4);
*scontrol = (*scontrol & ~0xf0) | ((target & 0xf) << 4);

return spd != limit;
return spd != target;
}

/**
Expand Down

0 comments on commit 9024796

Please sign in to comment.