From 1bc4ccfff8675adc3d96f91245eb7e2dc0043ca9 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Mon, 9 Jan 2006 17:18:14 +0000 Subject: [PATCH] libata: add a function to decide if we need iordy This ought to be simple but for PIO2 we have to poke around the drive data to get it 100% correct. Signed-off-by: Jeff Garzik --- include/linux/libata.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/libata.h b/include/linux/libata.h index a43c95f8f96..af6624450f6 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -499,6 +499,8 @@ extern int ata_scsi_slave_config(struct scsi_device *sdev); /* * Timing helpers */ + +extern unsigned int ata_pio_need_iordy(const struct ata_device *); extern int ata_timing_compute(struct ata_device *, unsigned short, struct ata_timing *, int, int); extern void ata_timing_merge(const struct ata_timing *, -- cgit v1.2.3-70-g09d2 From 8d238e012469a9a332c78d6a69a8a46ac4b1e9c2 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 17 Jan 2006 20:50:31 +0000 Subject: [PATCH] libata: Fix heuristic typos add LBA48PIO flag and support code, add IRQ flag for next diff Signed-off-by: Alan Cox Signed-off-by: Jeff Garzik --- drivers/scsi/libata-core.c | 4 ++++ include/linux/libata.h | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index b42acbe0e9a..e6044455ca4 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -611,6 +611,10 @@ int ata_rwcmd_protocol(struct ata_queued_cmd *qc) if (dev->flags & ATA_DFLAG_PIO) { tf->protocol = ATA_PROT_PIO; index = dev->multi_count ? 0 : 8; + } else if (lba48 && (qc->ap->flags & ATA_FLAG_PIO_LBA48)) { + /* Unable to use DMA due to host limitation */ + tf->protocol = ATA_PROT_PIO; + index = dev->multi_count ? 0 : 4; } else { tf->protocol = ATA_PROT_DMA; index = 16; diff --git a/include/linux/libata.h b/include/linux/libata.h index af6624450f6..9e5db2949c5 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h @@ -126,16 +126,19 @@ enum { ATA_FLAG_SUSPENDED = (1 << 12), /* port is suspended */ + ATA_FLAG_PIO_LBA48 = (1 << 13), /* Host DMA engine is LBA28 only */ + ATA_FLAG_IRQ_MASK = (1 << 14), /* Mask IRQ in PIO xfers */ + ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */ ATA_QCFLAG_SG = (1 << 3), /* have s/g table? */ ATA_QCFLAG_SINGLE = (1 << 4), /* no s/g, just a single buffer */ ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, /* various lengths of time */ - ATA_TMOUT_EDD = 5 * HZ, /* hueristic */ + ATA_TMOUT_EDD = 5 * HZ, /* heuristic */ ATA_TMOUT_PIO = 30 * HZ, - ATA_TMOUT_BOOT = 30 * HZ, /* hueristic */ - ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* hueristic */ + ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ + ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ ATA_TMOUT_CDB = 30 * HZ, ATA_TMOUT_CDB_QUICK = 5 * HZ, ATA_TMOUT_INTERNAL = 30 * HZ, -- cgit v1.2.3-70-g09d2