]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
Merge branch 'for-3.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Apr 2014 16:57:02 +0000 (09:57 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Apr 2014 16:57:02 +0000 (09:57 -0700)
Pull libata fixes from Tejun Heo:
 "Dan updated tag allocation to accomodate devices which choke when tags
  jump back and forth.  Quite a few ahci MSI related fixes.  A couple
  config dependency fixes and other misc fixes"

* 'for-3.15-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata:
  libata/ahci: accommodate tag ordered controllers
  ahci: Do not receive interrupts sent by dummy ports
  ahci: Use pci_enable_msi_exact() instead of pci_enable_msi_range()
  ahci: Ensure "MSI Revert to Single Message" mode is not enforced
  ahci: do not request irq for dummy port
  pata_samsung_cf: fix ata_host_activate() failure handling
  pata_arasan_cf: fix ata_host_activate() failure handling
  ata: fix i.MX AHCI driver dependencies
  pata_at91: fix ata_host_activate() failure handling
  libata: Update queued trim blacklist for M5x0 drives
  libata: make AHCI_XGENE depend on PHY_XGENE

1  2 
drivers/ata/libata-core.c

index c19734d96d7e6a029a1adf9667ce5a897708b58c,73c5d0410d478b1730c53bdfc7404afac9d3272e..943cc8b83e59bb7f1b293abce887be717047ffff
@@@ -1524,7 -1524,7 +1524,7 @@@ static void ata_qc_complete_internal(st
   *    @dev: Device to which the command is sent
   *    @tf: Taskfile registers for the command and the result
   *    @cdb: CDB for packet command
 - *    @dma_dir: Data tranfer direction of the command
 + *    @dma_dir: Data transfer direction of the command
   *    @sgl: sg list for the data buffer of the command
   *    @n_elem: Number of sg entries
   *    @timeout: Timeout in msecs (0 for default)
@@@ -1712,7 -1712,7 +1712,7 @@@ unsigned ata_exec_internal_sg(struct at
   *    @dev: Device to which the command is sent
   *    @tf: Taskfile registers for the command and the result
   *    @cdb: CDB for packet command
 - *    @dma_dir: Data tranfer direction of the command
 + *    @dma_dir: Data transfer direction of the command
   *    @buf: Data buffer of the command
   *    @buflen: Length of data buffer
   *    @timeout: Timeout in msecs (0 for default)
@@@ -4224,8 -4224,10 +4224,10 @@@ static const struct ata_blacklist_entr
        { "PIONEER DVD-RW  DVR-216D",   NULL,   ATA_HORKAGE_NOSETXFER },
  
        /* devices that don't properly handle queued TRIM commands */
-       { "Micron_M500*",               NULL,   ATA_HORKAGE_NO_NCQ_TRIM, },
-       { "Crucial_CT???M500SSD*",      NULL,   ATA_HORKAGE_NO_NCQ_TRIM, },
+       { "Micron_M500*",               "MU0[1-4]*",    ATA_HORKAGE_NO_NCQ_TRIM, },
+       { "Crucial_CT???M500SSD*",      "MU0[1-4]*",    ATA_HORKAGE_NO_NCQ_TRIM, },
+       { "Micron_M550*",               NULL,           ATA_HORKAGE_NO_NCQ_TRIM, },
+       { "Crucial_CT???M550SSD*",      NULL,           ATA_HORKAGE_NO_NCQ_TRIM, },
  
        /*
         * Some WD SATA-I drives spin up and down erratically when the link
@@@ -4792,21 -4794,26 +4794,26 @@@ void swap_buf_le16(u16 *buf, unsigned i
  static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap)
  {
        struct ata_queued_cmd *qc = NULL;
-       unsigned int i;
+       unsigned int i, tag;
  
        /* no command while frozen */
        if (unlikely(ap->pflags & ATA_PFLAG_FROZEN))
                return NULL;
  
-       /* the last tag is reserved for internal command. */
-       for (i = 0; i < ATA_MAX_QUEUE - 1; i++)
-               if (!test_and_set_bit(i, &ap->qc_allocated)) {
-                       qc = __ata_qc_from_tag(ap, i);
+       for (i = 0; i < ATA_MAX_QUEUE; i++) {
+               tag = (i + ap->last_tag + 1) % ATA_MAX_QUEUE;
+               /* the last tag is reserved for internal command. */
+               if (tag == ATA_TAG_INTERNAL)
+                       continue;
+               if (!test_and_set_bit(tag, &ap->qc_allocated)) {
+                       qc = __ata_qc_from_tag(ap, tag);
+                       qc->tag = tag;
+                       ap->last_tag = tag;
                        break;
                }
-       if (qc)
-               qc->tag = i;
+       }
  
        return qc;
  }