aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2010-01-18 12:13:57 -0500
committerJeff Garzik <jgarzik@redhat.com>2010-03-01 14:58:44 -0500
commit9e8808a99c6decdb4ab78081a26d3752339f424c (patch)
treeb0f37ffbebe22dbf22f6a8febb35c4de8770d9f4 /drivers/ata
parent02d1d6160ffe13f4ebc6f85f72366a5da0b1fb9b (diff)
libata: fix CFA handling in ide_timing_compute()
Use standard cycle timing for CFA PIO5 and PIO6 modes. Based on commit 74638c8 for IDE subsystem. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/ata')
-rw-r--r--drivers/ata/libata-core.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c
index 6728328f3bea..9c77b0d1a9d0 100644
--- a/drivers/ata/libata-core.c
+++ b/drivers/ata/libata-core.c
@@ -3211,6 +3211,7 @@ const struct ata_timing *ata_timing_find_mode(u8 xfer_mode)
3211int ata_timing_compute(struct ata_device *adev, unsigned short speed, 3211int ata_timing_compute(struct ata_device *adev, unsigned short speed,
3212 struct ata_timing *t, int T, int UT) 3212 struct ata_timing *t, int T, int UT)
3213{ 3213{
3214 const u16 *id = adev->id;
3214 const struct ata_timing *s; 3215 const struct ata_timing *s;
3215 struct ata_timing p; 3216 struct ata_timing p;
3216 3217
@@ -3228,14 +3229,18 @@ int ata_timing_compute(struct ata_device *adev, unsigned short speed,
3228 * PIO/MW_DMA cycle timing. 3229 * PIO/MW_DMA cycle timing.
3229 */ 3230 */
3230 3231
3231 if (adev->id[ATA_ID_FIELD_VALID] & 2) { /* EIDE drive */ 3232 if (id[ATA_ID_FIELD_VALID] & 2) { /* EIDE drive */
3232 memset(&p, 0, sizeof(p)); 3233 memset(&p, 0, sizeof(p));
3234
3233 if (speed >= XFER_PIO_0 && speed <= XFER_SW_DMA_0) { 3235 if (speed >= XFER_PIO_0 && speed <= XFER_SW_DMA_0) {
3234 if (speed <= XFER_PIO_2) p.cycle = p.cyc8b = adev->id[ATA_ID_EIDE_PIO]; 3236 if (speed <= XFER_PIO_2)
3235 else p.cycle = p.cyc8b = adev->id[ATA_ID_EIDE_PIO_IORDY]; 3237 p.cycle = p.cyc8b = id[ATA_ID_EIDE_PIO];
3236 } else if (speed >= XFER_MW_DMA_0 && speed <= XFER_MW_DMA_2) { 3238 else if ((speed <= XFER_PIO_4) ||
3237 p.cycle = adev->id[ATA_ID_EIDE_DMA_MIN]; 3239 (speed == XFER_PIO_5 && !ata_id_is_cfa(id)))
3238 } 3240 p.cycle = p.cyc8b = id[ATA_ID_EIDE_PIO_IORDY];
3241 } else if (speed >= XFER_MW_DMA_0 && speed <= XFER_MW_DMA_2)
3242 p.cycle = id[ATA_ID_EIDE_DMA_MIN];
3243
3239 ata_timing_merge(&p, t, t, ATA_TIMING_CYCLE | ATA_TIMING_CYC8B); 3244 ata_timing_merge(&p, t, t, ATA_TIMING_CYCLE | ATA_TIMING_CYC8B);
3240 } 3245 }
3241 3246