aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-07-21 14:25:44 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2014-07-21 14:25:44 -0400
commitd6e6c48e5dafd77a3caf42844b59ee459fae1285 (patch)
tree4b11edd20d4d19e00943eb5d289d2859a9cbbdfc
parent5b2b9d776102a82848b73964dd12fa41eb697e27 (diff)
parentb32bfc06aefab61acc872dec3222624e6cd867ed (diff)
Merge branch 'for-3.16-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata
Pull libata fixes from Tejun Heo: "Late libata fixes. The most important one is from Kevin Hao which makes sure that libata only allocates tags inside the max tag number the controller supports. libata always had this problem but the recent tag allocation change and addition of support for sata_fsl which only supports queue depth of 16 exposed the issue. Hans de Goede agreed to become the maintainer of libahci_platform which is under higher than usual development pressure from all the new controllers popping up from the ARM world" * 'for-3.16-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata: ahci: add support for the Promise FastTrak TX8660 SATA HBA (ahci mode) drivers/ata/pata_ep93xx.c: use signed int type for result of platform_get_irq() libata: EH should handle AMNF error condition as a media error libata: support the ata host which implements a queue depth less than 32 MAINTAINERS: Add Hans de Goede as ahci-platform maintainer
-rw-r--r--MAINTAINERS10
-rw-r--r--drivers/ata/ahci.c1
-rw-r--r--drivers/ata/libata-core.c22
-rw-r--r--drivers/ata/libata-eh.c9
-rw-r--r--drivers/ata/pata_ep93xx.c2
5 files changed, 36 insertions, 8 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 61a8f486306b..d76e07798e05 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8019,6 +8019,16 @@ F: drivers/ata/
8019F: include/linux/ata.h 8019F: include/linux/ata.h
8020F: include/linux/libata.h 8020F: include/linux/libata.h
8021 8021
8022SERIAL ATA AHCI PLATFORM devices support
8023M: Hans de Goede <hdegoede@redhat.com>
8024M: Tejun Heo <tj@kernel.org>
8025L: linux-ide@vger.kernel.org
8026T: git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git
8027S: Supported
8028F: drivers/ata/ahci_platform.c
8029F: drivers/ata/libahci_platform.c
8030F: include/linux/ahci_platform.h
8031
8022SERVER ENGINES 10Gbps iSCSI - BladeEngine 2 DRIVER 8032SERVER ENGINES 10Gbps iSCSI - BladeEngine 2 DRIVER
8023M: Jayamohan Kallickal <jayamohan.kallickal@emulex.com> 8033M: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
8024L: linux-scsi@vger.kernel.org 8034L: linux-scsi@vger.kernel.org
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index dae5607e1115..4cd52a4541a9 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -456,6 +456,7 @@ static const struct pci_device_id ahci_pci_tbl[] = {
456 456
457 /* Promise */ 457 /* Promise */
458 { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ 458 { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */
459 { PCI_VDEVICE(PROMISE, 0x3781), board_ahci }, /* FastTrak TX8660 ahci-mode */
459 460
460 /* Asmedia */ 461 /* Asmedia */
461 { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci }, /* ASM1060 */ 462 { PCI_VDEVICE(ASMEDIA, 0x0601), board_ahci }, /* ASM1060 */
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 18d97d5c7d90..d19c37a7abc9 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -4787,6 +4787,10 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words)
4787 * ata_qc_new - Request an available ATA command, for queueing 4787 * ata_qc_new - Request an available ATA command, for queueing
4788 * @ap: target port 4788 * @ap: target port
4789 * 4789 *
4790 * Some ATA host controllers may implement a queue depth which is less
4791 * than ATA_MAX_QUEUE. So we shouldn't allocate a tag which is beyond
4792 * the hardware limitation.
4793 *
4790 * LOCKING: 4794 * LOCKING:
4791 * None. 4795 * None.
4792 */ 4796 */
@@ -4794,14 +4798,16 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words)
4794static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap) 4798static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap)
4795{ 4799{
4796 struct ata_queued_cmd *qc = NULL; 4800 struct ata_queued_cmd *qc = NULL;
4797 unsigned int i, tag; 4801 unsigned int i, tag, max_queue;
4802
4803 max_queue = ap->scsi_host->can_queue;
4798 4804
4799 /* no command while frozen */ 4805 /* no command while frozen */
4800 if (unlikely(ap->pflags & ATA_PFLAG_FROZEN)) 4806 if (unlikely(ap->pflags & ATA_PFLAG_FROZEN))
4801 return NULL; 4807 return NULL;
4802 4808
4803 for (i = 0; i < ATA_MAX_QUEUE; i++) { 4809 for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) {
4804 tag = (i + ap->last_tag + 1) % ATA_MAX_QUEUE; 4810 tag = tag < max_queue ? tag : 0;
4805 4811
4806 /* the last tag is reserved for internal command. */ 4812 /* the last tag is reserved for internal command. */
4807 if (tag == ATA_TAG_INTERNAL) 4813 if (tag == ATA_TAG_INTERNAL)
@@ -6169,6 +6175,16 @@ int ata_host_register(struct ata_host *host, struct scsi_host_template *sht)
6169{ 6175{
6170 int i, rc; 6176 int i, rc;
6171 6177
6178 /*
6179 * The max queue supported by hardware must not be greater than
6180 * ATA_MAX_QUEUE.
6181 */
6182 if (sht->can_queue > ATA_MAX_QUEUE) {
6183 dev_err(host->dev, "BUG: the hardware max queue is too large\n");
6184 WARN_ON(1);
6185 return -EINVAL;
6186 }
6187
6172 /* host must have been started */ 6188 /* host must have been started */
6173 if (!(host->flags & ATA_HOST_STARTED)) { 6189 if (!(host->flags & ATA_HOST_STARTED)) {
6174 dev_err(host->dev, "BUG: trying to register unstarted host\n"); 6190 dev_err(host->dev, "BUG: trying to register unstarted host\n");
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c
index 6760fc4e85b8..dad83df555c4 100644
--- a/drivers/ata/libata-eh.c
+++ b/drivers/ata/libata-eh.c
@@ -1811,7 +1811,7 @@ static unsigned int ata_eh_analyze_tf(struct ata_queued_cmd *qc,
1811 case ATA_DEV_ATA: 1811 case ATA_DEV_ATA:
1812 if (err & ATA_ICRC) 1812 if (err & ATA_ICRC)
1813 qc->err_mask |= AC_ERR_ATA_BUS; 1813 qc->err_mask |= AC_ERR_ATA_BUS;
1814 if (err & ATA_UNC) 1814 if (err & (ATA_UNC | ATA_AMNF))
1815 qc->err_mask |= AC_ERR_MEDIA; 1815 qc->err_mask |= AC_ERR_MEDIA;
1816 if (err & ATA_IDNF) 1816 if (err & ATA_IDNF)
1817 qc->err_mask |= AC_ERR_INVALID; 1817 qc->err_mask |= AC_ERR_INVALID;
@@ -2556,11 +2556,12 @@ static void ata_eh_link_report(struct ata_link *link)
2556 } 2556 }
2557 2557
2558 if (cmd->command != ATA_CMD_PACKET && 2558 if (cmd->command != ATA_CMD_PACKET &&
2559 (res->feature & (ATA_ICRC | ATA_UNC | ATA_IDNF | 2559 (res->feature & (ATA_ICRC | ATA_UNC | ATA_AMNF |
2560 ATA_ABORTED))) 2560 ATA_IDNF | ATA_ABORTED)))
2561 ata_dev_err(qc->dev, "error: { %s%s%s%s}\n", 2561 ata_dev_err(qc->dev, "error: { %s%s%s%s%s}\n",
2562 res->feature & ATA_ICRC ? "ICRC " : "", 2562 res->feature & ATA_ICRC ? "ICRC " : "",
2563 res->feature & ATA_UNC ? "UNC " : "", 2563 res->feature & ATA_UNC ? "UNC " : "",
2564 res->feature & ATA_AMNF ? "AMNF " : "",
2564 res->feature & ATA_IDNF ? "IDNF " : "", 2565 res->feature & ATA_IDNF ? "IDNF " : "",
2565 res->feature & ATA_ABORTED ? "ABRT " : ""); 2566 res->feature & ATA_ABORTED ? "ABRT " : "");
2566#endif 2567#endif
diff --git a/drivers/ata/pata_ep93xx.c b/drivers/ata/pata_ep93xx.c
index 6ad5c072ce34..4d37c5415fc7 100644
--- a/drivers/ata/pata_ep93xx.c
+++ b/drivers/ata/pata_ep93xx.c
@@ -915,7 +915,7 @@ static int ep93xx_pata_probe(struct platform_device *pdev)
915 struct ep93xx_pata_data *drv_data; 915 struct ep93xx_pata_data *drv_data;
916 struct ata_host *host; 916 struct ata_host *host;
917 struct ata_port *ap; 917 struct ata_port *ap;
918 unsigned int irq; 918 int irq;
919 struct resource *mem_res; 919 struct resource *mem_res;
920 void __iomem *ide_base; 920 void __iomem *ide_base;
921 int err; 921 int err;