aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_fsf.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/s390/scsi/zfcp_fsf.c')
-rw-r--r--drivers/s390/scsi/zfcp_fsf.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
index e8fb4d9baa8b..fd2371b69489 100644
--- a/drivers/s390/scsi/zfcp_fsf.c
+++ b/drivers/s390/scsi/zfcp_fsf.c
@@ -773,10 +773,11 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *req)
773 unsigned long flags; 773 unsigned long flags;
774 int idx; 774 int idx;
775 int with_qtcb = (req->qtcb != NULL); 775 int with_qtcb = (req->qtcb != NULL);
776 int req_id = req->req_id;
776 777
777 /* put allocated FSF request into hash table */ 778 /* put allocated FSF request into hash table */
778 spin_lock_irqsave(&adapter->req_list_lock, flags); 779 spin_lock_irqsave(&adapter->req_list_lock, flags);
779 idx = zfcp_reqlist_hash(req->req_id); 780 idx = zfcp_reqlist_hash(req_id);
780 list_add_tail(&req->list, &adapter->req_list[idx]); 781 list_add_tail(&req->list, &adapter->req_list[idx]);
781 spin_unlock_irqrestore(&adapter->req_list_lock, flags); 782 spin_unlock_irqrestore(&adapter->req_list_lock, flags);
782 783
@@ -786,7 +787,8 @@ static int zfcp_fsf_req_send(struct zfcp_fsf_req *req)
786 del_timer(&req->timer); 787 del_timer(&req->timer);
787 spin_lock_irqsave(&adapter->req_list_lock, flags); 788 spin_lock_irqsave(&adapter->req_list_lock, flags);
788 /* lookup request again, list might have changed */ 789 /* lookup request again, list might have changed */
789 if (zfcp_reqlist_find_safe(adapter, req)) 790 req = zfcp_reqlist_find(adapter, req_id);
791 if (req)
790 zfcp_reqlist_remove(adapter, req); 792 zfcp_reqlist_remove(adapter, req);
791 spin_unlock_irqrestore(&adapter->req_list_lock, flags); 793 spin_unlock_irqrestore(&adapter->req_list_lock, flags);
792 zfcp_erp_adapter_reopen(adapter, 0, "fsrs__1", req); 794 zfcp_erp_adapter_reopen(adapter, 0, "fsrs__1", req);
@@ -1262,13 +1264,13 @@ int zfcp_fsf_exchange_config_data(struct zfcp_erp_action *erp_action)
1262 FSF_FEATURE_UPDATE_ALERT; 1264 FSF_FEATURE_UPDATE_ALERT;
1263 req->erp_action = erp_action; 1265 req->erp_action = erp_action;
1264 req->handler = zfcp_fsf_exchange_config_data_handler; 1266 req->handler = zfcp_fsf_exchange_config_data_handler;
1265 erp_action->fsf_req = req; 1267 erp_action->fsf_req_id = req->req_id;
1266 1268
1267 zfcp_fsf_start_erp_timer(req); 1269 zfcp_fsf_start_erp_timer(req);
1268 retval = zfcp_fsf_req_send(req); 1270 retval = zfcp_fsf_req_send(req);
1269 if (retval) { 1271 if (retval) {
1270 zfcp_fsf_req_free(req); 1272 zfcp_fsf_req_free(req);
1271 erp_action->fsf_req = NULL; 1273 erp_action->fsf_req_id = 0;
1272 } 1274 }
1273out: 1275out:
1274 spin_unlock_bh(&qdio->req_q_lock); 1276 spin_unlock_bh(&qdio->req_q_lock);
@@ -1355,13 +1357,13 @@ int zfcp_fsf_exchange_port_data(struct zfcp_erp_action *erp_action)
1355 1357
1356 req->handler = zfcp_fsf_exchange_port_data_handler; 1358 req->handler = zfcp_fsf_exchange_port_data_handler;
1357 req->erp_action = erp_action; 1359 req->erp_action = erp_action;
1358 erp_action->fsf_req = req; 1360 erp_action->fsf_req_id = req->req_id;
1359 1361
1360 zfcp_fsf_start_erp_timer(req); 1362 zfcp_fsf_start_erp_timer(req);
1361 retval = zfcp_fsf_req_send(req); 1363 retval = zfcp_fsf_req_send(req);
1362 if (retval) { 1364 if (retval) {
1363 zfcp_fsf_req_free(req); 1365 zfcp_fsf_req_free(req);
1364 erp_action->fsf_req = NULL; 1366 erp_action->fsf_req_id = 0;
1365 } 1367 }
1366out: 1368out:
1367 spin_unlock_bh(&qdio->req_q_lock); 1369 spin_unlock_bh(&qdio->req_q_lock);
@@ -1521,14 +1523,14 @@ int zfcp_fsf_open_port(struct zfcp_erp_action *erp_action)
1521 hton24(req->qtcb->bottom.support.d_id, port->d_id); 1523 hton24(req->qtcb->bottom.support.d_id, port->d_id);
1522 req->data = port; 1524 req->data = port;
1523 req->erp_action = erp_action; 1525 req->erp_action = erp_action;
1524 erp_action->fsf_req = req; 1526 erp_action->fsf_req_id = req->req_id;
1525 get_device(&port->sysfs_device); 1527 get_device(&port->sysfs_device);
1526 1528
1527 zfcp_fsf_start_erp_timer(req); 1529 zfcp_fsf_start_erp_timer(req);
1528 retval = zfcp_fsf_req_send(req); 1530 retval = zfcp_fsf_req_send(req);
1529 if (retval) { 1531 if (retval) {
1530 zfcp_fsf_req_free(req); 1532 zfcp_fsf_req_free(req);
1531 erp_action->fsf_req = NULL; 1533 erp_action->fsf_req_id = 0;
1532 put_device(&port->sysfs_device); 1534 put_device(&port->sysfs_device);
1533 } 1535 }
1534out: 1536out:
@@ -1591,13 +1593,13 @@ int zfcp_fsf_close_port(struct zfcp_erp_action *erp_action)
1591 req->data = erp_action->port; 1593 req->data = erp_action->port;
1592 req->erp_action = erp_action; 1594 req->erp_action = erp_action;
1593 req->qtcb->header.port_handle = erp_action->port->handle; 1595 req->qtcb->header.port_handle = erp_action->port->handle;
1594 erp_action->fsf_req = req; 1596 erp_action->fsf_req_id = req->req_id;
1595 1597
1596 zfcp_fsf_start_erp_timer(req); 1598 zfcp_fsf_start_erp_timer(req);
1597 retval = zfcp_fsf_req_send(req); 1599 retval = zfcp_fsf_req_send(req);
1598 if (retval) { 1600 if (retval) {
1599 zfcp_fsf_req_free(req); 1601 zfcp_fsf_req_free(req);
1600 erp_action->fsf_req = NULL; 1602 erp_action->fsf_req_id = 0;
1601 } 1603 }
1602out: 1604out:
1603 spin_unlock_bh(&qdio->req_q_lock); 1605 spin_unlock_bh(&qdio->req_q_lock);
@@ -1817,13 +1819,13 @@ int zfcp_fsf_close_physical_port(struct zfcp_erp_action *erp_action)
1817 req->qtcb->header.port_handle = erp_action->port->handle; 1819 req->qtcb->header.port_handle = erp_action->port->handle;
1818 req->erp_action = erp_action; 1820 req->erp_action = erp_action;
1819 req->handler = zfcp_fsf_close_physical_port_handler; 1821 req->handler = zfcp_fsf_close_physical_port_handler;
1820 erp_action->fsf_req = req; 1822 erp_action->fsf_req_id = req->req_id;
1821 1823
1822 zfcp_fsf_start_erp_timer(req); 1824 zfcp_fsf_start_erp_timer(req);
1823 retval = zfcp_fsf_req_send(req); 1825 retval = zfcp_fsf_req_send(req);
1824 if (retval) { 1826 if (retval) {
1825 zfcp_fsf_req_free(req); 1827 zfcp_fsf_req_free(req);
1826 erp_action->fsf_req = NULL; 1828 erp_action->fsf_req_id = 0;
1827 } 1829 }
1828out: 1830out:
1829 spin_unlock_bh(&qdio->req_q_lock); 1831 spin_unlock_bh(&qdio->req_q_lock);
@@ -1991,7 +1993,7 @@ int zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action)
1991 req->handler = zfcp_fsf_open_unit_handler; 1993 req->handler = zfcp_fsf_open_unit_handler;
1992 req->data = erp_action->unit; 1994 req->data = erp_action->unit;
1993 req->erp_action = erp_action; 1995 req->erp_action = erp_action;
1994 erp_action->fsf_req = req; 1996 erp_action->fsf_req_id = req->req_id;
1995 1997
1996 if (!(adapter->connection_features & FSF_FEATURE_NPIV_MODE)) 1998 if (!(adapter->connection_features & FSF_FEATURE_NPIV_MODE))
1997 req->qtcb->bottom.support.option = FSF_OPEN_LUN_SUPPRESS_BOXING; 1999 req->qtcb->bottom.support.option = FSF_OPEN_LUN_SUPPRESS_BOXING;
@@ -2000,7 +2002,7 @@ int zfcp_fsf_open_unit(struct zfcp_erp_action *erp_action)
2000 retval = zfcp_fsf_req_send(req); 2002 retval = zfcp_fsf_req_send(req);
2001 if (retval) { 2003 if (retval) {
2002 zfcp_fsf_req_free(req); 2004 zfcp_fsf_req_free(req);
2003 erp_action->fsf_req = NULL; 2005 erp_action->fsf_req_id = 0;
2004 } 2006 }
2005out: 2007out:
2006 spin_unlock_bh(&qdio->req_q_lock); 2008 spin_unlock_bh(&qdio->req_q_lock);
@@ -2077,13 +2079,13 @@ int zfcp_fsf_close_unit(struct zfcp_erp_action *erp_action)
2077 req->handler = zfcp_fsf_close_unit_handler; 2079 req->handler = zfcp_fsf_close_unit_handler;
2078 req->data = erp_action->unit; 2080 req->data = erp_action->unit;
2079 req->erp_action = erp_action; 2081 req->erp_action = erp_action;
2080 erp_action->fsf_req = req; 2082 erp_action->fsf_req_id = req->req_id;
2081 2083
2082 zfcp_fsf_start_erp_timer(req); 2084 zfcp_fsf_start_erp_timer(req);
2083 retval = zfcp_fsf_req_send(req); 2085 retval = zfcp_fsf_req_send(req);
2084 if (retval) { 2086 if (retval) {
2085 zfcp_fsf_req_free(req); 2087 zfcp_fsf_req_free(req);
2086 erp_action->fsf_req = NULL; 2088 erp_action->fsf_req_id = 0;
2087 } 2089 }
2088out: 2090out:
2089 spin_unlock_bh(&qdio->req_q_lock); 2091 spin_unlock_bh(&qdio->req_q_lock);