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

@@@ -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);
  }
  
@@@ -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
@@@ -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 */