diff options
author | Andreas Herrmann <aherrman@de.ibm.com> | 2006-09-18 16:29:56 -0400 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-09-23 19:01:23 -0400 |
commit | 2abbe866c8eb0296e3f5343bcf73e5371522a738 (patch) | |
tree | c839b12b43d07d538e32bcabec1fefa2106f384f /drivers/s390/scsi/zfcp_fsf.c | |
parent | 4eff4a36516d72e4f6ede901141214a7e05607e7 (diff) |
[SCSI] zfcp: introduce struct timer_list in struct zfcp_fsf_req
This instance will be used whenever a timer is needed for
a request by zfcp.
Signed-off-by: Andreas Herrmann <aherrman@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/s390/scsi/zfcp_fsf.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 257 |
1 files changed, 105 insertions, 152 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index a66b5193b70e..277826cdd0c8 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -42,7 +42,7 @@ static inline int zfcp_fsf_req_sbal_check( | |||
42 | static inline int zfcp_use_one_sbal( | 42 | static inline int zfcp_use_one_sbal( |
43 | struct scatterlist *, int, struct scatterlist *, int); | 43 | struct scatterlist *, int, struct scatterlist *, int); |
44 | static struct zfcp_fsf_req *zfcp_fsf_req_alloc(mempool_t *, int); | 44 | static struct zfcp_fsf_req *zfcp_fsf_req_alloc(mempool_t *, int); |
45 | static int zfcp_fsf_req_send(struct zfcp_fsf_req *, struct timer_list *); | 45 | static int zfcp_fsf_req_send(struct zfcp_fsf_req *); |
46 | static int zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *); | 46 | static int zfcp_fsf_protstatus_eval(struct zfcp_fsf_req *); |
47 | static int zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *); | 47 | static int zfcp_fsf_fsfstatus_eval(struct zfcp_fsf_req *); |
48 | static int zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *); | 48 | static int zfcp_fsf_fsfstatus_qual_eval(struct zfcp_fsf_req *); |
@@ -225,8 +225,10 @@ zfcp_fsf_req_complete(struct zfcp_fsf_req *fsf_req) | |||
225 | */ | 225 | */ |
226 | zfcp_fsf_status_read_handler(fsf_req); | 226 | zfcp_fsf_status_read_handler(fsf_req); |
227 | goto out; | 227 | goto out; |
228 | } else | 228 | } else { |
229 | del_timer(&fsf_req->timer); | ||
229 | zfcp_fsf_protstatus_eval(fsf_req); | 230 | zfcp_fsf_protstatus_eval(fsf_req); |
231 | } | ||
230 | 232 | ||
231 | /* | 233 | /* |
232 | * fsf_req may be deleted due to waking up functions, so | 234 | * fsf_req may be deleted due to waking up functions, so |
@@ -785,8 +787,7 @@ zfcp_fsf_status_read(struct zfcp_adapter *adapter, int req_flags) | |||
785 | sbale->addr = (void *) status_buffer; | 787 | sbale->addr = (void *) status_buffer; |
786 | sbale->length = sizeof(struct fsf_status_read_buffer); | 788 | sbale->length = sizeof(struct fsf_status_read_buffer); |
787 | 789 | ||
788 | /* start QDIO request for this FSF request */ | 790 | retval = zfcp_fsf_req_send(fsf_req); |
789 | retval = zfcp_fsf_req_send(fsf_req, NULL); | ||
790 | if (retval) { | 791 | if (retval) { |
791 | ZFCP_LOG_DEBUG("error: Could not set-up unsolicited status " | 792 | ZFCP_LOG_DEBUG("error: Could not set-up unsolicited status " |
792 | "environment.\n"); | 793 | "environment.\n"); |
@@ -1112,8 +1113,8 @@ zfcp_fsf_abort_fcp_command(unsigned long old_req_id, | |||
1112 | struct zfcp_unit *unit, int req_flags) | 1113 | struct zfcp_unit *unit, int req_flags) |
1113 | { | 1114 | { |
1114 | volatile struct qdio_buffer_element *sbale; | 1115 | volatile struct qdio_buffer_element *sbale; |
1115 | unsigned long lock_flags; | ||
1116 | struct zfcp_fsf_req *fsf_req = NULL; | 1116 | struct zfcp_fsf_req *fsf_req = NULL; |
1117 | unsigned long lock_flags; | ||
1117 | int retval = 0; | 1118 | int retval = 0; |
1118 | 1119 | ||
1119 | /* setup new FSF request */ | 1120 | /* setup new FSF request */ |
@@ -1143,12 +1144,9 @@ zfcp_fsf_abort_fcp_command(unsigned long old_req_id, | |||
1143 | /* set handle of request which should be aborted */ | 1144 | /* set handle of request which should be aborted */ |
1144 | fsf_req->qtcb->bottom.support.req_handle = (u64) old_req_id; | 1145 | fsf_req->qtcb->bottom.support.req_handle = (u64) old_req_id; |
1145 | 1146 | ||
1146 | /* start QDIO request for this FSF request */ | 1147 | zfcp_fsf_start_timer(fsf_req, ZFCP_SCSI_ER_TIMEOUT); |
1147 | 1148 | retval = zfcp_fsf_req_send(fsf_req); | |
1148 | zfcp_fsf_start_scsi_er_timer(adapter); | ||
1149 | retval = zfcp_fsf_req_send(fsf_req, NULL); | ||
1150 | if (retval) { | 1149 | if (retval) { |
1151 | del_timer(&adapter->scsi_er_timer); | ||
1152 | ZFCP_LOG_INFO("error: Failed to send abort command request " | 1150 | ZFCP_LOG_INFO("error: Failed to send abort command request " |
1153 | "on adapter %s, port 0x%016Lx, unit 0x%016Lx\n", | 1151 | "on adapter %s, port 0x%016Lx, unit 0x%016Lx\n", |
1154 | zfcp_get_busid_by_adapter(adapter), | 1152 | zfcp_get_busid_by_adapter(adapter), |
@@ -1184,8 +1182,6 @@ zfcp_fsf_abort_fcp_command_handler(struct zfcp_fsf_req *new_fsf_req) | |||
1184 | unsigned char status_qual = | 1182 | unsigned char status_qual = |
1185 | new_fsf_req->qtcb->header.fsf_status_qual.word[0]; | 1183 | new_fsf_req->qtcb->header.fsf_status_qual.word[0]; |
1186 | 1184 | ||
1187 | del_timer(&new_fsf_req->adapter->scsi_er_timer); | ||
1188 | |||
1189 | if (new_fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR) { | 1185 | if (new_fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR) { |
1190 | /* do not set ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED */ | 1186 | /* do not set ZFCP_STATUS_FSFREQ_ABORTSUCCEEDED */ |
1191 | goto skip_fsfstatus; | 1187 | goto skip_fsfstatus; |
@@ -1391,11 +1387,6 @@ zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool, | |||
1391 | goto failed_req; | 1387 | goto failed_req; |
1392 | } | 1388 | } |
1393 | 1389 | ||
1394 | if (erp_action != NULL) { | ||
1395 | erp_action->fsf_req = fsf_req; | ||
1396 | fsf_req->erp_action = erp_action; | ||
1397 | } | ||
1398 | |||
1399 | sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_curr, 0); | 1390 | sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_curr, 0); |
1400 | if (zfcp_use_one_sbal(ct->req, ct->req_count, | 1391 | if (zfcp_use_one_sbal(ct->req, ct->req_count, |
1401 | ct->resp, ct->resp_count)){ | 1392 | ct->resp, ct->resp_count)){ |
@@ -1462,8 +1453,14 @@ zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool, | |||
1462 | 1453 | ||
1463 | zfcp_san_dbf_event_ct_request(fsf_req); | 1454 | zfcp_san_dbf_event_ct_request(fsf_req); |
1464 | 1455 | ||
1465 | /* start QDIO request for this FSF request */ | 1456 | if (erp_action) { |
1466 | ret = zfcp_fsf_req_send(fsf_req, ct->timer); | 1457 | erp_action->fsf_req = fsf_req; |
1458 | fsf_req->erp_action = erp_action; | ||
1459 | zfcp_erp_start_timer(fsf_req); | ||
1460 | } else | ||
1461 | zfcp_fsf_start_timer(fsf_req, ZFCP_FSF_REQUEST_TIMEOUT); | ||
1462 | |||
1463 | ret = zfcp_fsf_req_send(fsf_req); | ||
1467 | if (ret) { | 1464 | if (ret) { |
1468 | ZFCP_LOG_DEBUG("error: initiation of CT request failed " | 1465 | ZFCP_LOG_DEBUG("error: initiation of CT request failed " |
1469 | "(adapter %s, port 0x%016Lx)\n", | 1466 | "(adapter %s, port 0x%016Lx)\n", |
@@ -1760,8 +1757,8 @@ zfcp_fsf_send_els(struct zfcp_send_els *els) | |||
1760 | 1757 | ||
1761 | zfcp_san_dbf_event_els_request(fsf_req); | 1758 | zfcp_san_dbf_event_els_request(fsf_req); |
1762 | 1759 | ||
1763 | /* start QDIO request for this FSF request */ | 1760 | zfcp_fsf_start_timer(fsf_req, ZFCP_FSF_REQUEST_TIMEOUT); |
1764 | ret = zfcp_fsf_req_send(fsf_req, els->timer); | 1761 | ret = zfcp_fsf_req_send(fsf_req); |
1765 | if (ret) { | 1762 | if (ret) { |
1766 | ZFCP_LOG_DEBUG("error: initiation of ELS request failed " | 1763 | ZFCP_LOG_DEBUG("error: initiation of ELS request failed " |
1767 | "(adapter %s, port d_id: 0x%08x)\n", | 1764 | "(adapter %s, port d_id: 0x%08x)\n", |
@@ -1958,6 +1955,7 @@ int | |||
1958 | zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) | 1955 | zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) |
1959 | { | 1956 | { |
1960 | volatile struct qdio_buffer_element *sbale; | 1957 | volatile struct qdio_buffer_element *sbale; |
1958 | struct zfcp_fsf_req *fsf_req; | ||
1961 | unsigned long lock_flags; | 1959 | unsigned long lock_flags; |
1962 | int retval = 0; | 1960 | int retval = 0; |
1963 | 1961 | ||
@@ -1966,7 +1964,7 @@ zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) | |||
1966 | FSF_QTCB_EXCHANGE_CONFIG_DATA, | 1964 | FSF_QTCB_EXCHANGE_CONFIG_DATA, |
1967 | ZFCP_REQ_AUTO_CLEANUP, | 1965 | ZFCP_REQ_AUTO_CLEANUP, |
1968 | erp_action->adapter->pool.fsf_req_erp, | 1966 | erp_action->adapter->pool.fsf_req_erp, |
1969 | &lock_flags, &(erp_action->fsf_req)); | 1967 | &lock_flags, &fsf_req); |
1970 | if (retval < 0) { | 1968 | if (retval < 0) { |
1971 | ZFCP_LOG_INFO("error: Could not create exchange configuration " | 1969 | ZFCP_LOG_INFO("error: Could not create exchange configuration " |
1972 | "data request for adapter %s.\n", | 1970 | "data request for adapter %s.\n", |
@@ -1974,26 +1972,26 @@ zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) | |||
1974 | goto out; | 1972 | goto out; |
1975 | } | 1973 | } |
1976 | 1974 | ||
1977 | sbale = zfcp_qdio_sbale_req(erp_action->fsf_req, | 1975 | sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_curr, 0); |
1978 | erp_action->fsf_req->sbal_curr, 0); | ||
1979 | sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; | 1976 | sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; |
1980 | sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; | 1977 | sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; |
1981 | 1978 | ||
1982 | erp_action->fsf_req->erp_action = erp_action; | 1979 | fsf_req->qtcb->bottom.config.feature_selection = |
1983 | erp_action->fsf_req->qtcb->bottom.config.feature_selection = | ||
1984 | FSF_FEATURE_CFDC | | 1980 | FSF_FEATURE_CFDC | |
1985 | FSF_FEATURE_LUN_SHARING | | 1981 | FSF_FEATURE_LUN_SHARING | |
1986 | FSF_FEATURE_NOTIFICATION_LOST | | 1982 | FSF_FEATURE_NOTIFICATION_LOST | |
1987 | FSF_FEATURE_UPDATE_ALERT; | 1983 | FSF_FEATURE_UPDATE_ALERT; |
1984 | fsf_req->erp_action = erp_action; | ||
1985 | erp_action->fsf_req = fsf_req; | ||
1988 | 1986 | ||
1989 | /* start QDIO request for this FSF request */ | 1987 | zfcp_erp_start_timer(fsf_req); |
1990 | retval = zfcp_fsf_req_send(erp_action->fsf_req, &erp_action->timer); | 1988 | retval = zfcp_fsf_req_send(fsf_req); |
1991 | if (retval) { | 1989 | if (retval) { |
1992 | ZFCP_LOG_INFO | 1990 | ZFCP_LOG_INFO |
1993 | ("error: Could not send exchange configuration data " | 1991 | ("error: Could not send exchange configuration data " |
1994 | "command on the adapter %s\n", | 1992 | "command on the adapter %s\n", |
1995 | zfcp_get_busid_by_adapter(erp_action->adapter)); | 1993 | zfcp_get_busid_by_adapter(erp_action->adapter)); |
1996 | zfcp_fsf_req_free(erp_action->fsf_req); | 1994 | zfcp_fsf_req_free(fsf_req); |
1997 | erp_action->fsf_req = NULL; | 1995 | erp_action->fsf_req = NULL; |
1998 | goto out; | 1996 | goto out; |
1999 | } | 1997 | } |
@@ -2223,10 +2221,9 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action, | |||
2223 | struct fsf_qtcb_bottom_port *data) | 2221 | struct fsf_qtcb_bottom_port *data) |
2224 | { | 2222 | { |
2225 | volatile struct qdio_buffer_element *sbale; | 2223 | volatile struct qdio_buffer_element *sbale; |
2226 | int retval = 0; | ||
2227 | unsigned long lock_flags; | ||
2228 | struct zfcp_fsf_req *fsf_req; | 2224 | struct zfcp_fsf_req *fsf_req; |
2229 | struct timer_list *timer; | 2225 | unsigned long lock_flags; |
2226 | int retval = 0; | ||
2230 | 2227 | ||
2231 | if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT)) { | 2228 | if (!(adapter->adapter_features & FSF_FEATURE_HBAAPI_MANAGEMENT)) { |
2232 | ZFCP_LOG_INFO("error: exchange port data " | 2229 | ZFCP_LOG_INFO("error: exchange port data " |
@@ -2259,22 +2256,11 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action, | |||
2259 | if (erp_action) { | 2256 | if (erp_action) { |
2260 | erp_action->fsf_req = fsf_req; | 2257 | erp_action->fsf_req = fsf_req; |
2261 | fsf_req->erp_action = erp_action; | 2258 | fsf_req->erp_action = erp_action; |
2262 | timer = &erp_action->timer; | 2259 | zfcp_erp_start_timer(fsf_req); |
2263 | } else { | 2260 | } else |
2264 | timer = kmalloc(sizeof(struct timer_list), GFP_ATOMIC); | 2261 | zfcp_fsf_start_timer(fsf_req, ZFCP_FSF_REQUEST_TIMEOUT); |
2265 | if (!timer) { | ||
2266 | write_unlock_irqrestore(&adapter->request_queue.queue_lock, | ||
2267 | lock_flags); | ||
2268 | zfcp_fsf_req_free(fsf_req); | ||
2269 | return -ENOMEM; | ||
2270 | } | ||
2271 | init_timer(timer); | ||
2272 | timer->function = zfcp_fsf_request_timeout_handler; | ||
2273 | timer->data = (unsigned long) adapter; | ||
2274 | timer->expires = ZFCP_FSF_REQUEST_TIMEOUT; | ||
2275 | } | ||
2276 | 2262 | ||
2277 | retval = zfcp_fsf_req_send(fsf_req, timer); | 2263 | retval = zfcp_fsf_req_send(fsf_req); |
2278 | if (retval) { | 2264 | if (retval) { |
2279 | ZFCP_LOG_INFO("error: Could not send an exchange port data " | 2265 | ZFCP_LOG_INFO("error: Could not send an exchange port data " |
2280 | "command on the adapter %s\n", | 2266 | "command on the adapter %s\n", |
@@ -2282,8 +2268,6 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action, | |||
2282 | zfcp_fsf_req_free(fsf_req); | 2268 | zfcp_fsf_req_free(fsf_req); |
2283 | if (erp_action) | 2269 | if (erp_action) |
2284 | erp_action->fsf_req = NULL; | 2270 | erp_action->fsf_req = NULL; |
2285 | else | ||
2286 | kfree(timer); | ||
2287 | write_unlock_irqrestore(&adapter->request_queue.queue_lock, | 2271 | write_unlock_irqrestore(&adapter->request_queue.queue_lock, |
2288 | lock_flags); | 2272 | lock_flags); |
2289 | return retval; | 2273 | return retval; |
@@ -2294,9 +2278,7 @@ zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action, | |||
2294 | if (!erp_action) { | 2278 | if (!erp_action) { |
2295 | wait_event(fsf_req->completion_wq, | 2279 | wait_event(fsf_req->completion_wq, |
2296 | fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); | 2280 | fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); |
2297 | del_timer_sync(timer); | ||
2298 | zfcp_fsf_req_free(fsf_req); | 2281 | zfcp_fsf_req_free(fsf_req); |
2299 | kfree(timer); | ||
2300 | } | 2282 | } |
2301 | return retval; | 2283 | return retval; |
2302 | } | 2284 | } |
@@ -2378,6 +2360,7 @@ int | |||
2378 | zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) | 2360 | zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) |
2379 | { | 2361 | { |
2380 | volatile struct qdio_buffer_element *sbale; | 2362 | volatile struct qdio_buffer_element *sbale; |
2363 | struct zfcp_fsf_req *fsf_req; | ||
2381 | unsigned long lock_flags; | 2364 | unsigned long lock_flags; |
2382 | int retval = 0; | 2365 | int retval = 0; |
2383 | 2366 | ||
@@ -2386,7 +2369,7 @@ zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) | |||
2386 | FSF_QTCB_OPEN_PORT_WITH_DID, | 2369 | FSF_QTCB_OPEN_PORT_WITH_DID, |
2387 | ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP, | 2370 | ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP, |
2388 | erp_action->adapter->pool.fsf_req_erp, | 2371 | erp_action->adapter->pool.fsf_req_erp, |
2389 | &lock_flags, &(erp_action->fsf_req)); | 2372 | &lock_flags, &fsf_req); |
2390 | if (retval < 0) { | 2373 | if (retval < 0) { |
2391 | ZFCP_LOG_INFO("error: Could not create open port request " | 2374 | ZFCP_LOG_INFO("error: Could not create open port request " |
2392 | "for port 0x%016Lx on adapter %s.\n", | 2375 | "for port 0x%016Lx on adapter %s.\n", |
@@ -2395,24 +2378,24 @@ zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) | |||
2395 | goto out; | 2378 | goto out; |
2396 | } | 2379 | } |
2397 | 2380 | ||
2398 | sbale = zfcp_qdio_sbale_req(erp_action->fsf_req, | 2381 | sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_curr, 0); |
2399 | erp_action->fsf_req->sbal_curr, 0); | ||
2400 | sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; | 2382 | sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; |
2401 | sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; | 2383 | sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; |
2402 | 2384 | ||
2403 | erp_action->fsf_req->qtcb->bottom.support.d_id = erp_action->port->d_id; | 2385 | fsf_req->qtcb->bottom.support.d_id = erp_action->port->d_id; |
2404 | atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->port->status); | 2386 | atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->port->status); |
2405 | erp_action->fsf_req->data = (unsigned long) erp_action->port; | 2387 | fsf_req->data = (unsigned long) erp_action->port; |
2406 | erp_action->fsf_req->erp_action = erp_action; | 2388 | fsf_req->erp_action = erp_action; |
2389 | erp_action->fsf_req = fsf_req; | ||
2407 | 2390 | ||
2408 | /* start QDIO request for this FSF request */ | 2391 | zfcp_erp_start_timer(fsf_req); |
2409 | retval = zfcp_fsf_req_send(erp_action->fsf_req, &erp_action->timer); | 2392 | retval = zfcp_fsf_req_send(fsf_req); |
2410 | if (retval) { | 2393 | if (retval) { |
2411 | ZFCP_LOG_INFO("error: Could not send open port request for " | 2394 | ZFCP_LOG_INFO("error: Could not send open port request for " |
2412 | "port 0x%016Lx on adapter %s.\n", | 2395 | "port 0x%016Lx on adapter %s.\n", |
2413 | erp_action->port->wwpn, | 2396 | erp_action->port->wwpn, |
2414 | zfcp_get_busid_by_adapter(erp_action->adapter)); | 2397 | zfcp_get_busid_by_adapter(erp_action->adapter)); |
2415 | zfcp_fsf_req_free(erp_action->fsf_req); | 2398 | zfcp_fsf_req_free(fsf_req); |
2416 | erp_action->fsf_req = NULL; | 2399 | erp_action->fsf_req = NULL; |
2417 | goto out; | 2400 | goto out; |
2418 | } | 2401 | } |
@@ -2634,6 +2617,7 @@ int | |||
2634 | zfcp_fsf_close_port(struct zfcp_erp_action *erp_action) | 2617 | zfcp_fsf_close_port(struct zfcp_erp_action *erp_action) |
2635 | { | 2618 | { |
2636 | volatile struct qdio_buffer_element *sbale; | 2619 | volatile struct qdio_buffer_element *sbale; |
2620 | struct zfcp_fsf_req *fsf_req; | ||
2637 | unsigned long lock_flags; | 2621 | unsigned long lock_flags; |
2638 | int retval = 0; | 2622 | int retval = 0; |
2639 | 2623 | ||
@@ -2642,7 +2626,7 @@ zfcp_fsf_close_port(struct zfcp_erp_action *erp_action) | |||
2642 | FSF_QTCB_CLOSE_PORT, | 2626 | FSF_QTCB_CLOSE_PORT, |
2643 | ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP, | 2627 | ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP, |
2644 | erp_action->adapter->pool.fsf_req_erp, | 2628 | erp_action->adapter->pool.fsf_req_erp, |
2645 | &lock_flags, &(erp_action->fsf_req)); | 2629 | &lock_flags, &fsf_req); |
2646 | if (retval < 0) { | 2630 | if (retval < 0) { |
2647 | ZFCP_LOG_INFO("error: Could not create a close port request " | 2631 | ZFCP_LOG_INFO("error: Could not create a close port request " |
2648 | "for port 0x%016Lx on adapter %s.\n", | 2632 | "for port 0x%016Lx on adapter %s.\n", |
@@ -2651,25 +2635,25 @@ zfcp_fsf_close_port(struct zfcp_erp_action *erp_action) | |||
2651 | goto out; | 2635 | goto out; |
2652 | } | 2636 | } |
2653 | 2637 | ||
2654 | sbale = zfcp_qdio_sbale_req(erp_action->fsf_req, | 2638 | sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_curr, 0); |
2655 | erp_action->fsf_req->sbal_curr, 0); | ||
2656 | sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; | 2639 | sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; |
2657 | sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; | 2640 | sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; |
2658 | 2641 | ||
2659 | atomic_set_mask(ZFCP_STATUS_COMMON_CLOSING, &erp_action->port->status); | 2642 | atomic_set_mask(ZFCP_STATUS_COMMON_CLOSING, &erp_action->port->status); |
2660 | erp_action->fsf_req->data = (unsigned long) erp_action->port; | 2643 | fsf_req->data = (unsigned long) erp_action->port; |
2661 | erp_action->fsf_req->erp_action = erp_action; | 2644 | fsf_req->erp_action = erp_action; |
2662 | erp_action->fsf_req->qtcb->header.port_handle = | 2645 | fsf_req->qtcb->header.port_handle = erp_action->port->handle; |
2663 | erp_action->port->handle; | 2646 | fsf_req->erp_action = erp_action; |
2664 | 2647 | erp_action->fsf_req = fsf_req; | |
2665 | /* start QDIO request for this FSF request */ | 2648 | |
2666 | retval = zfcp_fsf_req_send(erp_action->fsf_req, &erp_action->timer); | 2649 | zfcp_erp_start_timer(fsf_req); |
2650 | retval = zfcp_fsf_req_send(fsf_req); | ||
2667 | if (retval) { | 2651 | if (retval) { |
2668 | ZFCP_LOG_INFO("error: Could not send a close port request for " | 2652 | ZFCP_LOG_INFO("error: Could not send a close port request for " |
2669 | "port 0x%016Lx on adapter %s.\n", | 2653 | "port 0x%016Lx on adapter %s.\n", |
2670 | erp_action->port->wwpn, | 2654 | erp_action->port->wwpn, |
2671 | zfcp_get_busid_by_adapter(erp_action->adapter)); | 2655 | zfcp_get_busid_by_adapter(erp_action->adapter)); |
2672 | zfcp_fsf_req_free(erp_action->fsf_req); | 2656 | zfcp_fsf_req_free(fsf_req); |
2673 | erp_action->fsf_req = NULL; | 2657 | erp_action->fsf_req = NULL; |
2674 | goto out; | 2658 | goto out; |
2675 | } | 2659 | } |
@@ -2766,16 +2750,17 @@ zfcp_fsf_close_port_handler(struct zfcp_fsf_req *fsf_req) | |||
2766 | int | 2750 | int |
2767 | zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) | 2751 | zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) |
2768 | { | 2752 | { |
2769 | int retval = 0; | ||
2770 | unsigned long lock_flags; | ||
2771 | volatile struct qdio_buffer_element *sbale; | 2753 | volatile struct qdio_buffer_element *sbale; |
2754 | struct zfcp_fsf_req *fsf_req; | ||
2755 | unsigned long lock_flags; | ||
2756 | int retval = 0; | ||
2772 | 2757 | ||
2773 | /* setup new FSF request */ | 2758 | /* setup new FSF request */ |
2774 | retval = zfcp_fsf_req_create(erp_action->adapter, | 2759 | retval = zfcp_fsf_req_create(erp_action->adapter, |
2775 | FSF_QTCB_CLOSE_PHYSICAL_PORT, | 2760 | FSF_QTCB_CLOSE_PHYSICAL_PORT, |
2776 | ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP, | 2761 | ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP, |
2777 | erp_action->adapter->pool.fsf_req_erp, | 2762 | erp_action->adapter->pool.fsf_req_erp, |
2778 | &lock_flags, &erp_action->fsf_req); | 2763 | &lock_flags, &fsf_req); |
2779 | if (retval < 0) { | 2764 | if (retval < 0) { |
2780 | ZFCP_LOG_INFO("error: Could not create close physical port " | 2765 | ZFCP_LOG_INFO("error: Could not create close physical port " |
2781 | "request (adapter %s, port 0x%016Lx)\n", | 2766 | "request (adapter %s, port 0x%016Lx)\n", |
@@ -2785,8 +2770,7 @@ zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) | |||
2785 | goto out; | 2770 | goto out; |
2786 | } | 2771 | } |
2787 | 2772 | ||
2788 | sbale = zfcp_qdio_sbale_req(erp_action->fsf_req, | 2773 | sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_curr, 0); |
2789 | erp_action->fsf_req->sbal_curr, 0); | ||
2790 | sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; | 2774 | sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; |
2791 | sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; | 2775 | sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; |
2792 | 2776 | ||
@@ -2794,20 +2778,19 @@ zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) | |||
2794 | atomic_set_mask(ZFCP_STATUS_PORT_PHYS_CLOSING, | 2778 | atomic_set_mask(ZFCP_STATUS_PORT_PHYS_CLOSING, |
2795 | &erp_action->port->status); | 2779 | &erp_action->port->status); |
2796 | /* save a pointer to this port */ | 2780 | /* save a pointer to this port */ |
2797 | erp_action->fsf_req->data = (unsigned long) erp_action->port; | 2781 | fsf_req->data = (unsigned long) erp_action->port; |
2798 | /* port to be closed */ | 2782 | fsf_req->qtcb->header.port_handle = erp_action->port->handle; |
2799 | erp_action->fsf_req->qtcb->header.port_handle = | 2783 | fsf_req->erp_action = erp_action; |
2800 | erp_action->port->handle; | 2784 | erp_action->fsf_req = fsf_req; |
2801 | erp_action->fsf_req->erp_action = erp_action; | 2785 | |
2802 | 2786 | zfcp_erp_start_timer(fsf_req); | |
2803 | /* start QDIO request for this FSF request */ | 2787 | retval = zfcp_fsf_req_send(fsf_req); |
2804 | retval = zfcp_fsf_req_send(erp_action->fsf_req, &erp_action->timer); | ||
2805 | if (retval) { | 2788 | if (retval) { |
2806 | ZFCP_LOG_INFO("error: Could not send close physical port " | 2789 | ZFCP_LOG_INFO("error: Could not send close physical port " |
2807 | "request (adapter %s, port 0x%016Lx)\n", | 2790 | "request (adapter %s, port 0x%016Lx)\n", |
2808 | zfcp_get_busid_by_adapter(erp_action->adapter), | 2791 | zfcp_get_busid_by_adapter(erp_action->adapter), |
2809 | erp_action->port->wwpn); | 2792 | erp_action->port->wwpn); |
2810 | zfcp_fsf_req_free(erp_action->fsf_req); | 2793 | zfcp_fsf_req_free(fsf_req); |
2811 | erp_action->fsf_req = NULL; | 2794 | erp_action->fsf_req = NULL; |
2812 | goto out; | 2795 | goto out; |
2813 | } | 2796 | } |
@@ -2972,6 +2955,7 @@ int | |||
2972 | zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action) | 2955 | zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action) |
2973 | { | 2956 | { |
2974 | volatile struct qdio_buffer_element *sbale; | 2957 | volatile struct qdio_buffer_element *sbale; |
2958 | struct zfcp_fsf_req *fsf_req; | ||
2975 | unsigned long lock_flags; | 2959 | unsigned long lock_flags; |
2976 | int retval = 0; | 2960 | int retval = 0; |
2977 | 2961 | ||
@@ -2980,7 +2964,7 @@ zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action) | |||
2980 | FSF_QTCB_OPEN_LUN, | 2964 | FSF_QTCB_OPEN_LUN, |
2981 | ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP, | 2965 | ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP, |
2982 | erp_action->adapter->pool.fsf_req_erp, | 2966 | erp_action->adapter->pool.fsf_req_erp, |
2983 | &lock_flags, &(erp_action->fsf_req)); | 2967 | &lock_flags, &fsf_req); |
2984 | if (retval < 0) { | 2968 | if (retval < 0) { |
2985 | ZFCP_LOG_INFO("error: Could not create open unit request for " | 2969 | ZFCP_LOG_INFO("error: Could not create open unit request for " |
2986 | "unit 0x%016Lx on port 0x%016Lx on adapter %s.\n", | 2970 | "unit 0x%016Lx on port 0x%016Lx on adapter %s.\n", |
@@ -2990,24 +2974,22 @@ zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action) | |||
2990 | goto out; | 2974 | goto out; |
2991 | } | 2975 | } |
2992 | 2976 | ||
2993 | sbale = zfcp_qdio_sbale_req(erp_action->fsf_req, | 2977 | sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_curr, 0); |
2994 | erp_action->fsf_req->sbal_curr, 0); | ||
2995 | sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; | 2978 | sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; |
2996 | sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; | 2979 | sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; |
2997 | 2980 | ||
2998 | erp_action->fsf_req->qtcb->header.port_handle = | 2981 | fsf_req->qtcb->header.port_handle = erp_action->port->handle; |
2999 | erp_action->port->handle; | 2982 | fsf_req->qtcb->bottom.support.fcp_lun = erp_action->unit->fcp_lun; |
3000 | erp_action->fsf_req->qtcb->bottom.support.fcp_lun = | ||
3001 | erp_action->unit->fcp_lun; | ||
3002 | if (!(erp_action->adapter->connection_features & FSF_FEATURE_NPIV_MODE)) | 2983 | if (!(erp_action->adapter->connection_features & FSF_FEATURE_NPIV_MODE)) |
3003 | erp_action->fsf_req->qtcb->bottom.support.option = | 2984 | fsf_req->qtcb->bottom.support.option = |
3004 | FSF_OPEN_LUN_SUPPRESS_BOXING; | 2985 | FSF_OPEN_LUN_SUPPRESS_BOXING; |
3005 | atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->unit->status); | 2986 | atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->unit->status); |
3006 | erp_action->fsf_req->data = (unsigned long) erp_action->unit; | 2987 | fsf_req->data = (unsigned long) erp_action->unit; |
3007 | erp_action->fsf_req->erp_action = erp_action; | 2988 | fsf_req->erp_action = erp_action; |
2989 | erp_action->fsf_req = fsf_req; | ||
3008 | 2990 | ||
3009 | /* start QDIO request for this FSF request */ | 2991 | zfcp_erp_start_timer(fsf_req); |
3010 | retval = zfcp_fsf_req_send(erp_action->fsf_req, &erp_action->timer); | 2992 | retval = zfcp_fsf_req_send(erp_action->fsf_req); |
3011 | if (retval) { | 2993 | if (retval) { |
3012 | ZFCP_LOG_INFO("error: Could not send an open unit request " | 2994 | ZFCP_LOG_INFO("error: Could not send an open unit request " |
3013 | "on the adapter %s, port 0x%016Lx for " | 2995 | "on the adapter %s, port 0x%016Lx for " |
@@ -3015,7 +2997,7 @@ zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action) | |||
3015 | zfcp_get_busid_by_adapter(erp_action->adapter), | 2997 | zfcp_get_busid_by_adapter(erp_action->adapter), |
3016 | erp_action->port->wwpn, | 2998 | erp_action->port->wwpn, |
3017 | erp_action->unit->fcp_lun); | 2999 | erp_action->unit->fcp_lun); |
3018 | zfcp_fsf_req_free(erp_action->fsf_req); | 3000 | zfcp_fsf_req_free(fsf_req); |
3019 | erp_action->fsf_req = NULL; | 3001 | erp_action->fsf_req = NULL; |
3020 | goto out; | 3002 | goto out; |
3021 | } | 3003 | } |
@@ -3308,6 +3290,7 @@ int | |||
3308 | zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action) | 3290 | zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action) |
3309 | { | 3291 | { |
3310 | volatile struct qdio_buffer_element *sbale; | 3292 | volatile struct qdio_buffer_element *sbale; |
3293 | struct zfcp_fsf_req *fsf_req; | ||
3311 | unsigned long lock_flags; | 3294 | unsigned long lock_flags; |
3312 | int retval = 0; | 3295 | int retval = 0; |
3313 | 3296 | ||
@@ -3316,7 +3299,7 @@ zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action) | |||
3316 | FSF_QTCB_CLOSE_LUN, | 3299 | FSF_QTCB_CLOSE_LUN, |
3317 | ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP, | 3300 | ZFCP_WAIT_FOR_SBAL | ZFCP_REQ_AUTO_CLEANUP, |
3318 | erp_action->adapter->pool.fsf_req_erp, | 3301 | erp_action->adapter->pool.fsf_req_erp, |
3319 | &lock_flags, &(erp_action->fsf_req)); | 3302 | &lock_flags, &fsf_req); |
3320 | if (retval < 0) { | 3303 | if (retval < 0) { |
3321 | ZFCP_LOG_INFO("error: Could not create close unit request for " | 3304 | ZFCP_LOG_INFO("error: Could not create close unit request for " |
3322 | "unit 0x%016Lx on port 0x%016Lx on adapter %s.\n", | 3305 | "unit 0x%016Lx on port 0x%016Lx on adapter %s.\n", |
@@ -3326,27 +3309,26 @@ zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action) | |||
3326 | goto out; | 3309 | goto out; |
3327 | } | 3310 | } |
3328 | 3311 | ||
3329 | sbale = zfcp_qdio_sbale_req(erp_action->fsf_req, | 3312 | sbale = zfcp_qdio_sbale_req(fsf_req, fsf_req->sbal_curr, 0); |
3330 | erp_action->fsf_req->sbal_curr, 0); | ||
3331 | sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; | 3313 | sbale[0].flags |= SBAL_FLAGS0_TYPE_READ; |
3332 | sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; | 3314 | sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; |
3333 | 3315 | ||
3334 | erp_action->fsf_req->qtcb->header.port_handle = | 3316 | fsf_req->qtcb->header.port_handle = erp_action->port->handle; |
3335 | erp_action->port->handle; | 3317 | fsf_req->qtcb->header.lun_handle = erp_action->unit->handle; |
3336 | erp_action->fsf_req->qtcb->header.lun_handle = erp_action->unit->handle; | ||
3337 | atomic_set_mask(ZFCP_STATUS_COMMON_CLOSING, &erp_action->unit->status); | 3318 | atomic_set_mask(ZFCP_STATUS_COMMON_CLOSING, &erp_action->unit->status); |
3338 | erp_action->fsf_req->data = (unsigned long) erp_action->unit; | 3319 | fsf_req->data = (unsigned long) erp_action->unit; |
3339 | erp_action->fsf_req->erp_action = erp_action; | 3320 | fsf_req->erp_action = erp_action; |
3321 | erp_action->fsf_req = fsf_req; | ||
3340 | 3322 | ||
3341 | /* start QDIO request for this FSF request */ | 3323 | zfcp_erp_start_timer(fsf_req); |
3342 | retval = zfcp_fsf_req_send(erp_action->fsf_req, &erp_action->timer); | 3324 | retval = zfcp_fsf_req_send(erp_action->fsf_req); |
3343 | if (retval) { | 3325 | if (retval) { |
3344 | ZFCP_LOG_INFO("error: Could not send a close unit request for " | 3326 | ZFCP_LOG_INFO("error: Could not send a close unit request for " |
3345 | "unit 0x%016Lx on port 0x%016Lx onadapter %s.\n", | 3327 | "unit 0x%016Lx on port 0x%016Lx onadapter %s.\n", |
3346 | erp_action->unit->fcp_lun, | 3328 | erp_action->unit->fcp_lun, |
3347 | erp_action->port->wwpn, | 3329 | erp_action->port->wwpn, |
3348 | zfcp_get_busid_by_adapter(erp_action->adapter)); | 3330 | zfcp_get_busid_by_adapter(erp_action->adapter)); |
3349 | zfcp_fsf_req_free(erp_action->fsf_req); | 3331 | zfcp_fsf_req_free(fsf_req); |
3350 | erp_action->fsf_req = NULL; | 3332 | erp_action->fsf_req = NULL; |
3351 | goto out; | 3333 | goto out; |
3352 | } | 3334 | } |
@@ -3499,7 +3481,7 @@ int | |||
3499 | zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter, | 3481 | zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter, |
3500 | struct zfcp_unit *unit, | 3482 | struct zfcp_unit *unit, |
3501 | struct scsi_cmnd * scsi_cmnd, | 3483 | struct scsi_cmnd * scsi_cmnd, |
3502 | struct timer_list *timer, int req_flags) | 3484 | int use_timer, int req_flags) |
3503 | { | 3485 | { |
3504 | struct zfcp_fsf_req *fsf_req = NULL; | 3486 | struct zfcp_fsf_req *fsf_req = NULL; |
3505 | struct fcp_cmnd_iu *fcp_cmnd_iu; | 3487 | struct fcp_cmnd_iu *fcp_cmnd_iu; |
@@ -3640,11 +3622,10 @@ zfcp_fsf_send_fcp_command_task(struct zfcp_adapter *adapter, | |||
3640 | ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, | 3622 | ZFCP_HEX_DUMP(ZFCP_LOG_LEVEL_DEBUG, |
3641 | (char *) scsi_cmnd->cmnd, scsi_cmnd->cmd_len); | 3623 | (char *) scsi_cmnd->cmnd, scsi_cmnd->cmd_len); |
3642 | 3624 | ||
3643 | /* | 3625 | if (use_timer) |
3644 | * start QDIO request for this FSF request | 3626 | zfcp_fsf_start_timer(fsf_req, ZFCP_FSF_REQUEST_TIMEOUT); |
3645 | * covered by an SBALE) | 3627 | |
3646 | */ | 3628 | retval = zfcp_fsf_req_send(fsf_req); |
3647 | retval = zfcp_fsf_req_send(fsf_req, timer); | ||
3648 | if (unlikely(retval < 0)) { | 3629 | if (unlikely(retval < 0)) { |
3649 | ZFCP_LOG_INFO("error: Could not send FCP command request " | 3630 | ZFCP_LOG_INFO("error: Could not send FCP command request " |
3650 | "on adapter %s, port 0x%016Lx, unit 0x%016Lx\n", | 3631 | "on adapter %s, port 0x%016Lx, unit 0x%016Lx\n", |
@@ -3729,11 +3710,9 @@ zfcp_fsf_send_fcp_command_task_management(struct zfcp_adapter *adapter, | |||
3729 | fcp_cmnd_iu->fcp_lun = unit->fcp_lun; | 3710 | fcp_cmnd_iu->fcp_lun = unit->fcp_lun; |
3730 | fcp_cmnd_iu->task_management_flags = tm_flags; | 3711 | fcp_cmnd_iu->task_management_flags = tm_flags; |
3731 | 3712 | ||
3732 | /* start QDIO request for this FSF request */ | 3713 | zfcp_fsf_start_timer(fsf_req, ZFCP_SCSI_ER_TIMEOUT); |
3733 | zfcp_fsf_start_scsi_er_timer(adapter); | 3714 | retval = zfcp_fsf_req_send(fsf_req); |
3734 | retval = zfcp_fsf_req_send(fsf_req, NULL); | ||
3735 | if (retval) { | 3715 | if (retval) { |
3736 | del_timer(&adapter->scsi_er_timer); | ||
3737 | ZFCP_LOG_INFO("error: Could not send an FCP-command (task " | 3716 | ZFCP_LOG_INFO("error: Could not send an FCP-command (task " |
3738 | "management) on adapter %s, port 0x%016Lx for " | 3717 | "management) on adapter %s, port 0x%016Lx for " |
3739 | "unit LUN 0x%016Lx\n", | 3718 | "unit LUN 0x%016Lx\n", |
@@ -4237,7 +4216,6 @@ zfcp_fsf_send_fcp_command_task_management_handler(struct zfcp_fsf_req *fsf_req) | |||
4237 | char *fcp_rsp_info = zfcp_get_fcp_rsp_info_ptr(fcp_rsp_iu); | 4216 | char *fcp_rsp_info = zfcp_get_fcp_rsp_info_ptr(fcp_rsp_iu); |
4238 | struct zfcp_unit *unit = (struct zfcp_unit *) fsf_req->data; | 4217 | struct zfcp_unit *unit = (struct zfcp_unit *) fsf_req->data; |
4239 | 4218 | ||
4240 | del_timer(&fsf_req->adapter->scsi_er_timer); | ||
4241 | if (fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR) { | 4219 | if (fsf_req->status & ZFCP_STATUS_FSFREQ_ERROR) { |
4242 | fsf_req->status |= ZFCP_STATUS_FSFREQ_TMFUNCFAILED; | 4220 | fsf_req->status |= ZFCP_STATUS_FSFREQ_TMFUNCFAILED; |
4243 | goto skip_fsfstatus; | 4221 | goto skip_fsfstatus; |
@@ -4306,7 +4284,6 @@ zfcp_fsf_control_file(struct zfcp_adapter *adapter, | |||
4306 | struct zfcp_fsf_req *fsf_req; | 4284 | struct zfcp_fsf_req *fsf_req; |
4307 | struct fsf_qtcb_bottom_support *bottom; | 4285 | struct fsf_qtcb_bottom_support *bottom; |
4308 | volatile struct qdio_buffer_element *sbale; | 4286 | volatile struct qdio_buffer_element *sbale; |
4309 | struct timer_list *timer; | ||
4310 | unsigned long lock_flags; | 4287 | unsigned long lock_flags; |
4311 | int req_flags = 0; | 4288 | int req_flags = 0; |
4312 | int direction; | 4289 | int direction; |
@@ -4338,12 +4315,6 @@ zfcp_fsf_control_file(struct zfcp_adapter *adapter, | |||
4338 | goto out; | 4315 | goto out; |
4339 | } | 4316 | } |
4340 | 4317 | ||
4341 | timer = kmalloc(sizeof(struct timer_list), GFP_KERNEL); | ||
4342 | if (!timer) { | ||
4343 | retval = -ENOMEM; | ||
4344 | goto out; | ||
4345 | } | ||
4346 | |||
4347 | retval = zfcp_fsf_req_create(adapter, fsf_command, req_flags, | 4318 | retval = zfcp_fsf_req_create(adapter, fsf_command, req_flags, |
4348 | NULL, &lock_flags, &fsf_req); | 4319 | NULL, &lock_flags, &fsf_req); |
4349 | if (retval < 0) { | 4320 | if (retval < 0) { |
@@ -4378,12 +4349,8 @@ zfcp_fsf_control_file(struct zfcp_adapter *adapter, | |||
4378 | } else | 4349 | } else |
4379 | sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; | 4350 | sbale[1].flags |= SBAL_FLAGS_LAST_ENTRY; |
4380 | 4351 | ||
4381 | init_timer(timer); | 4352 | zfcp_fsf_start_timer(fsf_req, ZFCP_FSF_REQUEST_TIMEOUT); |
4382 | timer->function = zfcp_fsf_request_timeout_handler; | 4353 | retval = zfcp_fsf_req_send(fsf_req); |
4383 | timer->data = (unsigned long) adapter; | ||
4384 | timer->expires = ZFCP_FSF_REQUEST_TIMEOUT; | ||
4385 | |||
4386 | retval = zfcp_fsf_req_send(fsf_req, timer); | ||
4387 | if (retval < 0) { | 4354 | if (retval < 0) { |
4388 | ZFCP_LOG_INFO("initiation of cfdc up/download failed" | 4355 | ZFCP_LOG_INFO("initiation of cfdc up/download failed" |
4389 | "(adapter %s)\n", | 4356 | "(adapter %s)\n", |
@@ -4403,15 +4370,12 @@ zfcp_fsf_control_file(struct zfcp_adapter *adapter, | |||
4403 | fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); | 4370 | fsf_req->status & ZFCP_STATUS_FSFREQ_COMPLETED); |
4404 | 4371 | ||
4405 | *fsf_req_ptr = fsf_req; | 4372 | *fsf_req_ptr = fsf_req; |
4406 | del_timer_sync(timer); | 4373 | goto out; |
4407 | goto free_timer; | ||
4408 | 4374 | ||
4409 | free_fsf_req: | 4375 | free_fsf_req: |
4410 | zfcp_fsf_req_free(fsf_req); | 4376 | zfcp_fsf_req_free(fsf_req); |
4411 | unlock_queue_lock: | 4377 | unlock_queue_lock: |
4412 | write_unlock_irqrestore(&adapter->request_queue.queue_lock, lock_flags); | 4378 | write_unlock_irqrestore(&adapter->request_queue.queue_lock, lock_flags); |
4413 | free_timer: | ||
4414 | kfree(timer); | ||
4415 | out: | 4379 | out: |
4416 | return retval; | 4380 | return retval; |
4417 | } | 4381 | } |
@@ -4688,7 +4652,8 @@ zfcp_fsf_req_create(struct zfcp_adapter *adapter, u32 fsf_cmd, int req_flags, | |||
4688 | adapter->req_no++; | 4652 | adapter->req_no++; |
4689 | fsf_req->req_id = adapter->req_no++; | 4653 | fsf_req->req_id = adapter->req_no++; |
4690 | 4654 | ||
4691 | zfcp_fsf_req_qtcb_init(fsf_req); | 4655 | init_timer(&fsf_req->timer); |
4656 | zfcp_fsf_req_qtcb_init(fsf_req); | ||
4692 | 4657 | ||
4693 | /* initialize waitqueue which may be used to wait on | 4658 | /* initialize waitqueue which may be used to wait on |
4694 | this request completion */ | 4659 | this request completion */ |
@@ -4758,8 +4723,7 @@ zfcp_fsf_req_create(struct zfcp_adapter *adapter, u32 fsf_cmd, int req_flags, | |||
4758 | * returns: 0 - request transfer succesfully started | 4723 | * returns: 0 - request transfer succesfully started |
4759 | * !0 - start of request transfer failed | 4724 | * !0 - start of request transfer failed |
4760 | */ | 4725 | */ |
4761 | static int | 4726 | static int zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req) |
4762 | zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req, struct timer_list *timer) | ||
4763 | { | 4727 | { |
4764 | struct zfcp_adapter *adapter; | 4728 | struct zfcp_adapter *adapter; |
4765 | struct zfcp_qdio_queue *req_queue; | 4729 | struct zfcp_qdio_queue *req_queue; |
@@ -4787,12 +4751,6 @@ zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req, struct timer_list *timer) | |||
4787 | 4751 | ||
4788 | inc_seq_no = (fsf_req->qtcb != NULL); | 4752 | inc_seq_no = (fsf_req->qtcb != NULL); |
4789 | 4753 | ||
4790 | /* figure out expiration time of timeout and start timeout */ | ||
4791 | if (unlikely(timer)) { | ||
4792 | timer->expires += jiffies; | ||
4793 | add_timer(timer); | ||
4794 | } | ||
4795 | |||
4796 | ZFCP_LOG_TRACE("request queue of adapter %s: " | 4754 | ZFCP_LOG_TRACE("request queue of adapter %s: " |
4797 | "next free SBAL is %i, %i free SBALs\n", | 4755 | "next free SBAL is %i, %i free SBALs\n", |
4798 | zfcp_get_busid_by_adapter(adapter), | 4756 | zfcp_get_busid_by_adapter(adapter), |
@@ -4829,12 +4787,7 @@ zfcp_fsf_req_send(struct zfcp_fsf_req *fsf_req, struct timer_list *timer) | |||
4829 | if (unlikely(retval)) { | 4787 | if (unlikely(retval)) { |
4830 | /* Queues are down..... */ | 4788 | /* Queues are down..... */ |
4831 | retval = -EIO; | 4789 | retval = -EIO; |
4832 | /* | 4790 | del_timer(&fsf_req->timer); |
4833 | * FIXME(potential race): | ||
4834 | * timer might be expired (absolutely unlikely) | ||
4835 | */ | ||
4836 | if (timer) | ||
4837 | del_timer(timer); | ||
4838 | spin_lock(&adapter->req_list_lock); | 4791 | spin_lock(&adapter->req_list_lock); |
4839 | zfcp_reqlist_remove(adapter, fsf_req->req_id); | 4792 | zfcp_reqlist_remove(adapter, fsf_req->req_id); |
4840 | spin_unlock(&adapter->req_list_lock); | 4793 | spin_unlock(&adapter->req_list_lock); |