Merge branch 'irq-pio'
authorTejun Heo <htejun@gmail.com>
Mon, 15 May 2006 11:59:15 +0000 (20:59 +0900)
committerTejun Heo <htejun@gmail.com>
Mon, 15 May 2006 11:59:15 +0000 (20:59 +0900)
Conflicts:

drivers/scsi/libata-core.c
include/linux/libata.h

1  2 
drivers/scsi/libata-core.c
drivers/scsi/libata-eh.c
drivers/scsi/sata_mv.c
drivers/scsi/sata_promise.c
drivers/scsi/sata_sx4.c
include/linux/ata.h
include/linux/libata.h

index 2969599ec0b9ad7163dbd38911a5d355a7c3a47b,5d38a6cc5736ae6a62de85e5d4ed6f28ee4c8d10..c859b96b891a8ed5ca7070dc255dad9e61504a6f
@@@ -1337,32 -1300,46 +1337,46 @@@ static int ata_dev_configure(struct ata
  
                        /* print device info to dmesg */
                        if (print_info)
 -                              printk(KERN_INFO "ata%u: dev %u ATA-%d, "
 -                                     "max %s, %Lu sectors: CHS %u/%u/%u\n",
 -                                     ap->id, dev->devno,
 -                                     ata_id_major_version(id),
 -                                     ata_mode_string(xfer_mask),
 -                                     (unsigned long long)dev->n_sectors,
 -                                     dev->cylinders, dev->heads, dev->sectors);
 +                              ata_dev_printk(dev, KERN_INFO, "ATA-%d, "
 +                                      "max %s, %Lu sectors: CHS %u/%u/%u\n",
 +                                      ata_id_major_version(id),
 +                                      ata_mode_string(xfer_mask),
 +                                      (unsigned long long)dev->n_sectors,
 +                                      dev->cylinders, dev->heads, dev->sectors);
                }
  
+               if (dev->id[59] & 0x100) {
+                       dev->multi_count = dev->id[59] & 0xff;
+                       DPRINTK("ata%u: dev %u multi count %u\n",
+                               ap->id, dev->devno, dev->multi_count);
+               }
                dev->cdb_len = 16;
        }
  
        /* ATAPI-specific feature tests */
        else if (dev->class == ATA_DEV_ATAPI) {
+               char *cdb_intr_string = "";
                rc = atapi_cdb_len(id);
                if ((rc < 12) || (rc > ATAPI_CDB_LEN)) {
 -                      printk(KERN_WARNING "ata%u: unsupported CDB len\n", ap->id);
 +                      ata_dev_printk(dev, KERN_WARNING,
 +                                     "unsupported CDB len\n");
                        rc = -EINVAL;
                        goto err_out_nosup;
                }
                dev->cdb_len = (unsigned int) rc;
  
+               if (ata_id_cdb_intr(dev->id)) {
+                       dev->flags |= ATA_DFLAG_CDB_INTR;
+                       cdb_intr_string = ", CDB intr";
+               }
                /* print device info to dmesg */
                if (print_info)
-                       ata_dev_printk(dev, KERN_INFO, "ATAPI, max %s\n",
-                                      ata_mode_string(xfer_mask));
 -                      printk(KERN_INFO "ata%u: dev %u ATAPI, max %s%s\n",
 -                             ap->id, dev->devno, ata_mode_string(xfer_mask),
 -                             cdb_intr_string);
++                      ata_dev_printk(dev, KERN_INFO, "ATAPI, max %s%s\n",
++                                     ata_mode_string(xfer_mask),
++                                     cdb_intr_string);
        }
  
        ap->host->max_cmd_len = 0;
@@@ -3452,25 -3428,8 +3475,23 @@@ void ata_poll_qc_complete(struct ata_qu
        unsigned long flags;
  
        spin_lock_irqsave(&ap->host_set->lock, flags);
 -      ata_irq_on(ap);
 -      ata_qc_complete(qc);
 +
 +      if (ap->ops->error_handler) {
 +              /* EH might have kicked in while host_set lock is released */
 +              qc = ata_qc_from_tag(ap, qc->tag);
 +              if (qc) {
 +                      if (!(qc->err_mask & AC_ERR_HSM)) {
-                               ap->flags &= ~ATA_FLAG_NOINTR;
 +                              ata_irq_on(ap);
 +                              ata_qc_complete(qc);
 +                      } else
 +                              ata_port_freeze(ap);
 +              }
 +      } else {
 +              /* old EH */
-               ap->flags &= ~ATA_FLAG_NOINTR;
 +              ata_irq_on(ap);
 +              ata_qc_complete(qc);
 +      }
 +
        spin_unlock_irqrestore(&ap->host_set->lock, flags);
  }
  
index cd133f83e59511c3eda3772251532cc14bfae006,16db62211716d3b9ba5be30687fd80b99d6b8483..e401f353f84815d5a829d55a37b86bf4df38d6be
@@@ -345,12 -167,11 +345,12 @@@ static void ata_qc_timeout(struct ata_q
                /* ack bmdma irq events */
                ap->ops->irq_clear(ap);
  
 -              printk(KERN_ERR "ata%u: command 0x%x timeout, stat 0x%x host_stat 0x%x\n",
 -                     ap->id, qc->tf.command, drv_stat, host_stat);
 +              ata_dev_printk(qc->dev, KERN_ERR, "command 0x%x timeout, "
 +                             "stat 0x%x host_stat 0x%x\n",
 +                             qc->tf.command, drv_stat, host_stat);
  
                /* complete taskfile transaction */
-               qc->err_mask |= ac_err_mask(drv_stat);
+               qc->err_mask |= AC_ERR_TIMEOUT;
                break;
        }
  
Simple merge
Simple merge
Simple merge
Simple merge
index 6ccacbf889e3b6a79b2376529f953e7f34293cca,bf86ee474533663d0acbb891d0bd4850bc391d1c..db17723e23fb2664649be535850c78195121c637
@@@ -147,18 -146,14 +148,18 @@@ enum 
        ATA_FLAG_PIO_DMA        = (1 << 7), /* PIO cmds via DMA */
        ATA_FLAG_PIO_LBA48      = (1 << 8), /* Host DMA engine is LBA28 only */
        ATA_FLAG_IRQ_MASK       = (1 << 9), /* Mask IRQ in PIO xfers */
+       ATA_FLAG_PIO_POLLING    = (1 << 10), /* use polling PIO if LLD
+                                             * doesn't handle PIO interrupts */
  
-       ATA_FLAG_NOINTR         = (1 << 13), /* FIXME: Remove this once
-                                             * proper HSM is in place. */
 -      ATA_FLAG_DEBUGMSG       = (1 << 17),
 -      ATA_FLAG_FLUSH_PORT_TASK = (1 << 18), /* flush port task */
 +      ATA_FLAG_DEBUGMSG       = (1 << 14),
 +      ATA_FLAG_FLUSH_PORT_TASK = (1 << 15), /* flush port task */
  
 -      ATA_FLAG_DISABLED       = (1 << 19), /* port is disabled, ignore it */
 -      ATA_FLAG_SUSPENDED      = (1 << 20), /* port is suspended */
 +      ATA_FLAG_EH_PENDING     = (1 << 16), /* EH pending */
 +      ATA_FLAG_FROZEN         = (1 << 17), /* port is frozen */
 +      ATA_FLAG_RECOVERED      = (1 << 18), /* recovery action performed */
 +
 +      ATA_FLAG_DISABLED       = (1 << 22), /* port is disabled, ignore it */
 +      ATA_FLAG_SUSPENDED      = (1 << 23), /* port is suspended (power) */
  
        /* bits 24:31 of ap->flags are reserved for LLDD specific flags */