aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/scsi/zfcp_erp.c
diff options
context:
space:
mode:
authorChristof Schmitt <christof.schmitt@de.ibm.com>2009-08-18 09:43:27 -0400
committerJames Bottomley <James.Bottomley@suse.de>2009-09-05 09:49:41 -0400
commit143bb6bfe36d20618d8bf667915fe14d14b8ae2f (patch)
treec0c1dad94d0ec49f25b3652581931f2b499b5f07 /drivers/s390/scsi/zfcp_erp.c
parent98fc4d5c8cd9bd1a412cca922feecb54c1c22d8e (diff)
[SCSI] zfcp: Defer resource allocation to first ccw_set_online call
So far, zfcp allocated all resources required for FCP adapters/subchannels when the device was discovered in the ccw_probe callback. If there are lots of unused FCP subchannels attached to a system, this is a waste of resources. To alleviate this, defer the resource allocation to the first call to ccw_set_online. To avoid disruptions during possible following calls to ccw_set_offline and then ccw_set_online, keep the adapter resources until the device is finally being removed via ccw_remove. While doing this, also manage the zfcp erp thread together with all other adapter resources in zfcp_adapter_enqueue/dequeue. Reviewed-by: Swen Schillig <swen@vnet.ibm.com> Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/s390/scsi/zfcp_erp.c')
-rw-r--r--drivers/s390/scsi/zfcp_erp.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c
index 577e15708598..73d366ba31e5 100644
--- a/drivers/s390/scsi/zfcp_erp.c
+++ b/drivers/s390/scsi/zfcp_erp.c
@@ -150,6 +150,9 @@ static int zfcp_erp_required_act(int want, struct zfcp_adapter *adapter,
150 a_status = atomic_read(&adapter->status); 150 a_status = atomic_read(&adapter->status);
151 if (a_status & ZFCP_STATUS_COMMON_ERP_INUSE) 151 if (a_status & ZFCP_STATUS_COMMON_ERP_INUSE)
152 return 0; 152 return 0;
153 if (!(a_status & ZFCP_STATUS_COMMON_RUNNING) &&
154 !(a_status & ZFCP_STATUS_COMMON_OPEN))
155 return 0; /* shutdown requested for closed adapter */
153 } 156 }
154 157
155 return need; 158 return need;
@@ -1349,6 +1352,8 @@ void zfcp_erp_thread_kill(struct zfcp_adapter *adapter)
1349{ 1352{
1350 kthread_stop(adapter->erp_thread); 1353 kthread_stop(adapter->erp_thread);
1351 adapter->erp_thread = NULL; 1354 adapter->erp_thread = NULL;
1355 WARN_ON(!list_empty(&adapter->erp_ready_head));
1356 WARN_ON(!list_empty(&adapter->erp_running_head));
1352} 1357}
1353 1358
1354/** 1359/**