diff options
author | Kees Cook <keescook@chromium.org> | 2017-10-16 19:44:30 -0400 |
---|---|---|
committer | Heiko Carstens <heiko.carstens@de.ibm.com> | 2017-11-14 05:01:39 -0500 |
commit | c9602ee7d14a72086d10b50ac68e1ea5c01e7579 (patch) | |
tree | 69c4e128d8494649875a09c135fe61d336488464 /drivers/s390 | |
parent | 846d0c6f794c4bef90a021b18cedde598758507c (diff) |
s390/sclp: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly. Instead of creating an external static
data variable, just define a separate callback which encodes the "force
restart" desire.
Cc: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
[heiko.carstens@de.ibm.com: get rid of compile warning]
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/char/con3215.c | 6 | ||||
-rw-r--r-- | drivers/s390/char/con3270.c | 10 | ||||
-rw-r--r-- | drivers/s390/char/sclp.c | 45 | ||||
-rw-r--r-- | drivers/s390/char/sclp_con.c | 5 | ||||
-rw-r--r-- | drivers/s390/char/sclp_tty.c | 5 | ||||
-rw-r--r-- | drivers/s390/char/sclp_vt220.c | 6 | ||||
-rw-r--r-- | drivers/s390/char/tape_core.c | 14 | ||||
-rw-r--r-- | drivers/s390/char/tty3270.c | 8 |
8 files changed, 48 insertions, 51 deletions
diff --git a/drivers/s390/char/con3215.c b/drivers/s390/char/con3215.c index 353f0bebcf8c..8c9d412b6d33 100644 --- a/drivers/s390/char/con3215.c +++ b/drivers/s390/char/con3215.c | |||
@@ -282,9 +282,9 @@ static void raw3215_start_io(struct raw3215_info *raw) | |||
282 | /* | 282 | /* |
283 | * Function to start a delayed output after RAW3215_TIMEOUT seconds | 283 | * Function to start a delayed output after RAW3215_TIMEOUT seconds |
284 | */ | 284 | */ |
285 | static void raw3215_timeout(unsigned long __data) | 285 | static void raw3215_timeout(struct timer_list *t) |
286 | { | 286 | { |
287 | struct raw3215_info *raw = (struct raw3215_info *) __data; | 287 | struct raw3215_info *raw = from_timer(raw, t, timer); |
288 | unsigned long flags; | 288 | unsigned long flags; |
289 | 289 | ||
290 | spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); | 290 | spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); |
@@ -670,7 +670,7 @@ static struct raw3215_info *raw3215_alloc_info(void) | |||
670 | return NULL; | 670 | return NULL; |
671 | } | 671 | } |
672 | 672 | ||
673 | setup_timer(&info->timer, raw3215_timeout, (unsigned long)info); | 673 | timer_setup(&info->timer, raw3215_timeout, 0); |
674 | init_waitqueue_head(&info->empty_wait); | 674 | init_waitqueue_head(&info->empty_wait); |
675 | tasklet_init(&info->tlet, raw3215_wakeup, (unsigned long)info); | 675 | tasklet_init(&info->tlet, raw3215_wakeup, (unsigned long)info); |
676 | tty_port_init(&info->port); | 676 | tty_port_init(&info->port); |
diff --git a/drivers/s390/char/con3270.c b/drivers/s390/char/con3270.c index be3e3c1206c2..fd2146bcc0ad 100644 --- a/drivers/s390/char/con3270.c +++ b/drivers/s390/char/con3270.c | |||
@@ -69,7 +69,7 @@ static struct con3270 *condev; | |||
69 | #define CON_UPDATE_STATUS 4 /* Update status line. */ | 69 | #define CON_UPDATE_STATUS 4 /* Update status line. */ |
70 | #define CON_UPDATE_ALL 8 /* Recreate screen. */ | 70 | #define CON_UPDATE_ALL 8 /* Recreate screen. */ |
71 | 71 | ||
72 | static void con3270_update(struct con3270 *); | 72 | static void con3270_update(struct timer_list *); |
73 | 73 | ||
74 | /* | 74 | /* |
75 | * Setup timeout for a device. On timeout trigger an update. | 75 | * Setup timeout for a device. On timeout trigger an update. |
@@ -205,8 +205,9 @@ con3270_write_callback(struct raw3270_request *rq, void *data) | |||
205 | * Update console display. | 205 | * Update console display. |
206 | */ | 206 | */ |
207 | static void | 207 | static void |
208 | con3270_update(struct con3270 *cp) | 208 | con3270_update(struct timer_list *t) |
209 | { | 209 | { |
210 | struct con3270 *cp = from_timer(cp, t, timer); | ||
210 | struct raw3270_request *wrq; | 211 | struct raw3270_request *wrq; |
211 | char wcc, prolog[6]; | 212 | char wcc, prolog[6]; |
212 | unsigned long flags; | 213 | unsigned long flags; |
@@ -552,7 +553,7 @@ con3270_flush(void) | |||
552 | con3270_update_status(cp); | 553 | con3270_update_status(cp); |
553 | while (cp->update_flags != 0) { | 554 | while (cp->update_flags != 0) { |
554 | spin_unlock_irqrestore(&cp->view.lock, flags); | 555 | spin_unlock_irqrestore(&cp->view.lock, flags); |
555 | con3270_update(cp); | 556 | con3270_update(&cp->timer); |
556 | spin_lock_irqsave(&cp->view.lock, flags); | 557 | spin_lock_irqsave(&cp->view.lock, flags); |
557 | con3270_wait_write(cp); | 558 | con3270_wait_write(cp); |
558 | } | 559 | } |
@@ -623,8 +624,7 @@ con3270_init(void) | |||
623 | 624 | ||
624 | INIT_LIST_HEAD(&condev->lines); | 625 | INIT_LIST_HEAD(&condev->lines); |
625 | INIT_LIST_HEAD(&condev->update); | 626 | INIT_LIST_HEAD(&condev->update); |
626 | setup_timer(&condev->timer, (void (*)(unsigned long)) con3270_update, | 627 | timer_setup(&condev->timer, con3270_update, 0); |
627 | (unsigned long) condev); | ||
628 | tasklet_init(&condev->readlet, | 628 | tasklet_init(&condev->readlet, |
629 | (void (*)(unsigned long)) con3270_read_tasklet, | 629 | (void (*)(unsigned long)) con3270_read_tasklet, |
630 | (unsigned long) condev->read); | 630 | (unsigned long) condev->read); |
diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c index 41d8aa96801f..9b4c61c1e309 100644 --- a/drivers/s390/char/sclp.c +++ b/drivers/s390/char/sclp.c | |||
@@ -136,6 +136,7 @@ static enum sclp_suspend_state_t { | |||
136 | #define SCLP_BUSY_INTERVAL 10 | 136 | #define SCLP_BUSY_INTERVAL 10 |
137 | #define SCLP_RETRY_INTERVAL 30 | 137 | #define SCLP_RETRY_INTERVAL 30 |
138 | 138 | ||
139 | static void sclp_request_timeout(bool force_restart); | ||
139 | static void sclp_process_queue(void); | 140 | static void sclp_process_queue(void); |
140 | static void __sclp_make_read_req(void); | 141 | static void __sclp_make_read_req(void); |
141 | static int sclp_init_mask(int calculate); | 142 | static int sclp_init_mask(int calculate); |
@@ -154,25 +155,32 @@ __sclp_queue_read_req(void) | |||
154 | 155 | ||
155 | /* Set up request retry timer. Called while sclp_lock is locked. */ | 156 | /* Set up request retry timer. Called while sclp_lock is locked. */ |
156 | static inline void | 157 | static inline void |
157 | __sclp_set_request_timer(unsigned long time, void (*function)(unsigned long), | 158 | __sclp_set_request_timer(unsigned long time, void (*cb)(struct timer_list *)) |
158 | unsigned long data) | ||
159 | { | 159 | { |
160 | del_timer(&sclp_request_timer); | 160 | del_timer(&sclp_request_timer); |
161 | sclp_request_timer.function = function; | 161 | sclp_request_timer.function = (TIMER_FUNC_TYPE)cb; |
162 | sclp_request_timer.data = data; | ||
163 | sclp_request_timer.expires = jiffies + time; | 162 | sclp_request_timer.expires = jiffies + time; |
164 | add_timer(&sclp_request_timer); | 163 | add_timer(&sclp_request_timer); |
165 | } | 164 | } |
166 | 165 | ||
167 | /* Request timeout handler. Restart the request queue. If DATA is non-zero, | 166 | static void sclp_request_timeout_restart(struct timer_list *unused) |
167 | { | ||
168 | sclp_request_timeout(true); | ||
169 | } | ||
170 | |||
171 | static void sclp_request_timeout_normal(struct timer_list *unused) | ||
172 | { | ||
173 | sclp_request_timeout(false); | ||
174 | } | ||
175 | |||
176 | /* Request timeout handler. Restart the request queue. If force_restart, | ||
168 | * force restart of running request. */ | 177 | * force restart of running request. */ |
169 | static void | 178 | static void sclp_request_timeout(bool force_restart) |
170 | sclp_request_timeout(unsigned long data) | ||
171 | { | 179 | { |
172 | unsigned long flags; | 180 | unsigned long flags; |
173 | 181 | ||
174 | spin_lock_irqsave(&sclp_lock, flags); | 182 | spin_lock_irqsave(&sclp_lock, flags); |
175 | if (data) { | 183 | if (force_restart) { |
176 | if (sclp_running_state == sclp_running_state_running) { | 184 | if (sclp_running_state == sclp_running_state_running) { |
177 | /* Break running state and queue NOP read event request | 185 | /* Break running state and queue NOP read event request |
178 | * to get a defined interface state. */ | 186 | * to get a defined interface state. */ |
@@ -181,7 +189,7 @@ sclp_request_timeout(unsigned long data) | |||
181 | } | 189 | } |
182 | } else { | 190 | } else { |
183 | __sclp_set_request_timer(SCLP_BUSY_INTERVAL * HZ, | 191 | __sclp_set_request_timer(SCLP_BUSY_INTERVAL * HZ, |
184 | sclp_request_timeout, 0); | 192 | sclp_request_timeout_normal); |
185 | } | 193 | } |
186 | spin_unlock_irqrestore(&sclp_lock, flags); | 194 | spin_unlock_irqrestore(&sclp_lock, flags); |
187 | sclp_process_queue(); | 195 | sclp_process_queue(); |
@@ -239,7 +247,7 @@ out: | |||
239 | * invokes callback. This timer can be set per request in situations where | 247 | * invokes callback. This timer can be set per request in situations where |
240 | * waiting too long would be harmful to the system, e.g. during SE reboot. | 248 | * waiting too long would be harmful to the system, e.g. during SE reboot. |
241 | */ | 249 | */ |
242 | static void sclp_req_queue_timeout(unsigned long data) | 250 | static void sclp_req_queue_timeout(struct timer_list *unused) |
243 | { | 251 | { |
244 | unsigned long flags, expires_next; | 252 | unsigned long flags, expires_next; |
245 | struct sclp_req *req; | 253 | struct sclp_req *req; |
@@ -276,12 +284,12 @@ __sclp_start_request(struct sclp_req *req) | |||
276 | req->status = SCLP_REQ_RUNNING; | 284 | req->status = SCLP_REQ_RUNNING; |
277 | sclp_running_state = sclp_running_state_running; | 285 | sclp_running_state = sclp_running_state_running; |
278 | __sclp_set_request_timer(SCLP_RETRY_INTERVAL * HZ, | 286 | __sclp_set_request_timer(SCLP_RETRY_INTERVAL * HZ, |
279 | sclp_request_timeout, 1); | 287 | sclp_request_timeout_restart); |
280 | return 0; | 288 | return 0; |
281 | } else if (rc == -EBUSY) { | 289 | } else if (rc == -EBUSY) { |
282 | /* Try again later */ | 290 | /* Try again later */ |
283 | __sclp_set_request_timer(SCLP_BUSY_INTERVAL * HZ, | 291 | __sclp_set_request_timer(SCLP_BUSY_INTERVAL * HZ, |
284 | sclp_request_timeout, 0); | 292 | sclp_request_timeout_normal); |
285 | return 0; | 293 | return 0; |
286 | } | 294 | } |
287 | /* Request failed */ | 295 | /* Request failed */ |
@@ -315,7 +323,7 @@ sclp_process_queue(void) | |||
315 | /* Cannot abort already submitted request - could still | 323 | /* Cannot abort already submitted request - could still |
316 | * be active at the SCLP */ | 324 | * be active at the SCLP */ |
317 | __sclp_set_request_timer(SCLP_BUSY_INTERVAL * HZ, | 325 | __sclp_set_request_timer(SCLP_BUSY_INTERVAL * HZ, |
318 | sclp_request_timeout, 0); | 326 | sclp_request_timeout_normal); |
319 | break; | 327 | break; |
320 | } | 328 | } |
321 | do_post: | 329 | do_post: |
@@ -558,7 +566,7 @@ sclp_sync_wait(void) | |||
558 | if (timer_pending(&sclp_request_timer) && | 566 | if (timer_pending(&sclp_request_timer) && |
559 | get_tod_clock_fast() > timeout && | 567 | get_tod_clock_fast() > timeout && |
560 | del_timer(&sclp_request_timer)) | 568 | del_timer(&sclp_request_timer)) |
561 | sclp_request_timer.function(sclp_request_timer.data); | 569 | sclp_request_timer.function((TIMER_DATA_TYPE)&sclp_request_timer); |
562 | cpu_relax(); | 570 | cpu_relax(); |
563 | } | 571 | } |
564 | local_irq_disable(); | 572 | local_irq_disable(); |
@@ -915,7 +923,7 @@ static void sclp_check_handler(struct ext_code ext_code, | |||
915 | 923 | ||
916 | /* Initial init mask request timed out. Modify request state to failed. */ | 924 | /* Initial init mask request timed out. Modify request state to failed. */ |
917 | static void | 925 | static void |
918 | sclp_check_timeout(unsigned long data) | 926 | sclp_check_timeout(struct timer_list *unused) |
919 | { | 927 | { |
920 | unsigned long flags; | 928 | unsigned long flags; |
921 | 929 | ||
@@ -954,7 +962,7 @@ sclp_check_interface(void) | |||
954 | sclp_init_req.status = SCLP_REQ_RUNNING; | 962 | sclp_init_req.status = SCLP_REQ_RUNNING; |
955 | sclp_running_state = sclp_running_state_running; | 963 | sclp_running_state = sclp_running_state_running; |
956 | __sclp_set_request_timer(SCLP_RETRY_INTERVAL * HZ, | 964 | __sclp_set_request_timer(SCLP_RETRY_INTERVAL * HZ, |
957 | sclp_check_timeout, 0); | 965 | sclp_check_timeout); |
958 | spin_unlock_irqrestore(&sclp_lock, flags); | 966 | spin_unlock_irqrestore(&sclp_lock, flags); |
959 | /* Enable service-signal interruption - needs to happen | 967 | /* Enable service-signal interruption - needs to happen |
960 | * with IRQs enabled. */ | 968 | * with IRQs enabled. */ |
@@ -1159,9 +1167,8 @@ sclp_init(void) | |||
1159 | INIT_LIST_HEAD(&sclp_req_queue); | 1167 | INIT_LIST_HEAD(&sclp_req_queue); |
1160 | INIT_LIST_HEAD(&sclp_reg_list); | 1168 | INIT_LIST_HEAD(&sclp_reg_list); |
1161 | list_add(&sclp_state_change_event.list, &sclp_reg_list); | 1169 | list_add(&sclp_state_change_event.list, &sclp_reg_list); |
1162 | init_timer(&sclp_request_timer); | 1170 | timer_setup(&sclp_request_timer, NULL, 0); |
1163 | init_timer(&sclp_queue_timer); | 1171 | timer_setup(&sclp_queue_timer, sclp_req_queue_timeout, 0); |
1164 | sclp_queue_timer.function = sclp_req_queue_timeout; | ||
1165 | /* Check interface */ | 1172 | /* Check interface */ |
1166 | spin_unlock_irqrestore(&sclp_lock, flags); | 1173 | spin_unlock_irqrestore(&sclp_lock, flags); |
1167 | rc = sclp_check_interface(); | 1174 | rc = sclp_check_interface(); |
diff --git a/drivers/s390/char/sclp_con.c b/drivers/s390/char/sclp_con.c index 7027e61a6931..8966a1c1b548 100644 --- a/drivers/s390/char/sclp_con.c +++ b/drivers/s390/char/sclp_con.c | |||
@@ -125,7 +125,7 @@ static void sclp_console_sync_queue(void) | |||
125 | * temporary write buffer without further waiting on a final new line. | 125 | * temporary write buffer without further waiting on a final new line. |
126 | */ | 126 | */ |
127 | static void | 127 | static void |
128 | sclp_console_timeout(unsigned long data) | 128 | sclp_console_timeout(struct timer_list *unused) |
129 | { | 129 | { |
130 | sclp_conbuf_emit(); | 130 | sclp_conbuf_emit(); |
131 | } | 131 | } |
@@ -211,7 +211,6 @@ sclp_console_write(struct console *console, const char *message, | |||
211 | /* Setup timer to output current console buffer after 1/10 second */ | 211 | /* Setup timer to output current console buffer after 1/10 second */ |
212 | if (sclp_conbuf != NULL && sclp_chars_in_buffer(sclp_conbuf) != 0 && | 212 | if (sclp_conbuf != NULL && sclp_chars_in_buffer(sclp_conbuf) != 0 && |
213 | !timer_pending(&sclp_con_timer)) { | 213 | !timer_pending(&sclp_con_timer)) { |
214 | setup_timer(&sclp_con_timer, sclp_console_timeout, 0UL); | ||
215 | mod_timer(&sclp_con_timer, jiffies + HZ / 10); | 214 | mod_timer(&sclp_con_timer, jiffies + HZ / 10); |
216 | } | 215 | } |
217 | out: | 216 | out: |
@@ -332,7 +331,7 @@ sclp_console_init(void) | |||
332 | INIT_LIST_HEAD(&sclp_con_outqueue); | 331 | INIT_LIST_HEAD(&sclp_con_outqueue); |
333 | spin_lock_init(&sclp_con_lock); | 332 | spin_lock_init(&sclp_con_lock); |
334 | sclp_conbuf = NULL; | 333 | sclp_conbuf = NULL; |
335 | init_timer(&sclp_con_timer); | 334 | timer_setup(&sclp_con_timer, sclp_console_timeout, 0); |
336 | 335 | ||
337 | /* Set output format */ | 336 | /* Set output format */ |
338 | if (MACHINE_IS_VM) | 337 | if (MACHINE_IS_VM) |
diff --git a/drivers/s390/char/sclp_tty.c b/drivers/s390/char/sclp_tty.c index 1cceefdc03e0..9f7b87d6d434 100644 --- a/drivers/s390/char/sclp_tty.c +++ b/drivers/s390/char/sclp_tty.c | |||
@@ -151,7 +151,7 @@ __sclp_ttybuf_emit(struct sclp_buffer *buffer) | |||
151 | * temporary write buffer. | 151 | * temporary write buffer. |
152 | */ | 152 | */ |
153 | static void | 153 | static void |
154 | sclp_tty_timeout(unsigned long data) | 154 | sclp_tty_timeout(struct timer_list *unused) |
155 | { | 155 | { |
156 | unsigned long flags; | 156 | unsigned long flags; |
157 | struct sclp_buffer *buf; | 157 | struct sclp_buffer *buf; |
@@ -218,7 +218,6 @@ static int sclp_tty_write_string(const unsigned char *str, int count, int may_fa | |||
218 | /* Setup timer to output current console buffer after 1/10 second */ | 218 | /* Setup timer to output current console buffer after 1/10 second */ |
219 | if (sclp_ttybuf && sclp_chars_in_buffer(sclp_ttybuf) && | 219 | if (sclp_ttybuf && sclp_chars_in_buffer(sclp_ttybuf) && |
220 | !timer_pending(&sclp_tty_timer)) { | 220 | !timer_pending(&sclp_tty_timer)) { |
221 | setup_timer(&sclp_tty_timer, sclp_tty_timeout, 0UL); | ||
222 | mod_timer(&sclp_tty_timer, jiffies + HZ / 10); | 221 | mod_timer(&sclp_tty_timer, jiffies + HZ / 10); |
223 | } | 222 | } |
224 | spin_unlock_irqrestore(&sclp_tty_lock, flags); | 223 | spin_unlock_irqrestore(&sclp_tty_lock, flags); |
@@ -526,7 +525,7 @@ sclp_tty_init(void) | |||
526 | } | 525 | } |
527 | INIT_LIST_HEAD(&sclp_tty_outqueue); | 526 | INIT_LIST_HEAD(&sclp_tty_outqueue); |
528 | spin_lock_init(&sclp_tty_lock); | 527 | spin_lock_init(&sclp_tty_lock); |
529 | init_timer(&sclp_tty_timer); | 528 | timer_setup(&sclp_tty_timer, sclp_tty_timeout, 0); |
530 | sclp_ttybuf = NULL; | 529 | sclp_ttybuf = NULL; |
531 | sclp_tty_buffer_count = 0; | 530 | sclp_tty_buffer_count = 0; |
532 | if (MACHINE_IS_VM) { | 531 | if (MACHINE_IS_VM) { |
diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c index e84395d71389..3f9a6ef650fa 100644 --- a/drivers/s390/char/sclp_vt220.c +++ b/drivers/s390/char/sclp_vt220.c | |||
@@ -357,7 +357,7 @@ sclp_vt220_add_msg(struct sclp_vt220_request *request, | |||
357 | * Emit buffer after having waited long enough for more data to arrive. | 357 | * Emit buffer after having waited long enough for more data to arrive. |
358 | */ | 358 | */ |
359 | static void | 359 | static void |
360 | sclp_vt220_timeout(unsigned long data) | 360 | sclp_vt220_timeout(struct timer_list *unused) |
361 | { | 361 | { |
362 | sclp_vt220_emit_current(); | 362 | sclp_vt220_emit_current(); |
363 | } | 363 | } |
@@ -454,8 +454,6 @@ __sclp_vt220_write(const unsigned char *buf, int count, int do_schedule, | |||
454 | /* Setup timer to output current console buffer after some time */ | 454 | /* Setup timer to output current console buffer after some time */ |
455 | if (sclp_vt220_current_request != NULL && | 455 | if (sclp_vt220_current_request != NULL && |
456 | !timer_pending(&sclp_vt220_timer) && do_schedule) { | 456 | !timer_pending(&sclp_vt220_timer) && do_schedule) { |
457 | sclp_vt220_timer.function = sclp_vt220_timeout; | ||
458 | sclp_vt220_timer.data = 0UL; | ||
459 | sclp_vt220_timer.expires = jiffies + BUFFER_MAX_DELAY; | 457 | sclp_vt220_timer.expires = jiffies + BUFFER_MAX_DELAY; |
460 | add_timer(&sclp_vt220_timer); | 458 | add_timer(&sclp_vt220_timer); |
461 | } | 459 | } |
@@ -699,7 +697,7 @@ static int __init __sclp_vt220_init(int num_pages) | |||
699 | spin_lock_init(&sclp_vt220_lock); | 697 | spin_lock_init(&sclp_vt220_lock); |
700 | INIT_LIST_HEAD(&sclp_vt220_empty); | 698 | INIT_LIST_HEAD(&sclp_vt220_empty); |
701 | INIT_LIST_HEAD(&sclp_vt220_outqueue); | 699 | INIT_LIST_HEAD(&sclp_vt220_outqueue); |
702 | init_timer(&sclp_vt220_timer); | 700 | timer_setup(&sclp_vt220_timer, sclp_vt220_timeout, 0); |
703 | tty_port_init(&sclp_vt220_port); | 701 | tty_port_init(&sclp_vt220_port); |
704 | sclp_vt220_current_request = NULL; | 702 | sclp_vt220_current_request = NULL; |
705 | sclp_vt220_buffered_chars = 0; | 703 | sclp_vt220_buffered_chars = 0; |
diff --git a/drivers/s390/char/tape_core.c b/drivers/s390/char/tape_core.c index 9dd4534823b3..32503a60ee85 100644 --- a/drivers/s390/char/tape_core.c +++ b/drivers/s390/char/tape_core.c | |||
@@ -32,7 +32,7 @@ | |||
32 | 32 | ||
33 | static void __tape_do_irq (struct ccw_device *, unsigned long, struct irb *); | 33 | static void __tape_do_irq (struct ccw_device *, unsigned long, struct irb *); |
34 | static void tape_delayed_next_request(struct work_struct *); | 34 | static void tape_delayed_next_request(struct work_struct *); |
35 | static void tape_long_busy_timeout(unsigned long data); | 35 | static void tape_long_busy_timeout(struct timer_list *t); |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * One list to contain all tape devices of all disciplines, so | 38 | * One list to contain all tape devices of all disciplines, so |
@@ -381,8 +381,7 @@ tape_generic_online(struct tape_device *device, | |||
381 | return -EINVAL; | 381 | return -EINVAL; |
382 | } | 382 | } |
383 | 383 | ||
384 | init_timer(&device->lb_timeout); | 384 | timer_setup(&device->lb_timeout, tape_long_busy_timeout, 0); |
385 | device->lb_timeout.function = tape_long_busy_timeout; | ||
386 | 385 | ||
387 | /* Let the discipline have a go at the device. */ | 386 | /* Let the discipline have a go at the device. */ |
388 | device->discipline = discipline; | 387 | device->discipline = discipline; |
@@ -867,18 +866,16 @@ tape_delayed_next_request(struct work_struct *work) | |||
867 | spin_unlock_irq(get_ccwdev_lock(device->cdev)); | 866 | spin_unlock_irq(get_ccwdev_lock(device->cdev)); |
868 | } | 867 | } |
869 | 868 | ||
870 | static void tape_long_busy_timeout(unsigned long data) | 869 | static void tape_long_busy_timeout(struct timer_list *t) |
871 | { | 870 | { |
871 | struct tape_device *device = from_timer(device, t, lb_timeout); | ||
872 | struct tape_request *request; | 872 | struct tape_request *request; |
873 | struct tape_device *device; | ||
874 | 873 | ||
875 | device = (struct tape_device *) data; | ||
876 | spin_lock_irq(get_ccwdev_lock(device->cdev)); | 874 | spin_lock_irq(get_ccwdev_lock(device->cdev)); |
877 | request = list_entry(device->req_queue.next, struct tape_request, list); | 875 | request = list_entry(device->req_queue.next, struct tape_request, list); |
878 | BUG_ON(request->status != TAPE_REQUEST_LONG_BUSY); | 876 | BUG_ON(request->status != TAPE_REQUEST_LONG_BUSY); |
879 | DBF_LH(6, "%08x: Long busy timeout.\n", device->cdev_id); | 877 | DBF_LH(6, "%08x: Long busy timeout.\n", device->cdev_id); |
880 | __tape_start_next_request(device); | 878 | __tape_start_next_request(device); |
881 | device->lb_timeout.data = 0UL; | ||
882 | tape_put_device(device); | 879 | tape_put_device(device); |
883 | spin_unlock_irq(get_ccwdev_lock(device->cdev)); | 880 | spin_unlock_irq(get_ccwdev_lock(device->cdev)); |
884 | } | 881 | } |
@@ -1157,7 +1154,6 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
1157 | if (req->status == TAPE_REQUEST_LONG_BUSY) { | 1154 | if (req->status == TAPE_REQUEST_LONG_BUSY) { |
1158 | DBF_EVENT(3, "(%08x): del timer\n", device->cdev_id); | 1155 | DBF_EVENT(3, "(%08x): del timer\n", device->cdev_id); |
1159 | if (del_timer(&device->lb_timeout)) { | 1156 | if (del_timer(&device->lb_timeout)) { |
1160 | device->lb_timeout.data = 0UL; | ||
1161 | tape_put_device(device); | 1157 | tape_put_device(device); |
1162 | __tape_start_next_request(device); | 1158 | __tape_start_next_request(device); |
1163 | } | 1159 | } |
@@ -1212,8 +1208,6 @@ __tape_do_irq (struct ccw_device *cdev, unsigned long intparm, struct irb *irb) | |||
1212 | case TAPE_IO_PENDING: | 1208 | case TAPE_IO_PENDING: |
1213 | break; | 1209 | break; |
1214 | case TAPE_IO_LONG_BUSY: | 1210 | case TAPE_IO_LONG_BUSY: |
1215 | device->lb_timeout.data = | ||
1216 | (unsigned long) tape_get_device(device); | ||
1217 | device->lb_timeout.expires = jiffies + | 1211 | device->lb_timeout.expires = jiffies + |
1218 | LONG_BUSY_TIMEOUT * HZ; | 1212 | LONG_BUSY_TIMEOUT * HZ; |
1219 | DBF_EVENT(3, "(%08x): add timer\n", device->cdev_id); | 1213 | DBF_EVENT(3, "(%08x): add timer\n", device->cdev_id); |
diff --git a/drivers/s390/char/tty3270.c b/drivers/s390/char/tty3270.c index e5ebe2fbee23..e417ccd9e299 100644 --- a/drivers/s390/char/tty3270.c +++ b/drivers/s390/char/tty3270.c | |||
@@ -118,7 +118,7 @@ struct tty3270 { | |||
118 | #define TTY_UPDATE_STATUS 8 /* Update status line. */ | 118 | #define TTY_UPDATE_STATUS 8 /* Update status line. */ |
119 | #define TTY_UPDATE_ALL 16 /* Recreate screen. */ | 119 | #define TTY_UPDATE_ALL 16 /* Recreate screen. */ |
120 | 120 | ||
121 | static void tty3270_update(struct tty3270 *); | 121 | static void tty3270_update(struct timer_list *); |
122 | static void tty3270_resize_work(struct work_struct *work); | 122 | static void tty3270_resize_work(struct work_struct *work); |
123 | 123 | ||
124 | /* | 124 | /* |
@@ -361,8 +361,9 @@ tty3270_write_callback(struct raw3270_request *rq, void *data) | |||
361 | * Update 3270 display. | 361 | * Update 3270 display. |
362 | */ | 362 | */ |
363 | static void | 363 | static void |
364 | tty3270_update(struct tty3270 *tp) | 364 | tty3270_update(struct timer_list *t) |
365 | { | 365 | { |
366 | struct tty3270 *tp = from_timer(tp, t, timer); | ||
366 | static char invalid_sba[2] = { 0xff, 0xff }; | 367 | static char invalid_sba[2] = { 0xff, 0xff }; |
367 | struct raw3270_request *wrq; | 368 | struct raw3270_request *wrq; |
368 | unsigned long updated; | 369 | unsigned long updated; |
@@ -748,8 +749,7 @@ tty3270_alloc_view(void) | |||
748 | goto out_reset; | 749 | goto out_reset; |
749 | 750 | ||
750 | tty_port_init(&tp->port); | 751 | tty_port_init(&tp->port); |
751 | setup_timer(&tp->timer, (void (*)(unsigned long)) tty3270_update, | 752 | timer_setup(&tp->timer, tty3270_update, 0); |
752 | (unsigned long) tp); | ||
753 | tasklet_init(&tp->readlet, | 753 | tasklet_init(&tp->readlet, |
754 | (void (*)(unsigned long)) tty3270_read_tasklet, | 754 | (void (*)(unsigned long)) tty3270_read_tasklet, |
755 | (unsigned long) tp->read); | 755 | (unsigned long) tp->read); |