aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-07 11:53:02 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-07 11:53:02 -0400
commit132ea5e9aa9ce13f62ba45db8e43ec887d1106e9 (patch)
tree417d93c83ccaa205efab507df56fc985242ba0ae /drivers/ata/ahci.c
parent0e26da0f2200a2fb51844aaa43e365ea9dd5a93d (diff)
parentcae5a29d3c4ec7c4214966021c9ee827e66bd67b (diff)
Merge branch 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: sata_mv: shorten register names sata_mv: workaround errata SATA#13 sata_mv: cosmetic renames sata_mv: workaround errata SATA#26 sata_mv: workaround errata PCI#7 sata_mv: replace 0x1f with ATA_PIO4 (v2) sata_mv: fix irq mask races sata_mv: revert SoC irq breakage libata: ahci enclosure management bios workaround ata: Add TRIM infrastructure ata_piix: VGN-BX297XP wants the controller power up on suspend libata: Remove some redundant casts from pata_octeon_cf.c pata_artop: typo
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r--drivers/ata/ahci.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index f75dac57dc2b..57be6bea48eb 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -78,6 +78,7 @@ static ssize_t ahci_led_store(struct ata_port *ap, const char *buf,
78static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state, 78static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state,
79 ssize_t size); 79 ssize_t size);
80#define MAX_SLOTS 8 80#define MAX_SLOTS 8
81#define MAX_RETRY 15
81 82
82enum { 83enum {
83 AHCI_PCI_BAR = 5, 84 AHCI_PCI_BAR = 5,
@@ -1115,6 +1116,8 @@ static void ahci_start_port(struct ata_port *ap)
1115 struct ahci_port_priv *pp = ap->private_data; 1116 struct ahci_port_priv *pp = ap->private_data;
1116 struct ata_link *link; 1117 struct ata_link *link;
1117 struct ahci_em_priv *emp; 1118 struct ahci_em_priv *emp;
1119 ssize_t rc;
1120 int i;
1118 1121
1119 /* enable FIS reception */ 1122 /* enable FIS reception */
1120 ahci_start_fis_rx(ap); 1123 ahci_start_fis_rx(ap);
@@ -1126,7 +1129,17 @@ static void ahci_start_port(struct ata_port *ap)
1126 if (ap->flags & ATA_FLAG_EM) { 1129 if (ap->flags & ATA_FLAG_EM) {
1127 ata_for_each_link(link, ap, EDGE) { 1130 ata_for_each_link(link, ap, EDGE) {
1128 emp = &pp->em_priv[link->pmp]; 1131 emp = &pp->em_priv[link->pmp];
1129 ahci_transmit_led_message(ap, emp->led_state, 4); 1132
1133 /* EM Transmit bit maybe busy during init */
1134 for (i = 0; i < MAX_RETRY; i++) {
1135 rc = ahci_transmit_led_message(ap,
1136 emp->led_state,
1137 4);
1138 if (rc == -EBUSY)
1139 udelay(100);
1140 else
1141 break;
1142 }
1130 } 1143 }
1131 } 1144 }
1132 1145
@@ -1331,7 +1344,7 @@ static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state,
1331 em_ctl = readl(mmio + HOST_EM_CTL); 1344 em_ctl = readl(mmio + HOST_EM_CTL);
1332 if (em_ctl & EM_CTL_TM) { 1345 if (em_ctl & EM_CTL_TM) {
1333 spin_unlock_irqrestore(ap->lock, flags); 1346 spin_unlock_irqrestore(ap->lock, flags);
1334 return -EINVAL; 1347 return -EBUSY;
1335 } 1348 }
1336 1349
1337 /* 1350 /*