aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ide/ide-floppy.c13
-rw-r--r--drivers/ide/ide-tape.c13
-rw-r--r--include/linux/ide.h28
3 files changed, 29 insertions, 25 deletions
diff --git a/drivers/ide/ide-floppy.c b/drivers/ide/ide-floppy.c
index 4d7e9ef82425..a63aba2c8265 100644
--- a/drivers/ide/ide-floppy.c
+++ b/drivers/ide/ide-floppy.c
@@ -61,10 +61,6 @@
61#define debug_log(fmt, args...) do {} while (0) 61#define debug_log(fmt, args...) do {} while (0)
62#endif 62#endif
63 63
64
65/* Some drives require a longer irq timeout. */
66#define IDEFLOPPY_WAIT_CMD (5 * WAIT_CMD)
67
68/* 64/*
69 * After each failed packet command we issue a request sense command and retry 65 * After each failed packet command we issue a request sense command and retry
70 * the packet command IDEFLOPPY_MAX_PC_RETRIES times. 66 * the packet command IDEFLOPPY_MAX_PC_RETRIES times.
@@ -226,7 +222,7 @@ static ide_startstop_t idefloppy_pc_intr(ide_drive_t *drive)
226 idefloppy_floppy_t *floppy = drive->driver_data; 222 idefloppy_floppy_t *floppy = drive->driver_data;
227 223
228 return ide_pc_intr(drive, floppy->pc, idefloppy_pc_intr, 224 return ide_pc_intr(drive, floppy->pc, idefloppy_pc_intr,
229 IDEFLOPPY_WAIT_CMD, NULL, idefloppy_update_buffers, 225 WAIT_FLOPPY_CMD, NULL, idefloppy_update_buffers,
230 idefloppy_retry_pc, NULL, ide_io_buffers); 226 idefloppy_retry_pc, NULL, ide_io_buffers);
231} 227}
232 228
@@ -244,10 +240,9 @@ static int idefloppy_transfer_pc(ide_drive_t *drive)
244 drive->hwif->tp_ops->output_data(drive, NULL, floppy->pc->c, 12); 240 drive->hwif->tp_ops->output_data(drive, NULL, floppy->pc->c, 12);
245 241
246 /* Timeout for the packet command */ 242 /* Timeout for the packet command */
247 return IDEFLOPPY_WAIT_CMD; 243 return WAIT_FLOPPY_CMD;
248} 244}
249 245
250
251/* 246/*
252 * Called as an interrupt (or directly). When the device says it's ready for a 247 * Called as an interrupt (or directly). When the device says it's ready for a
253 * packet, we schedule the packet transfer to occur about 2-3 ticks later in 248 * packet, we schedule the packet transfer to occur about 2-3 ticks later in
@@ -272,7 +267,7 @@ static ide_startstop_t idefloppy_start_pc_transfer(ide_drive_t *drive)
272 timeout = floppy->ticks; 267 timeout = floppy->ticks;
273 expiry = &idefloppy_transfer_pc; 268 expiry = &idefloppy_transfer_pc;
274 } else { 269 } else {
275 timeout = IDEFLOPPY_WAIT_CMD; 270 timeout = WAIT_FLOPPY_CMD;
276 expiry = NULL; 271 expiry = NULL;
277 } 272 }
278 273
@@ -322,7 +317,7 @@ static ide_startstop_t idefloppy_issue_pc(ide_drive_t *drive,
322 pc->retries++; 317 pc->retries++;
323 318
324 return ide_issue_pc(drive, pc, idefloppy_start_pc_transfer, 319 return ide_issue_pc(drive, pc, idefloppy_start_pc_transfer,
325 IDEFLOPPY_WAIT_CMD, NULL); 320 WAIT_FLOPPY_CMD, NULL);
326} 321}
327 322
328void ide_floppy_create_read_capacity_cmd(struct ide_atapi_pc *pc) 323void ide_floppy_create_read_capacity_cmd(struct ide_atapi_pc *pc)
diff --git a/drivers/ide/ide-tape.c b/drivers/ide/ide-tape.c
index 737dd7db6bb7..25190966ed39 100644
--- a/drivers/ide/ide-tape.c
+++ b/drivers/ide/ide-tape.c
@@ -81,13 +81,6 @@ enum {
81#define IDETAPE_MAX_PC_RETRIES 3 81#define IDETAPE_MAX_PC_RETRIES 3
82 82
83/* 83/*
84 * Some drives (for example, Seagate STT3401A Travan) require a very long
85 * timeout, because they don't return an interrupt or clear their busy bit
86 * until after the command completes (even retension commands).
87 */
88#define IDETAPE_WAIT_CMD (900*HZ)
89
90/*
91 * The following parameter is used to select the point in the internal tape fifo 84 * The following parameter is used to select the point in the internal tape fifo
92 * in which we will start to refill the buffer. Decreasing the following 85 * in which we will start to refill the buffer. Decreasing the following
93 * parameter will improve the system's latency and interactive response, while 86 * parameter will improve the system's latency and interactive response, while
@@ -663,7 +656,7 @@ static ide_startstop_t idetape_pc_intr(ide_drive_t *drive)
663{ 656{
664 idetape_tape_t *tape = drive->driver_data; 657 idetape_tape_t *tape = drive->driver_data;
665 658
666 return ide_pc_intr(drive, tape->pc, idetape_pc_intr, IDETAPE_WAIT_CMD, 659 return ide_pc_intr(drive, tape->pc, idetape_pc_intr, WAIT_TAPE_CMD,
667 NULL, idetape_update_buffers, idetape_retry_pc, 660 NULL, idetape_update_buffers, idetape_retry_pc,
668 ide_tape_handle_dsc, ide_tape_io_buffers); 661 ide_tape_handle_dsc, ide_tape_io_buffers);
669} 662}
@@ -709,7 +702,7 @@ static ide_startstop_t idetape_transfer_pc(ide_drive_t *drive)
709 idetape_tape_t *tape = drive->driver_data; 702 idetape_tape_t *tape = drive->driver_data;
710 703
711 return ide_transfer_pc(drive, tape->pc, idetape_pc_intr, 704 return ide_transfer_pc(drive, tape->pc, idetape_pc_intr,
712 IDETAPE_WAIT_CMD, NULL); 705 WAIT_TAPE_CMD, NULL);
713} 706}
714 707
715static ide_startstop_t idetape_issue_pc(ide_drive_t *drive, 708static ide_startstop_t idetape_issue_pc(ide_drive_t *drive,
@@ -758,7 +751,7 @@ static ide_startstop_t idetape_issue_pc(ide_drive_t *drive,
758 pc->retries++; 751 pc->retries++;
759 752
760 return ide_issue_pc(drive, pc, idetape_transfer_pc, 753 return ide_issue_pc(drive, pc, idetape_transfer_pc,
761 IDETAPE_WAIT_CMD, NULL); 754 WAIT_TAPE_CMD, NULL);
762} 755}
763 756
764/* A mode sense command is used to "sense" tape parameters. */ 757/* A mode sense command is used to "sense" tape parameters. */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 55098eed3b21..a9eced25acce 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -133,12 +133,28 @@ struct ide_io_ports {
133/* 133/*
134 * Timeouts for various operations: 134 * Timeouts for various operations:
135 */ 135 */
136#define WAIT_DRQ (HZ/10) /* 100msec - spec allows up to 20ms */ 136enum {
137#define WAIT_READY (5*HZ) /* 5sec - some laptops are very slow */ 137 /* spec allows up to 20ms */
138#define WAIT_PIDENTIFY (10*HZ) /* 10sec - should be less than 3ms (?), if all ATAPI CD is closed at boot */ 138 WAIT_DRQ = HZ / 10, /* 100ms */
139#define WAIT_WORSTCASE (30*HZ) /* 30sec - worst case when spinning up */ 139 /* some laptops are very slow */
140#define WAIT_CMD (10*HZ) /* 10sec - maximum wait for an IRQ to happen */ 140 WAIT_READY = 5 * HZ, /* 5s */
141#define WAIT_MIN_SLEEP (2*HZ/100) /* 20msec - minimum sleep time */ 141 /* should be less than 3ms (?), if all ATAPI CD is closed at boot */
142 WAIT_PIDENTIFY = 10 * HZ, /* 10s */
143 /* worst case when spinning up */
144 WAIT_WORSTCASE = 30 * HZ, /* 30s */
145 /* maximum wait for an IRQ to happen */
146 WAIT_CMD = 10 * HZ, /* 10s */
147 /* Some drives require a longer IRQ timeout. */
148 WAIT_FLOPPY_CMD = 50 * HZ, /* 50s */
149 /*
150 * Some drives (for example, Seagate STT3401A Travan) require a very
151 * long timeout, because they don't return an interrupt or clear their
152 * BSY bit until after the command completes (even retension commands).
153 */
154 WAIT_TAPE_CMD = 900 * HZ, /* 900s */
155 /* minimum sleep time */
156 WAIT_MIN_SLEEP = HZ / 50, /* 20ms */
157};
142 158
143/* 159/*
144 * Op codes for special requests to be handled by ide_special_rq(). 160 * Op codes for special requests to be handled by ide_special_rq().