diff options
Diffstat (limited to 'drivers/s390/scsi/zfcp_erp.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_erp.c | 231 |
1 files changed, 74 insertions, 157 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 7f60b6fdf724..862a411a4aa0 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c | |||
@@ -64,8 +64,6 @@ static int zfcp_erp_strategy_check_action(struct zfcp_erp_action *, int); | |||
64 | static int zfcp_erp_adapter_strategy(struct zfcp_erp_action *); | 64 | static int zfcp_erp_adapter_strategy(struct zfcp_erp_action *); |
65 | static int zfcp_erp_adapter_strategy_generic(struct zfcp_erp_action *, int); | 65 | static int zfcp_erp_adapter_strategy_generic(struct zfcp_erp_action *, int); |
66 | static int zfcp_erp_adapter_strategy_close(struct zfcp_erp_action *); | 66 | static int zfcp_erp_adapter_strategy_close(struct zfcp_erp_action *); |
67 | static void zfcp_erp_adapter_strategy_close_qdio(struct zfcp_erp_action *); | ||
68 | static void zfcp_erp_adapter_strategy_close_fsf(struct zfcp_erp_action *); | ||
69 | static int zfcp_erp_adapter_strategy_open(struct zfcp_erp_action *); | 67 | static int zfcp_erp_adapter_strategy_open(struct zfcp_erp_action *); |
70 | static int zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *); | 68 | static int zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *); |
71 | static int zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *); | 69 | static int zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *); |
@@ -93,6 +91,7 @@ static int zfcp_erp_unit_strategy_clearstati(struct zfcp_unit *); | |||
93 | static int zfcp_erp_unit_strategy_close(struct zfcp_erp_action *); | 91 | static int zfcp_erp_unit_strategy_close(struct zfcp_erp_action *); |
94 | static int zfcp_erp_unit_strategy_open(struct zfcp_erp_action *); | 92 | static int zfcp_erp_unit_strategy_open(struct zfcp_erp_action *); |
95 | 93 | ||
94 | static void zfcp_erp_action_dismiss_adapter(struct zfcp_adapter *); | ||
96 | static void zfcp_erp_action_dismiss_port(struct zfcp_port *); | 95 | static void zfcp_erp_action_dismiss_port(struct zfcp_port *); |
97 | static void zfcp_erp_action_dismiss_unit(struct zfcp_unit *); | 96 | static void zfcp_erp_action_dismiss_unit(struct zfcp_unit *); |
98 | static void zfcp_erp_action_dismiss(struct zfcp_erp_action *); | 97 | static void zfcp_erp_action_dismiss(struct zfcp_erp_action *); |
@@ -111,64 +110,86 @@ static inline void zfcp_erp_action_to_ready(struct zfcp_erp_action *); | |||
111 | static inline void zfcp_erp_action_to_running(struct zfcp_erp_action *); | 110 | static inline void zfcp_erp_action_to_running(struct zfcp_erp_action *); |
112 | 111 | ||
113 | static void zfcp_erp_memwait_handler(unsigned long); | 112 | static void zfcp_erp_memwait_handler(unsigned long); |
114 | static void zfcp_erp_timeout_handler(unsigned long); | ||
115 | static inline void zfcp_erp_timeout_init(struct zfcp_erp_action *); | ||
116 | 113 | ||
117 | /** | 114 | /** |
118 | * zfcp_fsf_request_timeout_handler - called if a request timed out | 115 | * zfcp_close_qdio - close qdio queues for an adapter |
119 | * @data: pointer to adapter for handler function | ||
120 | * | ||
121 | * This function needs to be called if requests (ELS, Generic Service, | ||
122 | * or SCSI commands) exceed a certain time limit. The assumption is | ||
123 | * that after the time limit the adapter get stuck. So we trigger a reopen of | ||
124 | * the adapter. This should not be used for error recovery, SCSI abort | ||
125 | * commands and SCSI requests from SCSI mid-layer. | ||
126 | */ | 116 | */ |
127 | void | 117 | static void zfcp_close_qdio(struct zfcp_adapter *adapter) |
128 | zfcp_fsf_request_timeout_handler(unsigned long data) | ||
129 | { | 118 | { |
130 | struct zfcp_adapter *adapter; | 119 | struct zfcp_qdio_queue *req_queue; |
120 | int first, count; | ||
131 | 121 | ||
132 | adapter = (struct zfcp_adapter *) data; | 122 | if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status)) |
123 | return; | ||
133 | 124 | ||
134 | zfcp_erp_adapter_reopen(adapter, 0); | 125 | /* clear QDIOUP flag, thus do_QDIO is not called during qdio_shutdown */ |
126 | req_queue = &adapter->request_queue; | ||
127 | write_lock_irq(&req_queue->queue_lock); | ||
128 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status); | ||
129 | write_unlock_irq(&req_queue->queue_lock); | ||
130 | |||
131 | debug_text_event(adapter->erp_dbf, 3, "qdio_down2a"); | ||
132 | while (qdio_shutdown(adapter->ccw_device, | ||
133 | QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS) | ||
134 | msleep(1000); | ||
135 | debug_text_event(adapter->erp_dbf, 3, "qdio_down2b"); | ||
136 | |||
137 | /* cleanup used outbound sbals */ | ||
138 | count = atomic_read(&req_queue->free_count); | ||
139 | if (count < QDIO_MAX_BUFFERS_PER_Q) { | ||
140 | first = (req_queue->free_index+count) % QDIO_MAX_BUFFERS_PER_Q; | ||
141 | count = QDIO_MAX_BUFFERS_PER_Q - count; | ||
142 | zfcp_qdio_zero_sbals(req_queue->buffer, first, count); | ||
143 | } | ||
144 | req_queue->free_index = 0; | ||
145 | atomic_set(&req_queue->free_count, 0); | ||
146 | req_queue->distance_from_int = 0; | ||
147 | adapter->response_queue.free_index = 0; | ||
148 | atomic_set(&adapter->response_queue.free_count, 0); | ||
135 | } | 149 | } |
136 | 150 | ||
137 | /** | 151 | /** |
138 | * zfcp_fsf_scsi_er_timeout_handler - timeout handler for scsi eh tasks | 152 | * zfcp_close_fsf - stop FSF operations for an adapter |
139 | * | 153 | * |
140 | * This function needs to be called whenever a SCSI error recovery | 154 | * Dismiss and cleanup all pending fsf_reqs (this wakes up all initiators of |
141 | * action (abort/reset) does not return. Re-opening the adapter means | 155 | * requests waiting for completion; especially this returns SCSI commands |
142 | * that the abort/reset command can be returned by zfcp. It won't complete | 156 | * with error state). |
143 | * via the adapter anymore (because qdio queues are closed). If ERP is | ||
144 | * already running on this adapter it will be stopped. | ||
145 | */ | 157 | */ |
146 | void zfcp_fsf_scsi_er_timeout_handler(unsigned long data) | 158 | static void zfcp_close_fsf(struct zfcp_adapter *adapter) |
147 | { | 159 | { |
148 | struct zfcp_adapter *adapter = (struct zfcp_adapter *) data; | 160 | /* close queues to ensure that buffers are not accessed by adapter */ |
149 | unsigned long flags; | 161 | zfcp_close_qdio(adapter); |
150 | 162 | zfcp_fsf_req_dismiss_all(adapter); | |
151 | ZFCP_LOG_NORMAL("warning: SCSI error recovery timed out. " | 163 | /* reset FSF request sequence number */ |
152 | "Restarting all operations on the adapter %s\n", | 164 | adapter->fsf_req_seq_no = 0; |
153 | zfcp_get_busid_by_adapter(adapter)); | 165 | /* all ports and units are closed */ |
154 | debug_text_event(adapter->erp_dbf, 1, "eh_lmem_tout"); | 166 | zfcp_erp_modify_adapter_status(adapter, |
167 | ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); | ||
168 | } | ||
155 | 169 | ||
156 | write_lock_irqsave(&adapter->erp_lock, flags); | 170 | /** |
157 | if (atomic_test_mask(ZFCP_STATUS_ADAPTER_ERP_PENDING, | 171 | * zfcp_fsf_request_timeout_handler - called if a request timed out |
158 | &adapter->status)) { | 172 | * @data: pointer to adapter for handler function |
159 | zfcp_erp_modify_adapter_status(adapter, | 173 | * |
160 | ZFCP_STATUS_COMMON_UNBLOCKED|ZFCP_STATUS_COMMON_OPEN, | 174 | * This function needs to be called if requests (ELS, Generic Service, |
161 | ZFCP_CLEAR); | 175 | * or SCSI commands) exceed a certain time limit. The assumption is |
162 | zfcp_erp_action_dismiss_adapter(adapter); | 176 | * that after the time limit the adapter get stuck. So we trigger a reopen of |
163 | write_unlock_irqrestore(&adapter->erp_lock, flags); | 177 | * the adapter. |
164 | /* dismiss all pending requests including requests for ERP */ | 178 | */ |
165 | zfcp_fsf_req_dismiss_all(adapter); | 179 | static void zfcp_fsf_request_timeout_handler(unsigned long data) |
166 | adapter->fsf_req_seq_no = 0; | 180 | { |
167 | } else | 181 | struct zfcp_adapter *adapter = (struct zfcp_adapter *) data; |
168 | write_unlock_irqrestore(&adapter->erp_lock, flags); | ||
169 | zfcp_erp_adapter_reopen(adapter, 0); | 182 | zfcp_erp_adapter_reopen(adapter, 0); |
170 | } | 183 | } |
171 | 184 | ||
185 | void zfcp_fsf_start_timer(struct zfcp_fsf_req *fsf_req, unsigned long timeout) | ||
186 | { | ||
187 | fsf_req->timer.function = zfcp_fsf_request_timeout_handler; | ||
188 | fsf_req->timer.data = (unsigned long) fsf_req->adapter; | ||
189 | fsf_req->timer.expires = timeout; | ||
190 | add_timer(&fsf_req->timer); | ||
191 | } | ||
192 | |||
172 | /* | 193 | /* |
173 | * function: | 194 | * function: |
174 | * | 195 | * |
@@ -282,7 +303,6 @@ zfcp_erp_adisc(struct zfcp_port *port) | |||
282 | struct zfcp_ls_adisc *adisc; | 303 | struct zfcp_ls_adisc *adisc; |
283 | void *address = NULL; | 304 | void *address = NULL; |
284 | int retval = 0; | 305 | int retval = 0; |
285 | struct timer_list *timer; | ||
286 | 306 | ||
287 | send_els = kzalloc(sizeof(struct zfcp_send_els), GFP_ATOMIC); | 307 | send_els = kzalloc(sizeof(struct zfcp_send_els), GFP_ATOMIC); |
288 | if (send_els == NULL) | 308 | if (send_els == NULL) |
@@ -329,22 +349,11 @@ zfcp_erp_adisc(struct zfcp_port *port) | |||
329 | (wwn_t) adisc->wwnn, adisc->hard_nport_id, | 349 | (wwn_t) adisc->wwnn, adisc->hard_nport_id, |
330 | adisc->nport_id); | 350 | adisc->nport_id); |
331 | 351 | ||
332 | timer = kmalloc(sizeof(struct timer_list), GFP_ATOMIC); | ||
333 | if (!timer) | ||
334 | goto nomem; | ||
335 | |||
336 | init_timer(timer); | ||
337 | timer->function = zfcp_fsf_request_timeout_handler; | ||
338 | timer->data = (unsigned long) adapter; | ||
339 | timer->expires = ZFCP_FSF_REQUEST_TIMEOUT; | ||
340 | send_els->timer = timer; | ||
341 | |||
342 | retval = zfcp_fsf_send_els(send_els); | 352 | retval = zfcp_fsf_send_els(send_els); |
343 | if (retval != 0) { | 353 | if (retval != 0) { |
344 | ZFCP_LOG_NORMAL("error: initiation of Send ELS failed for port " | 354 | ZFCP_LOG_NORMAL("error: initiation of Send ELS failed for port " |
345 | "0x%08x on adapter %s\n", send_els->d_id, | 355 | "0x%08x on adapter %s\n", send_els->d_id, |
346 | zfcp_get_busid_by_adapter(adapter)); | 356 | zfcp_get_busid_by_adapter(adapter)); |
347 | del_timer(send_els->timer); | ||
348 | goto freemem; | 357 | goto freemem; |
349 | } | 358 | } |
350 | 359 | ||
@@ -356,7 +365,6 @@ zfcp_erp_adisc(struct zfcp_port *port) | |||
356 | if (address != NULL) | 365 | if (address != NULL) |
357 | __free_pages(send_els->req->page, 0); | 366 | __free_pages(send_els->req->page, 0); |
358 | if (send_els != NULL) { | 367 | if (send_els != NULL) { |
359 | kfree(send_els->timer); | ||
360 | kfree(send_els->req); | 368 | kfree(send_els->req); |
361 | kfree(send_els->resp); | 369 | kfree(send_els->resp); |
362 | kfree(send_els); | 370 | kfree(send_els); |
@@ -382,9 +390,6 @@ zfcp_erp_adisc_handler(unsigned long data) | |||
382 | struct zfcp_ls_adisc_acc *adisc; | 390 | struct zfcp_ls_adisc_acc *adisc; |
383 | 391 | ||
384 | send_els = (struct zfcp_send_els *) data; | 392 | send_els = (struct zfcp_send_els *) data; |
385 | |||
386 | del_timer(send_els->timer); | ||
387 | |||
388 | adapter = send_els->adapter; | 393 | adapter = send_els->adapter; |
389 | port = send_els->port; | 394 | port = send_els->port; |
390 | d_id = send_els->d_id; | 395 | d_id = send_els->d_id; |
@@ -433,7 +438,6 @@ zfcp_erp_adisc_handler(unsigned long data) | |||
433 | out: | 438 | out: |
434 | zfcp_port_put(port); | 439 | zfcp_port_put(port); |
435 | __free_pages(send_els->req->page, 0); | 440 | __free_pages(send_els->req->page, 0); |
436 | kfree(send_els->timer); | ||
437 | kfree(send_els->req); | 441 | kfree(send_els->req); |
438 | kfree(send_els->resp); | 442 | kfree(send_els->resp); |
439 | kfree(send_els); | 443 | kfree(send_els); |
@@ -909,8 +913,6 @@ static void zfcp_erp_async_handler_nolock(struct zfcp_erp_action *erp_action, | |||
909 | debug_text_event(adapter->erp_dbf, 2, "a_asyh_ex"); | 913 | debug_text_event(adapter->erp_dbf, 2, "a_asyh_ex"); |
910 | debug_event(adapter->erp_dbf, 2, &erp_action->action, | 914 | debug_event(adapter->erp_dbf, 2, &erp_action->action, |
911 | sizeof (int)); | 915 | sizeof (int)); |
912 | if (!(set_mask & ZFCP_STATUS_ERP_TIMEDOUT)) | ||
913 | del_timer(&erp_action->timer); | ||
914 | erp_action->status |= set_mask; | 916 | erp_action->status |= set_mask; |
915 | zfcp_erp_action_ready(erp_action); | 917 | zfcp_erp_action_ready(erp_action); |
916 | } else { | 918 | } else { |
@@ -957,8 +959,7 @@ zfcp_erp_memwait_handler(unsigned long data) | |||
957 | * action gets an appropriate flag and will be processed | 959 | * action gets an appropriate flag and will be processed |
958 | * accordingly | 960 | * accordingly |
959 | */ | 961 | */ |
960 | static void | 962 | void zfcp_erp_timeout_handler(unsigned long data) |
961 | zfcp_erp_timeout_handler(unsigned long data) | ||
962 | { | 963 | { |
963 | struct zfcp_erp_action *erp_action = (struct zfcp_erp_action *) data; | 964 | struct zfcp_erp_action *erp_action = (struct zfcp_erp_action *) data; |
964 | struct zfcp_adapter *adapter = erp_action->adapter; | 965 | struct zfcp_adapter *adapter = erp_action->adapter; |
@@ -1934,8 +1935,7 @@ zfcp_erp_adapter_strategy_generic(struct zfcp_erp_action *erp_action, int close) | |||
1934 | &erp_action->adapter->status); | 1935 | &erp_action->adapter->status); |
1935 | 1936 | ||
1936 | failed_openfcp: | 1937 | failed_openfcp: |
1937 | zfcp_erp_adapter_strategy_close_qdio(erp_action); | 1938 | zfcp_close_fsf(erp_action->adapter); |
1938 | zfcp_erp_adapter_strategy_close_fsf(erp_action); | ||
1939 | failed_qdio: | 1939 | failed_qdio: |
1940 | out: | 1940 | out: |
1941 | return retval; | 1941 | return retval; |
@@ -2040,59 +2040,6 @@ zfcp_erp_adapter_strategy_open_qdio(struct zfcp_erp_action *erp_action) | |||
2040 | return retval; | 2040 | return retval; |
2041 | } | 2041 | } |
2042 | 2042 | ||
2043 | /** | ||
2044 | * zfcp_erp_adapter_strategy_close_qdio - close qdio queues for an adapter | ||
2045 | */ | ||
2046 | static void | ||
2047 | zfcp_erp_adapter_strategy_close_qdio(struct zfcp_erp_action *erp_action) | ||
2048 | { | ||
2049 | int first_used; | ||
2050 | int used_count; | ||
2051 | struct zfcp_adapter *adapter = erp_action->adapter; | ||
2052 | |||
2053 | if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status)) { | ||
2054 | ZFCP_LOG_DEBUG("error: attempt to shut down inactive QDIO " | ||
2055 | "queues on adapter %s\n", | ||
2056 | zfcp_get_busid_by_adapter(adapter)); | ||
2057 | return; | ||
2058 | } | ||
2059 | |||
2060 | /* | ||
2061 | * Get queue_lock and clear QDIOUP flag. Thus it's guaranteed that | ||
2062 | * do_QDIO won't be called while qdio_shutdown is in progress. | ||
2063 | */ | ||
2064 | write_lock_irq(&adapter->request_queue.queue_lock); | ||
2065 | atomic_clear_mask(ZFCP_STATUS_ADAPTER_QDIOUP, &adapter->status); | ||
2066 | write_unlock_irq(&adapter->request_queue.queue_lock); | ||
2067 | |||
2068 | debug_text_event(adapter->erp_dbf, 3, "qdio_down2a"); | ||
2069 | while (qdio_shutdown(adapter->ccw_device, | ||
2070 | QDIO_FLAG_CLEANUP_USING_CLEAR) == -EINPROGRESS) | ||
2071 | msleep(1000); | ||
2072 | debug_text_event(adapter->erp_dbf, 3, "qdio_down2b"); | ||
2073 | |||
2074 | /* | ||
2075 | * First we had to stop QDIO operation. | ||
2076 | * Now it is safe to take the following actions. | ||
2077 | */ | ||
2078 | |||
2079 | /* Cleanup only necessary when there are unacknowledged buffers */ | ||
2080 | if (atomic_read(&adapter->request_queue.free_count) | ||
2081 | < QDIO_MAX_BUFFERS_PER_Q) { | ||
2082 | first_used = (adapter->request_queue.free_index + | ||
2083 | atomic_read(&adapter->request_queue.free_count)) | ||
2084 | % QDIO_MAX_BUFFERS_PER_Q; | ||
2085 | used_count = QDIO_MAX_BUFFERS_PER_Q - | ||
2086 | atomic_read(&adapter->request_queue.free_count); | ||
2087 | zfcp_qdio_zero_sbals(adapter->request_queue.buffer, | ||
2088 | first_used, used_count); | ||
2089 | } | ||
2090 | adapter->response_queue.free_index = 0; | ||
2091 | atomic_set(&adapter->response_queue.free_count, 0); | ||
2092 | adapter->request_queue.free_index = 0; | ||
2093 | atomic_set(&adapter->request_queue.free_count, 0); | ||
2094 | adapter->request_queue.distance_from_int = 0; | ||
2095 | } | ||
2096 | 2043 | ||
2097 | static int | 2044 | static int |
2098 | zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *erp_action) | 2045 | zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *erp_action) |
@@ -2127,7 +2074,6 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) | |||
2127 | write_lock_irq(&adapter->erp_lock); | 2074 | write_lock_irq(&adapter->erp_lock); |
2128 | zfcp_erp_action_to_running(erp_action); | 2075 | zfcp_erp_action_to_running(erp_action); |
2129 | write_unlock_irq(&adapter->erp_lock); | 2076 | write_unlock_irq(&adapter->erp_lock); |
2130 | zfcp_erp_timeout_init(erp_action); | ||
2131 | if (zfcp_fsf_exchange_config_data(erp_action)) { | 2077 | if (zfcp_fsf_exchange_config_data(erp_action)) { |
2132 | retval = ZFCP_ERP_FAILED; | 2078 | retval = ZFCP_ERP_FAILED; |
2133 | debug_text_event(adapter->erp_dbf, 5, "a_fstx_xf"); | 2079 | debug_text_event(adapter->erp_dbf, 5, "a_fstx_xf"); |
@@ -2196,7 +2142,6 @@ zfcp_erp_adapter_strategy_open_fsf_xport(struct zfcp_erp_action *erp_action) | |||
2196 | zfcp_erp_action_to_running(erp_action); | 2142 | zfcp_erp_action_to_running(erp_action); |
2197 | write_unlock_irq(&adapter->erp_lock); | 2143 | write_unlock_irq(&adapter->erp_lock); |
2198 | 2144 | ||
2199 | zfcp_erp_timeout_init(erp_action); | ||
2200 | ret = zfcp_fsf_exchange_port_data(erp_action, adapter, NULL); | 2145 | ret = zfcp_fsf_exchange_port_data(erp_action, adapter, NULL); |
2201 | if (ret == -EOPNOTSUPP) { | 2146 | if (ret == -EOPNOTSUPP) { |
2202 | debug_text_event(adapter->erp_dbf, 3, "a_xport_notsupp"); | 2147 | debug_text_event(adapter->erp_dbf, 3, "a_xport_notsupp"); |
@@ -2248,27 +2193,6 @@ zfcp_erp_adapter_strategy_open_fsf_statusread(struct zfcp_erp_action | |||
2248 | return retval; | 2193 | return retval; |
2249 | } | 2194 | } |
2250 | 2195 | ||
2251 | /** | ||
2252 | * zfcp_erp_adapter_strategy_close_fsf - stop FSF operations for an adapter | ||
2253 | */ | ||
2254 | static void | ||
2255 | zfcp_erp_adapter_strategy_close_fsf(struct zfcp_erp_action *erp_action) | ||
2256 | { | ||
2257 | struct zfcp_adapter *adapter = erp_action->adapter; | ||
2258 | |||
2259 | /* | ||
2260 | * wake waiting initiators of requests, | ||
2261 | * return SCSI commands (with error status), | ||
2262 | * clean up all requests (synchronously) | ||
2263 | */ | ||
2264 | zfcp_fsf_req_dismiss_all(adapter); | ||
2265 | /* reset FSF request sequence number */ | ||
2266 | adapter->fsf_req_seq_no = 0; | ||
2267 | /* all ports and units are closed */ | ||
2268 | zfcp_erp_modify_adapter_status(adapter, | ||
2269 | ZFCP_STATUS_COMMON_OPEN, ZFCP_CLEAR); | ||
2270 | } | ||
2271 | |||
2272 | /* | 2196 | /* |
2273 | * function: | 2197 | * function: |
2274 | * | 2198 | * |
@@ -2605,7 +2529,6 @@ zfcp_erp_port_forced_strategy_close(struct zfcp_erp_action *erp_action) | |||
2605 | struct zfcp_adapter *adapter = erp_action->adapter; | 2529 | struct zfcp_adapter *adapter = erp_action->adapter; |
2606 | struct zfcp_port *port = erp_action->port; | 2530 | struct zfcp_port *port = erp_action->port; |
2607 | 2531 | ||
2608 | zfcp_erp_timeout_init(erp_action); | ||
2609 | retval = zfcp_fsf_close_physical_port(erp_action); | 2532 | retval = zfcp_fsf_close_physical_port(erp_action); |
2610 | if (retval == -ENOMEM) { | 2533 | if (retval == -ENOMEM) { |
2611 | debug_text_event(adapter->erp_dbf, 5, "o_pfstc_nomem"); | 2534 | debug_text_event(adapter->erp_dbf, 5, "o_pfstc_nomem"); |
@@ -2662,7 +2585,6 @@ zfcp_erp_port_strategy_close(struct zfcp_erp_action *erp_action) | |||
2662 | struct zfcp_adapter *adapter = erp_action->adapter; | 2585 | struct zfcp_adapter *adapter = erp_action->adapter; |
2663 | struct zfcp_port *port = erp_action->port; | 2586 | struct zfcp_port *port = erp_action->port; |
2664 | 2587 | ||
2665 | zfcp_erp_timeout_init(erp_action); | ||
2666 | retval = zfcp_fsf_close_port(erp_action); | 2588 | retval = zfcp_fsf_close_port(erp_action); |
2667 | if (retval == -ENOMEM) { | 2589 | if (retval == -ENOMEM) { |
2668 | debug_text_event(adapter->erp_dbf, 5, "p_pstc_nomem"); | 2590 | debug_text_event(adapter->erp_dbf, 5, "p_pstc_nomem"); |
@@ -2700,7 +2622,6 @@ zfcp_erp_port_strategy_open_port(struct zfcp_erp_action *erp_action) | |||
2700 | struct zfcp_adapter *adapter = erp_action->adapter; | 2622 | struct zfcp_adapter *adapter = erp_action->adapter; |
2701 | struct zfcp_port *port = erp_action->port; | 2623 | struct zfcp_port *port = erp_action->port; |
2702 | 2624 | ||
2703 | zfcp_erp_timeout_init(erp_action); | ||
2704 | retval = zfcp_fsf_open_port(erp_action); | 2625 | retval = zfcp_fsf_open_port(erp_action); |
2705 | if (retval == -ENOMEM) { | 2626 | if (retval == -ENOMEM) { |
2706 | debug_text_event(adapter->erp_dbf, 5, "p_psto_nomem"); | 2627 | debug_text_event(adapter->erp_dbf, 5, "p_psto_nomem"); |
@@ -2738,7 +2659,6 @@ zfcp_erp_port_strategy_open_common_lookup(struct zfcp_erp_action *erp_action) | |||
2738 | struct zfcp_adapter *adapter = erp_action->adapter; | 2659 | struct zfcp_adapter *adapter = erp_action->adapter; |
2739 | struct zfcp_port *port = erp_action->port; | 2660 | struct zfcp_port *port = erp_action->port; |
2740 | 2661 | ||
2741 | zfcp_erp_timeout_init(erp_action); | ||
2742 | retval = zfcp_ns_gid_pn_request(erp_action); | 2662 | retval = zfcp_ns_gid_pn_request(erp_action); |
2743 | if (retval == -ENOMEM) { | 2663 | if (retval == -ENOMEM) { |
2744 | debug_text_event(adapter->erp_dbf, 5, "p_pstn_nomem"); | 2664 | debug_text_event(adapter->erp_dbf, 5, "p_pstn_nomem"); |
@@ -2864,7 +2784,6 @@ zfcp_erp_unit_strategy_close(struct zfcp_erp_action *erp_action) | |||
2864 | struct zfcp_adapter *adapter = erp_action->adapter; | 2784 | struct zfcp_adapter *adapter = erp_action->adapter; |
2865 | struct zfcp_unit *unit = erp_action->unit; | 2785 | struct zfcp_unit *unit = erp_action->unit; |
2866 | 2786 | ||
2867 | zfcp_erp_timeout_init(erp_action); | ||
2868 | retval = zfcp_fsf_close_unit(erp_action); | 2787 | retval = zfcp_fsf_close_unit(erp_action); |
2869 | if (retval == -ENOMEM) { | 2788 | if (retval == -ENOMEM) { |
2870 | debug_text_event(adapter->erp_dbf, 5, "u_ustc_nomem"); | 2789 | debug_text_event(adapter->erp_dbf, 5, "u_ustc_nomem"); |
@@ -2905,7 +2824,6 @@ zfcp_erp_unit_strategy_open(struct zfcp_erp_action *erp_action) | |||
2905 | struct zfcp_adapter *adapter = erp_action->adapter; | 2824 | struct zfcp_adapter *adapter = erp_action->adapter; |
2906 | struct zfcp_unit *unit = erp_action->unit; | 2825 | struct zfcp_unit *unit = erp_action->unit; |
2907 | 2826 | ||
2908 | zfcp_erp_timeout_init(erp_action); | ||
2909 | retval = zfcp_fsf_open_unit(erp_action); | 2827 | retval = zfcp_fsf_open_unit(erp_action); |
2910 | if (retval == -ENOMEM) { | 2828 | if (retval == -ENOMEM) { |
2911 | debug_text_event(adapter->erp_dbf, 5, "u_usto_nomem"); | 2829 | debug_text_event(adapter->erp_dbf, 5, "u_usto_nomem"); |
@@ -2930,14 +2848,13 @@ zfcp_erp_unit_strategy_open(struct zfcp_erp_action *erp_action) | |||
2930 | return retval; | 2848 | return retval; |
2931 | } | 2849 | } |
2932 | 2850 | ||
2933 | static inline void | 2851 | void zfcp_erp_start_timer(struct zfcp_fsf_req *fsf_req) |
2934 | zfcp_erp_timeout_init(struct zfcp_erp_action *erp_action) | ||
2935 | { | 2852 | { |
2936 | init_timer(&erp_action->timer); | 2853 | BUG_ON(!fsf_req->erp_action); |
2937 | erp_action->timer.function = zfcp_erp_timeout_handler; | 2854 | fsf_req->timer.function = zfcp_erp_timeout_handler; |
2938 | erp_action->timer.data = (unsigned long) erp_action; | 2855 | fsf_req->timer.data = (unsigned long) fsf_req->erp_action; |
2939 | /* jiffies will be added in zfcp_fsf_req_send */ | 2856 | fsf_req->timer.expires = jiffies + ZFCP_ERP_FSFREQ_TIMEOUT; |
2940 | erp_action->timer.expires = ZFCP_ERP_FSFREQ_TIMEOUT; | 2857 | add_timer(&fsf_req->timer); |
2941 | } | 2858 | } |
2942 | 2859 | ||
2943 | /* | 2860 | /* |
@@ -3241,7 +3158,7 @@ zfcp_erp_action_cleanup(int action, struct zfcp_adapter *adapter, | |||
3241 | } | 3158 | } |
3242 | 3159 | ||
3243 | 3160 | ||
3244 | void zfcp_erp_action_dismiss_adapter(struct zfcp_adapter *adapter) | 3161 | static void zfcp_erp_action_dismiss_adapter(struct zfcp_adapter *adapter) |
3245 | { | 3162 | { |
3246 | struct zfcp_port *port; | 3163 | struct zfcp_port *port; |
3247 | 3164 | ||