aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSwen Schillig <swen@vnet.ibm.com>2008-11-26 12:07:40 -0500
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-12-01 11:18:04 -0500
commitfca55b6fb587e42c7761ee30bd1a6c313a9270c9 (patch)
tree334aaea4b8cd1c3a6d9dca3a0131005d49047358
parent0ac55aa90f2c3bd08e57e52a513b82b18ce0a5bc (diff)
[SCSI] zfcp: fix deadlock between wq triggered port scan and ERP
Waiting for the ERP to be finished in a task running in the global kernel work-queue is a bad idea, especially if the ERP needs to run another job in this work-queue before it can finish. -> deadlock. This patch removes the necessity to wait for a finished ERP from the scan task and moves the job scheduling to the end of the ERP. Signed-off-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
-rw-r--r--drivers/s390/scsi/zfcp_erp.c3
-rw-r--r--drivers/s390/scsi/zfcp_fc.c1
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index c55dd2728f90..c557ba34e1aa 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -720,7 +720,6 @@ static int zfcp_erp_adapter_strategy_generic(struct zfcp_erp_action *act,
720 goto failed_openfcp; 720 goto failed_openfcp;
721 721
722 atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &act->adapter->status); 722 atomic_set_mask(ZFCP_STATUS_COMMON_OPEN, &act->adapter->status);
723 schedule_work(&act->adapter->scan_work);
724 723
725 return ZFCP_ERP_SUCCEEDED; 724 return ZFCP_ERP_SUCCEEDED;
726 725
@@ -1284,6 +1283,8 @@ static void zfcp_erp_action_cleanup(struct zfcp_erp_action *act, int result)
1284 case ZFCP_ERP_ACTION_REOPEN_ADAPTER: 1283 case ZFCP_ERP_ACTION_REOPEN_ADAPTER:
1285 if (result != ZFCP_ERP_SUCCEEDED) 1284 if (result != ZFCP_ERP_SUCCEEDED)
1286 zfcp_erp_rports_del(adapter); 1285 zfcp_erp_rports_del(adapter);
1286 else
1287 schedule_work(&adapter->scan_work);
1287 zfcp_adapter_put(adapter); 1288 zfcp_adapter_put(adapter);
1288 break; 1289 break;
1289 } 1290 }
diff --git a/drivers/s390/scsi/zfcp_fc.c b/drivers/s390/scsi/zfcp_fc.c
index ae151390cb9f..8aab3091a7b1 100644
--- a/drivers/s390/scsi/zfcp_fc.c
+++ b/drivers/s390/scsi/zfcp_fc.c
@@ -610,7 +610,6 @@ int zfcp_scan_ports(struct zfcp_adapter *adapter)
610 int ret, i; 610 int ret, i;
611 struct zfcp_gpn_ft *gpn_ft; 611 struct zfcp_gpn_ft *gpn_ft;
612 612
613 zfcp_erp_wait(adapter); /* wait until adapter is finished with ERP */
614 if (fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPORT) 613 if (fc_host_port_type(adapter->scsi_host) != FC_PORTTYPE_NPORT)
615 return 0; 614 return 0;
616 615