summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan Cox <alan@lxorguk.ukuu.org.uk>2006-01-17 21:53:50 +0100
committerJeff Garzik <jgarzik@pobox.com>2006-01-18 01:37:45 +0100
commita1bd9e68573239320d18823c73eb06d8e56cc9e2 (patch)
tree9c9138c9239c586a66fd372549544254d10304e4
parent[PATCH] libata: Fix sector lock to apply to both drives not drive 0 twice (diff)
downloadlinux-a1bd9e68573239320d18823c73eb06d8e56cc9e2.tar.xz
linux-a1bd9e68573239320d18823c73eb06d8e56cc9e2.zip
[PATCH] libata: Code for the IRQ mask flag
Signed-off-by: Alan Cox <alan@redhat.com> Somewhat cleaner in the resync as someone cleaned up the pio xfer users Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
-rw-r--r--drivers/scsi/libata-core.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c
index 0a2936a140c8..46c4cdbaee86 100644
--- a/drivers/scsi/libata-core.c
+++ b/drivers/scsi/libata-core.c
@@ -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);
+ }
}
/**