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
This commit is contained in:
@ -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,
|
||||
@ -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);
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
/*
|
||||
|
Reference in New Issue
Block a user