aboutsummaryrefslogtreecommitdiff
path: root/drivers/ata/libahci.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:49:46 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2013-07-03 19:49:46 -0700
commit9e220385c4eb8b7e66174a60ea0e15b6b296f228 (patch)
tree803274a4d820749510bc19a9231959189cdebd81 /drivers/ata/libahci.c
parent7f0ef0267e20d62d45d527911a993b1e998f4968 (diff)
parent5a0a6a4f17a3606289f96356383db695a555bdbd (diff)
Merge branch 'for-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata
Pull libata updates from Tejun Heo: "Overview of changes: - The rest of maintainer email address updates. - Some core updates - more robust default behavior for port multipliers, better error reporting for SG_IO commands, and a way to better work around now ancient and probably pretty rare PATA -> SATA bridges with ATAPI devices. - sata_rcar stabilization. - Some hardware PCI ID additions and one-off low level driver updates." * 'for-3.11' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: (22 commits) AHCI: use ATA_BUSY libata-zpodd: must use ata_tf_init() ahci: AHCI-mode SATA patch for Intel Coleto Creek DeviceIDs ata_piix: IDE-mode SATA patch for Intel Coleto Creek DeviceIDs libata: cleanup SAT error translation ahci: sata: add support for exynos5440 sata libata: skip SRST for all SIMG [34]7x port-multipliers ahci: remove pmp link online check in FBS EH sata highbank: add bit-banged SGPIO driver support ahci: make ahci_transmit_led_message into a function pointer sata_rcar: fix compilation warning in sata_rcar_thaw() sata_highbank: increase retry count but shorten duration for Calxeda controller ata: use pci_get_drvdata() ipr: qc_fill_rtf() method should not store alternate status register sata_rcar: add 'base' local variable to some functions sata_rcar: correct 'sata_rcar_sht' sata_rcar: kill superfluous code in sata_rcar_bmdma_fill_sg() libata: do not limit R-Car SATA driver to shmobile ata: use platform_{get,set}_drvdata() AHCI: Make distinct names for ports in /proc/interrupts ...
Diffstat (limited to 'drivers/ata/libahci.c')
-rw-r--r--drivers/ata/libahci.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/drivers/ata/libahci.c b/drivers/ata/libahci.c
index a70ff154f58..acfd0f71106 100644
--- a/drivers/ata/libahci.c
+++ b/drivers/ata/libahci.c
@@ -173,6 +173,7 @@ struct ata_port_operations ahci_ops = {
.em_store = ahci_led_store,
.sw_activity_show = ahci_activity_show,
.sw_activity_store = ahci_activity_store,
+ .transmit_led_message = ahci_transmit_led_message,
#ifdef CONFIG_PM
.port_suspend = ahci_port_suspend,
.port_resume = ahci_port_resume,
@@ -774,7 +775,7 @@ static void ahci_start_port(struct ata_port *ap)
/* EM Transmit bit maybe busy during init */
for (i = 0; i < EM_MAX_RETRY; i++) {
- rc = ahci_transmit_led_message(ap,
+ rc = ap->ops->transmit_led_message(ap,
emp->led_state,
4);
if (rc == -EBUSY)
@@ -915,7 +916,7 @@ static void ahci_sw_activity_blink(unsigned long arg)
led_message |= (1 << 16);
}
spin_unlock_irqrestore(ap->lock, flags);
- ahci_transmit_led_message(ap, led_message, 4);
+ ap->ops->transmit_led_message(ap, led_message, 4);
}
static void ahci_init_sw_activity(struct ata_link *link)
@@ -1044,7 +1045,7 @@ static ssize_t ahci_led_store(struct ata_port *ap, const char *buf,
if (emp->blink_policy)
state &= ~EM_MSG_LED_VALUE_ACTIVITY;
- return ahci_transmit_led_message(ap, state, size);
+ return ap->ops->transmit_led_message(ap, state, size);
}
static ssize_t ahci_activity_store(struct ata_device *dev, enum sw_activity val)
@@ -1063,7 +1064,7 @@ static ssize_t ahci_activity_store(struct ata_device *dev, enum sw_activity val)
/* set the LED to OFF */
port_led_state &= EM_MSG_LED_VALUE_OFF;
port_led_state |= (ap->port_no | (link->pmp << 8));
- ahci_transmit_led_message(ap, port_led_state, 4);
+ ap->ops->transmit_led_message(ap, port_led_state, 4);
} else {
link->flags |= ATA_LFLAG_SW_ACTIVITY;
if (val == BLINK_OFF) {
@@ -1071,7 +1072,7 @@ static ssize_t ahci_activity_store(struct ata_device *dev, enum sw_activity val)
port_led_state &= EM_MSG_LED_VALUE_OFF;
port_led_state |= (ap->port_no | (link->pmp << 8));
port_led_state |= EM_MSG_LED_VALUE_ON; /* check this */
- ahci_transmit_led_message(ap, port_led_state, 4);
+ ap->ops->transmit_led_message(ap, port_led_state, 4);
}
}
emp->blink_policy = val;
@@ -1412,7 +1413,7 @@ static int ahci_hardreset(struct ata_link *link, unsigned int *class,
/* clear D2H reception area to properly wait for D2H FIS */
ata_tf_init(link->device, &tf);
- tf.command = 0x80;
+ tf.command = ATA_BUSY;
ata_tf_to_fis(&tf, 0, 0, d2h_fis);
rc = sata_link_hardreset(link, timing, deadline, &online,
@@ -1560,8 +1561,7 @@ static void ahci_error_intr(struct ata_port *ap, u32 irq_stat)
u32 fbs = readl(port_mmio + PORT_FBS);
int pmp = fbs >> PORT_FBS_DWE_OFFSET;
- if ((fbs & PORT_FBS_SDE) && (pmp < ap->nr_pmp_links) &&
- ata_link_online(&ap->pmp_link[pmp])) {
+ if ((fbs & PORT_FBS_SDE) && (pmp < ap->nr_pmp_links)) {
link = &ap->pmp_link[pmp];
fbs_need_dec = true;
}
@@ -2234,6 +2234,16 @@ static int ahci_port_start(struct ata_port *ap)
if (!pp)
return -ENOMEM;
+ if (ap->host->n_ports > 1) {
+ pp->irq_desc = devm_kzalloc(dev, 8, GFP_KERNEL);
+ if (!pp->irq_desc) {
+ devm_kfree(dev, pp);
+ return -ENOMEM;
+ }
+ snprintf(pp->irq_desc, 8,
+ "%s%d", dev_driver_string(dev), ap->port_no);
+ }
+
/* check FBS capability */
if ((hpriv->cap & HOST_CAP_FBS) && sata_pmp_supported(ap)) {
void __iomem *port_mmio = ahci_port_base(ap);