diff options
-rw-r--r-- | drivers/ide/ide-io.c | 7 | ||||
-rw-r--r-- | include/linux/ide.h | 9 |
2 files changed, 6 insertions, 10 deletions
diff --git a/drivers/ide/ide-io.c b/drivers/ide/ide-io.c index 5f0ed59bac6b..11b602bb5741 100644 --- a/drivers/ide/ide-io.c +++ b/drivers/ide/ide-io.c | |||
@@ -78,8 +78,9 @@ static int __ide_end_request(ide_drive_t *drive, struct request *rq, | |||
78 | * decide whether to reenable DMA -- 3 is a random magic for now, | 78 | * decide whether to reenable DMA -- 3 is a random magic for now, |
79 | * if we DMA timeout more than 3 times, just stay in PIO | 79 | * if we DMA timeout more than 3 times, just stay in PIO |
80 | */ | 80 | */ |
81 | if (drive->state == DMA_PIO_RETRY && drive->retry_pio <= 3) { | 81 | if ((drive->dev_flags & IDE_DFLAG_DMA_PIO_RETRY) && |
82 | drive->state = 0; | 82 | drive->retry_pio <= 3) { |
83 | drive->dev_flags &= ~IDE_DFLAG_DMA_PIO_RETRY; | ||
83 | ide_dma_on(drive); | 84 | ide_dma_on(drive); |
84 | } | 85 | } |
85 | 86 | ||
@@ -1195,8 +1196,8 @@ static ide_startstop_t ide_dma_timeout_retry(ide_drive_t *drive, int error) | |||
1195 | * a timeout -- we'll reenable after we finish this next request | 1196 | * a timeout -- we'll reenable after we finish this next request |
1196 | * (or rather the first chunk of it) in pio. | 1197 | * (or rather the first chunk of it) in pio. |
1197 | */ | 1198 | */ |
1199 | drive->dev_flags |= IDE_DFLAG_DMA_PIO_RETRY; | ||
1198 | drive->retry_pio++; | 1200 | drive->retry_pio++; |
1199 | drive->state = DMA_PIO_RETRY; | ||
1200 | ide_dma_off_quietly(drive); | 1201 | ide_dma_off_quietly(drive); |
1201 | 1202 | ||
1202 | /* | 1203 | /* |
diff --git a/include/linux/ide.h b/include/linux/ide.h index b538d2e6dcbb..230bd9dd851d 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -48,12 +48,6 @@ typedef unsigned char byte; /* used everywhere */ | |||
48 | #define ERROR_RESET 3 /* Reset controller every 4th retry */ | 48 | #define ERROR_RESET 3 /* Reset controller every 4th retry */ |
49 | #define ERROR_RECAL 1 /* Recalibrate every 2nd retry */ | 49 | #define ERROR_RECAL 1 /* Recalibrate every 2nd retry */ |
50 | 50 | ||
51 | /* | ||
52 | * state flags | ||
53 | */ | ||
54 | |||
55 | #define DMA_PIO_RETRY 1 /* retrying in PIO */ | ||
56 | |||
57 | #define HWIF(drive) ((ide_hwif_t *)((drive)->hwif)) | 51 | #define HWIF(drive) ((ide_hwif_t *)((drive)->hwif)) |
58 | #define HWGROUP(drive) ((ide_hwgroup_t *)(HWIF(drive)->hwgroup)) | 52 | #define HWGROUP(drive) ((ide_hwgroup_t *)(HWIF(drive)->hwgroup)) |
59 | 53 | ||
@@ -506,6 +500,8 @@ enum { | |||
506 | IDE_DFLAG_WCACHE = (1 << 23), | 500 | IDE_DFLAG_WCACHE = (1 << 23), |
507 | /* used for ignoring ATA_DF */ | 501 | /* used for ignoring ATA_DF */ |
508 | IDE_DFLAG_NOWERR = (1 << 24), | 502 | IDE_DFLAG_NOWERR = (1 << 24), |
503 | /* retrying in PIO */ | ||
504 | IDE_DFLAG_DMA_PIO_RETRY = (1 << 25), | ||
509 | }; | 505 | }; |
510 | 506 | ||
511 | struct ide_drive_s { | 507 | struct ide_drive_s { |
@@ -535,7 +531,6 @@ struct ide_drive_s { | |||
535 | select_t select; /* basic drive/head select reg value */ | 531 | select_t select; /* basic drive/head select reg value */ |
536 | 532 | ||
537 | u8 retry_pio; /* retrying dma capable host in pio */ | 533 | u8 retry_pio; /* retrying dma capable host in pio */ |
538 | u8 state; /* retry state */ | ||
539 | u8 waiting_for_dma; /* dma currently in progress */ | 534 | u8 waiting_for_dma; /* dma currently in progress */ |
540 | 535 | ||
541 | u8 quirk_list; /* considered quirky, set for a specific host */ | 536 | u8 quirk_list; /* considered quirky, set for a specific host */ |