public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Christof Schmitt <christof.schmitt@de.ibm.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org, linux-s390@vger.kernel.org,
	schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
	Christof Schmitt <christof.schmitt@de.ibm.com>,
	Swen Schillig <swen@vnet.ibm.com>
Subject: [patch 6/8] zfcp: Wait for port scan to complete when setting adapter online
Date: Tue, 04 Nov 2008 16:35:10 +0100	[thread overview]
Message-ID: <20081104153629.586426000@de.ibm.com> (raw)
In-Reply-To: 20081104153504.606043000@de.ibm.com

[-- Attachment #1: scan-wait-online.diff --]
[-- Type: text/plain, Size: 1037 bytes --]

From: Christof Schmitt <christof.schmitt@de.ibm.com>

Attaching a unit immediately after setting the adapter online should
be possible. The problem right now is that the port_scan runs from a
workqueue and has not finished when the set_online call returns and
the sysfs structures for the ports are not available yet. Fix that by
waiting for the port scan to complete.

Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
---
 drivers/s390/scsi/zfcp_ccw.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/s390/scsi/zfcp_ccw.c	2008-11-04 14:44:04.000000000 +0100
+++ b/drivers/s390/scsi/zfcp_ccw.c	2008-11-04 14:44:27.000000000 +0100
@@ -116,7 +116,9 @@ static int zfcp_ccw_set_online(struct cc
 	zfcp_erp_adapter_reopen(adapter, ZFCP_STATUS_COMMON_ERP_FAILED, 85,
 				NULL);
 	zfcp_erp_wait(adapter);
-	goto out;
+	up(&zfcp_data.config_sema);
+	flush_work(&adapter->scan_work);
+	return 0;
 
  out_scsi_register:
 	zfcp_erp_thread_kill(adapter);

-- 

  parent reply	other threads:[~2008-11-04 15:36 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-04 15:35 [patch 0/8] zfcp fixes for 2.6.28 Christof Schmitt
2008-11-04 15:35 ` [patch 1/8] zfcp: Dont clear reference from SCSI device to unit Christof Schmitt
2008-11-04 15:35 ` [patch 2/8] zfcp: fix req_list_locking Christof Schmitt
2008-11-04 15:35 ` [patch 3/8] zfcp: fix mempool usage for status_read requests Christof Schmitt
2008-11-05 17:46   ` James Bottomley
2008-11-06 15:16     ` Christof Schmitt
2008-11-04 15:35 ` [patch 4/8] zfcp: Fix request list handling in error path Christof Schmitt
2008-11-04 15:35 ` [patch 5/8] zfcp: Fix cast warning Christof Schmitt
2008-11-04 15:35 ` Christof Schmitt [this message]
2008-11-04 15:35 ` [patch 7/8] zfcp: fix erp timeout cleanup for port open requests Christof Schmitt
2008-11-04 15:35 ` [patch 8/8] zfcp: Fix hexdump data in s390dbf traces Christof Schmitt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081104153629.586426000@de.ibm.com \
    --to=christof.schmitt@de.ibm.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=linux-s390@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=schwidefsky@de.ibm.com \
    --cc=swen@vnet.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox