Commit d6e2955a6b82d2312b5ff885ce13c8ab54d59d96
1 parent
de699ad595
Exists in
master
and in
4 other branches
ide: move IDE{FLOPPY,TAPE}_WAIT_CMD defines to <linux/ide.h>
While at it: * IDE{FLOPPY,TAPE}_WAIT_CMD -> WAIT_{FLOPPY,TAPE}_CMD * Use enum for WAIT_* defines. There should be no functional changes caused by this patch. Acked-by: Borislav Petkov <petkovbb@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Showing 3 changed files with 29 additions and 25 deletions Side-by-side Diff
drivers/ide/ide-floppy.c
... | ... | @@ -61,10 +61,6 @@ |
61 | 61 | #define debug_log(fmt, args...) do {} while (0) |
62 | 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 | 65 | * After each failed packet command we issue a request sense command and retry |
70 | 66 | * the packet command IDEFLOPPY_MAX_PC_RETRIES times. |
... | ... | @@ -226,7 +222,7 @@ |
226 | 222 | idefloppy_floppy_t *floppy = drive->driver_data; |
227 | 223 | |
228 | 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 | 226 | idefloppy_retry_pc, NULL, ide_io_buffers); |
231 | 227 | } |
232 | 228 | |
233 | 229 | |
... | ... | @@ -244,10 +240,9 @@ |
244 | 240 | drive->hwif->tp_ops->output_data(drive, NULL, floppy->pc->c, 12); |
245 | 241 | |
246 | 242 | /* Timeout for the packet command */ |
247 | - return IDEFLOPPY_WAIT_CMD; | |
243 | + return WAIT_FLOPPY_CMD; | |
248 | 244 | } |
249 | 245 | |
250 | - | |
251 | 246 | /* |
252 | 247 | * Called as an interrupt (or directly). When the device says it's ready for a |
253 | 248 | * packet, we schedule the packet transfer to occur about 2-3 ticks later in |
... | ... | @@ -272,7 +267,7 @@ |
272 | 267 | timeout = floppy->ticks; |
273 | 268 | expiry = &idefloppy_transfer_pc; |
274 | 269 | } else { |
275 | - timeout = IDEFLOPPY_WAIT_CMD; | |
270 | + timeout = WAIT_FLOPPY_CMD; | |
276 | 271 | expiry = NULL; |
277 | 272 | } |
278 | 273 | |
... | ... | @@ -322,7 +317,7 @@ |
322 | 317 | pc->retries++; |
323 | 318 | |
324 | 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 | |
328 | 323 | void ide_floppy_create_read_capacity_cmd(struct ide_atapi_pc *pc) |
drivers/ide/ide-tape.c
... | ... | @@ -81,13 +81,6 @@ |
81 | 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 | 84 | * The following parameter is used to select the point in the internal tape fifo |
92 | 85 | * in which we will start to refill the buffer. Decreasing the following |
93 | 86 | * parameter will improve the system's latency and interactive response, while |
... | ... | @@ -663,7 +656,7 @@ |
663 | 656 | { |
664 | 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 | 660 | NULL, idetape_update_buffers, idetape_retry_pc, |
668 | 661 | ide_tape_handle_dsc, ide_tape_io_buffers); |
669 | 662 | } |
... | ... | @@ -709,7 +702,7 @@ |
709 | 702 | idetape_tape_t *tape = drive->driver_data; |
710 | 703 | |
711 | 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 | |
715 | 708 | static ide_startstop_t idetape_issue_pc(ide_drive_t *drive, |
... | ... | @@ -758,7 +751,7 @@ |
758 | 751 | pc->retries++; |
759 | 752 | |
760 | 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 | 757 | /* A mode sense command is used to "sense" tape parameters. */ |
include/linux/ide.h
... | ... | @@ -133,12 +133,28 @@ |
133 | 133 | /* |
134 | 134 | * Timeouts for various operations: |
135 | 135 | */ |
136 | -#define WAIT_DRQ (HZ/10) /* 100msec - spec allows up to 20ms */ | |
137 | -#define WAIT_READY (5*HZ) /* 5sec - some laptops are very slow */ | |
138 | -#define WAIT_PIDENTIFY (10*HZ) /* 10sec - should be less than 3ms (?), if all ATAPI CD is closed at boot */ | |
139 | -#define WAIT_WORSTCASE (30*HZ) /* 30sec - worst case when spinning up */ | |
140 | -#define WAIT_CMD (10*HZ) /* 10sec - maximum wait for an IRQ to happen */ | |
141 | -#define WAIT_MIN_SLEEP (2*HZ/100) /* 20msec - minimum sleep time */ | |
136 | +enum { | |
137 | + /* spec allows up to 20ms */ | |
138 | + WAIT_DRQ = HZ / 10, /* 100ms */ | |
139 | + /* some laptops are very slow */ | |
140 | + WAIT_READY = 5 * HZ, /* 5s */ | |
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 | 160 | * Op codes for special requests to be handled by ide_special_rq(). |