]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/scsi/libata-core.c
[SCSI] qla2xxx: Drop legacy 'bypass lun scan for tape device' code.
[linux-2.6-omap-h63xx.git] / drivers / scsi / libata-core.c
index e6044455ca4533c33c88a2d95c516510a0685dc9..46c4cdbaee86dc26114299c2a1ccfa45150b9c39 100644 (file)
@@ -1456,7 +1456,7 @@ void ata_dev_config(struct ata_port *ap, unsigned int i)
                ap->udma_mask &= ATA_UDMA5;
                ap->host->max_sectors = ATA_MAX_SECTORS;
                ap->host->hostt->max_sectors = ATA_MAX_SECTORS;
-               ap->device->flags |= ATA_DFLAG_LOCK_SECTORS;
+               ap->device[i].flags |= ATA_DFLAG_LOCK_SECTORS;
        }
 
        if (ap->ops->dev_config)
@@ -3097,10 +3097,21 @@ static void ata_pio_data_xfer(struct ata_port *ap, unsigned char *buf,
 static void ata_data_xfer(struct ata_port *ap, unsigned char *buf,
                          unsigned int buflen, int do_write)
 {
-       if (ap->flags & ATA_FLAG_MMIO)
-               ata_mmio_data_xfer(ap, buf, buflen, do_write);
-       else
-               ata_pio_data_xfer(ap, buf, buflen, do_write);
+       /* Make the crap hardware pay the costs not the good stuff */
+       if (unlikely(ap->flags & ATA_FLAG_IRQ_MASK)) {
+               unsigned long flags;
+               local_irq_save(flags);
+               if (ap->flags & ATA_FLAG_MMIO)
+                       ata_mmio_data_xfer(ap, buf, buflen, do_write);
+               else
+                       ata_pio_data_xfer(ap, buf, buflen, do_write);
+               local_irq_restore(flags);
+       } else {
+               if (ap->flags & ATA_FLAG_MMIO)
+                       ata_mmio_data_xfer(ap, buf, buflen, do_write);
+               else
+                       ata_pio_data_xfer(ap, buf, buflen, do_write);
+       }
 }
 
 /**