Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 142677
b: refs/heads/master
c: 4c1e9aa
h: refs/heads/master
i:
  142675: eec3ec3
v: v3
  • Loading branch information
David Milburn authored and Jeff Garzik committed Apr 7, 2009
1 parent a882a0e commit a6de4dd
Show file tree
Hide file tree
Showing 2 changed files with 16 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: 0c659b82d11eaf5e1bee1f2bcb9994b9d09d175c
refs/heads/master: 4c1e9aa41b2f9afe8f26e2efe5bb4695f6c40772
17 changes: 15 additions & 2 deletions trunk/drivers/ata/ahci.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ static ssize_t ahci_led_store(struct ata_port *ap, const char *buf,
static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state,
ssize_t size);
#define MAX_SLOTS 8
#define MAX_RETRY 15

enum {
AHCI_PCI_BAR = 5,
Expand Down Expand Up @@ -1115,6 +1116,8 @@ static void ahci_start_port(struct ata_port *ap)
struct ahci_port_priv *pp = ap->private_data;
struct ata_link *link;
struct ahci_em_priv *emp;
ssize_t rc;
int i;

/* enable FIS reception */
ahci_start_fis_rx(ap);
Expand All @@ -1126,7 +1129,17 @@ static void ahci_start_port(struct ata_port *ap)
if (ap->flags & ATA_FLAG_EM) {
ata_for_each_link(link, ap, EDGE) {
emp = &pp->em_priv[link->pmp];
ahci_transmit_led_message(ap, emp->led_state, 4);

/* EM Transmit bit maybe busy during init */
for (i = 0; i < MAX_RETRY; i++) {
rc = ahci_transmit_led_message(ap,
emp->led_state,
4);
if (rc == -EBUSY)
udelay(100);
else
break;
}
}
}

Expand Down Expand Up @@ -1331,7 +1344,7 @@ static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state,
em_ctl = readl(mmio + HOST_EM_CTL);
if (em_ctl & EM_CTL_TM) {
spin_unlock_irqrestore(ap->lock, flags);
return -EINVAL;
return -EBUSY;
}

/*
Expand Down

0 comments on commit a6de4dd

Please sign in to comment.