Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93386
b: refs/heads/master
c: 15fe982
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Apr 25, 2008
1 parent 3e0d354 commit 60af402
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 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: 411cb3869afd91ed40e8f12df64cd9e315356305
refs/heads/master: 15fe982e429e0e6b7466719acb6cfd9dbfe47f0c
15 changes: 13 additions & 2 deletions trunk/drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,16 +556,27 @@ static inline void __iomem *ahci_port_base(struct ata_port *ap)

static void ahci_enable_ahci(void __iomem *mmio)
{
int i;
u32 tmp;

/* turn on AHCI_EN */
tmp = readl(mmio + HOST_CTL);
if (!(tmp & HOST_AHCI_EN)) {
if (tmp & HOST_AHCI_EN)
return;

/* Some controllers need AHCI_EN to be written multiple times.
* Try a few times before giving up.
*/
for (i = 0; i < 5; i++) {
tmp |= HOST_AHCI_EN;
writel(tmp, mmio + HOST_CTL);
tmp = readl(mmio + HOST_CTL); /* flush && sanity check */
WARN_ON(!(tmp & HOST_AHCI_EN));
if (tmp & HOST_AHCI_EN)
return;
msleep(10);
}

WARN_ON(1);
}

/**
Expand Down

0 comments on commit 60af402

Please sign in to comment.