aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Maier <maier@linux.vnet.ibm.com>2017-10-17 12:40:51 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2017-11-16 09:06:19 -0500
commit5c13db9b5df2dc97b0d4ce9d442bbcd80b5194b7 (patch)
tree310d939f219e983b930e4b37ada740127cea3d20
parent75492a51568b943e903e1d7de10a962fbc001ba6 (diff)
zfcp: purely mechanical update using timer API, plus blank lines
erp_memwait only occurs in seldom memory pressure situations. The typical case never uses the associated timer and thus also does not need to initialize the timer. Also, we don't want to re-initialize the timer each time we re-use an erp_action in zfcp_erp_setup_act() [see also v4.14-rc7 commit ab31fd0ce65e ("scsi: zfcp: fix erp_action use-before-initialize in REC action trace") for erp_action life cycle]. Hence, retain the lazy inintialization of zfcp_erp_action.timer in zfcp_erp_strategy_memwait(). Add an empty line after declarations in zfcp_erp_timeout_handler() and zfcp_fsf_request_timeout_handler() even though it was also missing before the timer conversion. Fix checkpatch warning: WARNING: function definition argument 'struct timer_list *' should also have an identifier name +extern void zfcp_erp_timeout_handler(struct timer_list *); Depends-on: v4.14-rc3 commit 686fef928bba ("timer: Prepare to change timer callback argument type") Signed-off-by: Steffen Maier <maier@linux.vnet.ibm.com> Reviewed-by: Jens Remus <jremus@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--drivers/s390/scsi/zfcp_erp.c5
-rw-r--r--drivers/s390/scsi/zfcp_ext.h2
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c1
3 files changed, 4 insertions, 4 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index 822a852d578e..1d91a32db08e 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -56,8 +56,6 @@ enum zfcp_erp_act_result {
56 ZFCP_ERP_NOMEM = 5, 56 ZFCP_ERP_NOMEM = 5,
57}; 57};
58 58
59static void zfcp_erp_memwait_handler(struct timer_list *t);
60
61static void zfcp_erp_adapter_block(struct zfcp_adapter *adapter, int mask) 59static void zfcp_erp_adapter_block(struct zfcp_adapter *adapter, int mask)
62{ 60{
63 zfcp_erp_clear_adapter_status(adapter, 61 zfcp_erp_clear_adapter_status(adapter,
@@ -239,7 +237,6 @@ static struct zfcp_erp_action *zfcp_erp_setup_act(int need, u32 act_status,
239 erp_action->fsf_req_id = 0; 237 erp_action->fsf_req_id = 0;
240 erp_action->action = need; 238 erp_action->action = need;
241 erp_action->status = act_status; 239 erp_action->status = act_status;
242 timer_setup(&erp_action->timer, zfcp_erp_memwait_handler, 0);
243 240
244 return erp_action; 241 return erp_action;
245} 242}
@@ -571,6 +568,7 @@ void zfcp_erp_timeout_handler(struct timer_list *t)
571{ 568{
572 struct zfcp_fsf_req *fsf_req = from_timer(fsf_req, t, timer); 569 struct zfcp_fsf_req *fsf_req = from_timer(fsf_req, t, timer);
573 struct zfcp_erp_action *act = fsf_req->erp_action; 570 struct zfcp_erp_action *act = fsf_req->erp_action;
571
574 zfcp_erp_notify(act, ZFCP_STATUS_ERP_TIMEDOUT); 572 zfcp_erp_notify(act, ZFCP_STATUS_ERP_TIMEDOUT);
575} 573}
576 574
@@ -583,6 +581,7 @@ static void zfcp_erp_memwait_handler(struct timer_list *t)
583 581
584static void zfcp_erp_strategy_memwait(struct zfcp_erp_action *erp_action) 582static void zfcp_erp_strategy_memwait(struct zfcp_erp_action *erp_action)
585{ 583{
584 timer_setup(&erp_action->timer, zfcp_erp_memwait_handler, 0);
586 erp_action->timer.expires = jiffies + HZ; 585 erp_action->timer.expires = jiffies + HZ;
587 add_timer(&erp_action->timer); 586 add_timer(&erp_action->timer);
588} 587}
diff --git a/drivers/s390/scsi/zfcp_ext.h b/drivers/s390/scsi/zfcp_ext.h
index 978a0d596f68..bf8ea4df2bb8 100644
--- a/drivers/s390/scsi/zfcp_ext.h
+++ b/drivers/s390/scsi/zfcp_ext.h
@@ -69,7 +69,7 @@ extern int zfcp_erp_thread_setup(struct zfcp_adapter *);
69extern void zfcp_erp_thread_kill(struct zfcp_adapter *); 69extern void zfcp_erp_thread_kill(struct zfcp_adapter *);
70extern void zfcp_erp_wait(struct zfcp_adapter *); 70extern void zfcp_erp_wait(struct zfcp_adapter *);
71extern void zfcp_erp_notify(struct zfcp_erp_action *, unsigned long); 71extern void zfcp_erp_notify(struct zfcp_erp_action *, unsigned long);
72extern void zfcp_erp_timeout_handler(struct timer_list *); 72extern void zfcp_erp_timeout_handler(struct timer_list *t);
73 73
74/* zfcp_fc.c */ 74/* zfcp_fc.c */
75extern struct kmem_cache *zfcp_fc_req_cache; 75extern struct kmem_cache *zfcp_fc_req_cache;
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index 6f437df1995f..51b81c0a0652 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -25,6 +25,7 @@ static void zfcp_fsf_request_timeout_handler(struct timer_list *t)
25{ 25{
26 struct zfcp_fsf_req *fsf_req = from_timer(fsf_req, t, timer); 26 struct zfcp_fsf_req *fsf_req = from_timer(fsf_req, t, timer);
27 struct zfcp_adapter *adapter = fsf_req->adapter; 27 struct zfcp_adapter *adapter = fsf_req->adapter;
28
28 zfcp_qdio_siosl(adapter); 29 zfcp_qdio_siosl(adapter);
29 zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 30 zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED,
30 "fsrth_1"); 31 "fsrth_1");