diff options
author | David Howells <dhowells@redhat.com> | 2017-11-13 16:36:33 +0100 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2017-11-13 16:36:33 +0100 |
commit | 81445e63e67a1e98b1c2575fa2b406d4289d2754 (patch) | |
tree | 2d121d1873b3e8ec7b71086c4db2f5cb207a46ec /drivers/s390 | |
parent | Merge branch 'net-improve-the-process-of-redirect-and-toobig-for-ipv6-tunnels' (diff) | |
parent | timers: Add a function to start/reduce a timer (diff) | |
download | linux-81445e63e67a1e98b1c2575fa2b406d4289d2754.tar.xz linux-81445e63e67a1e98b1c2575fa2b406d4289d2754.zip |
Merge remote-tracking branch 'tip/timers/core' into afs-next
These AFS patches need the timer_reduce() patch from timers/core.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/char/tape.h | 1 | ||||
-rw-r--r-- | drivers/s390/char/tape_std.c | 18 | ||||
-rw-r--r-- | drivers/s390/net/lcs.c | 17 | ||||
-rw-r--r-- | drivers/s390/net/lcs.h | 1 |
4 files changed, 14 insertions, 23 deletions
diff --git a/drivers/s390/char/tape.h b/drivers/s390/char/tape.h index 997b25f6e4cc..8bec5f9ea92c 100644 --- a/drivers/s390/char/tape.h +++ b/drivers/s390/char/tape.h @@ -129,6 +129,7 @@ struct tape_request { int options; /* options for execution. */ int retries; /* retry counter for error recovery. */ int rescnt; /* residual count from devstat. */ + struct timer_list timer; /* timer for std_assign_timeout(). */ /* Callback for delivering final status. */ void (*callback)(struct tape_request *, void *); diff --git a/drivers/s390/char/tape_std.c b/drivers/s390/char/tape_std.c index 7caba0cc8b2a..1f5fab617b67 100644 --- a/drivers/s390/char/tape_std.c +++ b/drivers/s390/char/tape_std.c @@ -33,14 +33,12 @@ * tape_std_assign */ static void -tape_std_assign_timeout(unsigned long data) +tape_std_assign_timeout(struct timer_list *t) { - struct tape_request * request; - struct tape_device * device; + struct tape_request * request = from_timer(request, t, timer); + struct tape_device * device = request->device; int rc; - request = (struct tape_request *) data; - device = request->device; BUG_ON(!device); DBF_EVENT(3, "%08x: Assignment timeout. Device busy.\n", @@ -71,16 +69,12 @@ tape_std_assign(struct tape_device *device) * to another host (actually this shouldn't happen but it does). * So we set up a timeout for this call. */ - init_timer_on_stack(&timeout); - timeout.function = tape_std_assign_timeout; - timeout.data = (unsigned long) request; - timeout.expires = jiffies + 2 * HZ; - add_timer(&timeout); + timer_setup(&request->timer, tape_std_assign_timeout, 0); + mod_timer(&timeout, jiffies + 2 * HZ); rc = tape_do_io_interruptible(device, request); - del_timer_sync(&timeout); - destroy_timer_on_stack(&timeout); + del_timer_sync(&request->timer); if (rc != 0) { DBF_EVENT(3, "%08x: assign failed - device might be busy\n", diff --git a/drivers/s390/net/lcs.c b/drivers/s390/net/lcs.c index d01b5c2a7760..b855c6f08e96 100644 --- a/drivers/s390/net/lcs.c +++ b/drivers/s390/net/lcs.c @@ -834,13 +834,13 @@ lcs_notify_lancmd_waiters(struct lcs_card *card, struct lcs_cmd *cmd) * Emit buffer of a lan command. */ static void -lcs_lancmd_timeout(unsigned long data) +lcs_lancmd_timeout(struct timer_list *t) { - struct lcs_reply *reply, *list_reply, *r; + struct lcs_reply *reply = from_timer(reply, t, timer); + struct lcs_reply *list_reply, *r; unsigned long flags; LCS_DBF_TEXT(4, trace, "timeout"); - reply = (struct lcs_reply *) data; spin_lock_irqsave(&reply->card->lock, flags); list_for_each_entry_safe(list_reply, r, &reply->card->lancmd_waiters,list) { @@ -864,7 +864,6 @@ lcs_send_lancmd(struct lcs_card *card, struct lcs_buffer *buffer, { struct lcs_reply *reply; struct lcs_cmd *cmd; - struct timer_list timer; unsigned long flags; int rc; @@ -885,14 +884,10 @@ lcs_send_lancmd(struct lcs_card *card, struct lcs_buffer *buffer, rc = lcs_ready_buffer(&card->write, buffer); if (rc) return rc; - init_timer_on_stack(&timer); - timer.function = lcs_lancmd_timeout; - timer.data = (unsigned long) reply; - timer.expires = jiffies + HZ*card->lancmd_timeout; - add_timer(&timer); + timer_setup(&reply->timer, lcs_lancmd_timeout, 0); + mod_timer(&reply->timer, jiffies + HZ * card->lancmd_timeout); wait_event(reply->wait_q, reply->received); - del_timer_sync(&timer); - destroy_timer_on_stack(&timer); + del_timer_sync(&reply->timer); LCS_DBF_TEXT_(4, trace, "rc:%d",reply->rc); rc = reply->rc; lcs_put_reply(reply); diff --git a/drivers/s390/net/lcs.h b/drivers/s390/net/lcs.h index f94d8f6dd7a8..fbc8b90b1f85 100644 --- a/drivers/s390/net/lcs.h +++ b/drivers/s390/net/lcs.h @@ -276,6 +276,7 @@ struct lcs_reply { void (*callback)(struct lcs_card *, struct lcs_cmd *); wait_queue_head_t wait_q; struct lcs_card *card; + struct timer_list timer; int received; int rc; }; |