diff options
Diffstat (limited to 'drivers/s390/scsi/zfcp_fsf.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_fsf.c | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c index e6d815593b49..19c1ca913874 100644 --- a/drivers/s390/scsi/zfcp_fsf.c +++ b/drivers/s390/scsi/zfcp_fsf.c | |||
@@ -8,6 +8,31 @@ | |||
8 | 8 | ||
9 | #include "zfcp_ext.h" | 9 | #include "zfcp_ext.h" |
10 | 10 | ||
11 | static void zfcp_fsf_request_timeout_handler(unsigned long data) | ||
12 | { | ||
13 | struct zfcp_adapter *adapter = (struct zfcp_adapter *) data; | ||
14 | zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 62, | ||
15 | NULL); | ||
16 | } | ||
17 | |||
18 | static void zfcp_fsf_start_timer(struct zfcp_fsf_req *fsf_req, | ||
19 | unsigned long timeout) | ||
20 | { | ||
21 | fsf_req->timer.function = zfcp_fsf_request_timeout_handler; | ||
22 | fsf_req->timer.data = (unsigned long) fsf_req->adapter; | ||
23 | fsf_req->timer.expires = jiffies + timeout; | ||
24 | add_timer(&fsf_req->timer); | ||
25 | } | ||
26 | |||
27 | static void zfcp_fsf_start_erp_timer(struct zfcp_fsf_req *fsf_req) | ||
28 | { | ||
29 | BUG_ON(!fsf_req->erp_action); | ||
30 | fsf_req->timer.function = zfcp_erp_timeout_handler; | ||
31 | fsf_req->timer.data = (unsigned long) fsf_req->erp_action; | ||
32 | fsf_req->timer.expires = jiffies + 30 * HZ; | ||
33 | add_timer(&fsf_req->timer); | ||
34 | } | ||
35 | |||
11 | /* association between FSF command and FSF QTCB type */ | 36 | /* association between FSF command and FSF QTCB type */ |
12 | static u32 fsf_qtcb_type[] = { | 37 | static u32 fsf_qtcb_type[] = { |
13 | [FSF_QTCB_FCP_CMND] = FSF_IO_COMMAND, | 38 | [FSF_QTCB_FCP_CMND] = FSF_IO_COMMAND, |
@@ -485,7 +510,7 @@ void zfcp_fsf_req_complete(struct zfcp_fsf_req *req) | |||
485 | req->handler(req); | 510 | req->handler(req); |
486 | 511 | ||
487 | if (req->erp_action) | 512 | if (req->erp_action) |
488 | zfcp_erp_async_handler(req->erp_action, 0); | 513 | zfcp_erp_notify(req->erp_action, 0); |
489 | req->status |= ZFCP_STATUS_FSFREQ_COMPLETED; | 514 | req->status |= ZFCP_STATUS_FSFREQ_COMPLETED; |
490 | 515 | ||
491 | if (likely(req->status & ZFCP_STATUS_FSFREQ_CLEANUP)) | 516 | if (likely(req->status & ZFCP_STATUS_FSFREQ_CLEANUP)) |
@@ -1108,7 +1133,7 @@ int zfcp_fsf_send_ct(struct zfcp_send_ct *ct, mempool_t *pool, | |||
1108 | if (erp_action) { | 1133 | if (erp_action) { |
1109 | erp_action->fsf_req = req; | 1134 | erp_action->fsf_req = req; |
1110 | req->erp_action = erp_action; | 1135 | req->erp_action = erp_action; |
1111 | zfcp_erp_start_timer(req); | 1136 | zfcp_fsf_start_erp_timer(req); |
1112 | } else | 1137 | } else |
1113 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); | 1138 | zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT); |
1114 | 1139 | ||
@@ -1263,7 +1288,7 @@ int zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action) | |||
1263 | req->handler = zfcp_fsf_exchange_config_data_handler; | 1288 | req->handler = zfcp_fsf_exchange_config_data_handler; |
1264 | erp_action->fsf_req = req; | 1289 | erp_action->fsf_req = req; |
1265 | 1290 | ||
1266 | zfcp_erp_start_timer(req); | 1291 | zfcp_fsf_start_erp_timer(req); |
1267 | retval = zfcp_fsf_req_send(req); | 1292 | retval = zfcp_fsf_req_send(req); |
1268 | if (retval) { | 1293 | if (retval) { |
1269 | zfcp_fsf_req_free(req); | 1294 | zfcp_fsf_req_free(req); |
@@ -1353,7 +1378,7 @@ int zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action) | |||
1353 | req->erp_action = erp_action; | 1378 | req->erp_action = erp_action; |
1354 | erp_action->fsf_req = req; | 1379 | erp_action->fsf_req = req; |
1355 | 1380 | ||
1356 | zfcp_erp_start_timer(req); | 1381 | zfcp_fsf_start_erp_timer(req); |
1357 | retval = zfcp_fsf_req_send(req); | 1382 | retval = zfcp_fsf_req_send(req); |
1358 | if (retval) { | 1383 | if (retval) { |
1359 | zfcp_fsf_req_free(req); | 1384 | zfcp_fsf_req_free(req); |
@@ -1530,7 +1555,7 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action) | |||
1530 | erp_action->fsf_req = req; | 1555 | erp_action->fsf_req = req; |
1531 | atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->port->status); | 1556 | atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->port->status); |
1532 | 1557 | ||
1533 | zfcp_erp_start_timer(req); | 1558 | zfcp_fsf_start_erp_timer(req); |
1534 | retval = zfcp_fsf_req_send(req); | 1559 | retval = zfcp_fsf_req_send(req); |
1535 | if (retval) { | 1560 | if (retval) { |
1536 | zfcp_fsf_req_free(req); | 1561 | zfcp_fsf_req_free(req); |
@@ -1601,7 +1626,7 @@ int zfcp_fsf_close_port(struct zfcp_erp_action *erp_action) | |||
1601 | erp_action->fsf_req = req; | 1626 | erp_action->fsf_req = req; |
1602 | atomic_set_mask(ZFCP_STATUS_COMMON_CLOSING, &erp_action->port->status); | 1627 | atomic_set_mask(ZFCP_STATUS_COMMON_CLOSING, &erp_action->port->status); |
1603 | 1628 | ||
1604 | zfcp_erp_start_timer(req); | 1629 | zfcp_fsf_start_erp_timer(req); |
1605 | retval = zfcp_fsf_req_send(req); | 1630 | retval = zfcp_fsf_req_send(req); |
1606 | if (retval) { | 1631 | if (retval) { |
1607 | zfcp_fsf_req_free(req); | 1632 | zfcp_fsf_req_free(req); |
@@ -1699,7 +1724,7 @@ int zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action) | |||
1699 | atomic_set_mask(ZFCP_STATUS_PORT_PHYS_CLOSING, | 1724 | atomic_set_mask(ZFCP_STATUS_PORT_PHYS_CLOSING, |
1700 | &erp_action->port->status); | 1725 | &erp_action->port->status); |
1701 | 1726 | ||
1702 | zfcp_erp_start_timer(req); | 1727 | zfcp_fsf_start_erp_timer(req); |
1703 | retval = zfcp_fsf_req_send(req); | 1728 | retval = zfcp_fsf_req_send(req); |
1704 | if (retval) { | 1729 | if (retval) { |
1705 | zfcp_fsf_req_free(req); | 1730 | zfcp_fsf_req_free(req); |
@@ -1878,7 +1903,7 @@ int zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action) | |||
1878 | 1903 | ||
1879 | atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->unit->status); | 1904 | atomic_set_mask(ZFCP_STATUS_COMMON_OPENING, &erp_action->unit->status); |
1880 | 1905 | ||
1881 | zfcp_erp_start_timer(req); | 1906 | zfcp_fsf_start_erp_timer(req); |
1882 | retval = zfcp_fsf_req_send(req); | 1907 | retval = zfcp_fsf_req_send(req); |
1883 | if (retval) { | 1908 | if (retval) { |
1884 | zfcp_fsf_req_free(req); | 1909 | zfcp_fsf_req_free(req); |
@@ -1963,7 +1988,7 @@ int zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action) | |||
1963 | erp_action->fsf_req = req; | 1988 | erp_action->fsf_req = req; |
1964 | atomic_set_mask(ZFCP_STATUS_COMMON_CLOSING, &erp_action->unit->status); | 1989 | atomic_set_mask(ZFCP_STATUS_COMMON_CLOSING, &erp_action->unit->status); |
1965 | 1990 | ||
1966 | zfcp_erp_start_timer(req); | 1991 | zfcp_fsf_start_erp_timer(req); |
1967 | retval = zfcp_fsf_req_send(req); | 1992 | retval = zfcp_fsf_req_send(req); |
1968 | if (retval) { | 1993 | if (retval) { |
1969 | zfcp_fsf_req_free(req); | 1994 | zfcp_fsf_req_free(req); |