Commit 22753fa5 authored by Andreas Herrmann's avatar Andreas Herrmann Committed by James Bottomley

[SCSI] zfcp: fix: allow more time for adapter initialization

From: Maxim Shchetynin <maxim@de.ibm.com>

Extend the time for adapter initialization: In case of protocol
status HOST_CONNECTION_INITIALIZING for the exchange config data
command do a first retry in 1 second, then double the sleep time for
each following retry until recovery exceeds 2 minutes. The old
behaviour of allowing 6 retries with .5 seconds delay between retries
was insufficient and qdio queues were shut down too erarly.
Signed-off-by: default avatarAndreas Herrmann <aherrman@de.ibm.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 66c8684a
...@@ -149,8 +149,10 @@ typedef u32 scsi_lun_t; ...@@ -149,8 +149,10 @@ typedef u32 scsi_lun_t;
#define FSF_QTCB_UNSOLICITED_STATUS 0x6305 #define FSF_QTCB_UNSOLICITED_STATUS 0x6305
#define ZFCP_STATUS_READ_FAILED_THRESHOLD 3 #define ZFCP_STATUS_READ_FAILED_THRESHOLD 3
#define ZFCP_STATUS_READS_RECOM FSF_STATUS_READS_RECOM #define ZFCP_STATUS_READS_RECOM FSF_STATUS_READS_RECOM
#define ZFCP_EXCHANGE_CONFIG_DATA_RETRIES 6
#define ZFCP_EXCHANGE_CONFIG_DATA_SLEEP 50 /* Do 1st retry in 1 second, then double the timeout for each following retry */
#define ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP 100
#define ZFCP_EXCHANGE_CONFIG_DATA_RETRIES 7
/* timeout value for "default timer" for fsf requests */ /* timeout value for "default timer" for fsf requests */
#define ZFCP_FSF_REQUEST_TIMEOUT (60*HZ); #define ZFCP_FSF_REQUEST_TIMEOUT (60*HZ);
......
...@@ -2286,12 +2286,12 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) ...@@ -2286,12 +2286,12 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
{ {
int retval = ZFCP_ERP_SUCCEEDED; int retval = ZFCP_ERP_SUCCEEDED;
int retries; int retries;
int sleep = ZFCP_EXCHANGE_CONFIG_DATA_FIRST_SLEEP;
struct zfcp_adapter *adapter = erp_action->adapter; struct zfcp_adapter *adapter = erp_action->adapter;
atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, &adapter->status); atomic_clear_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, &adapter->status);
retries = ZFCP_EXCHANGE_CONFIG_DATA_RETRIES;
do { for (retries = ZFCP_EXCHANGE_CONFIG_DATA_RETRIES; retries; retries--) {
atomic_clear_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, atomic_clear_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
&adapter->status); &adapter->status);
ZFCP_LOG_DEBUG("Doing exchange config data\n"); ZFCP_LOG_DEBUG("Doing exchange config data\n");
...@@ -2329,16 +2329,17 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action) ...@@ -2329,16 +2329,17 @@ zfcp_erp_adapter_strategy_open_fsf_xconfig(struct zfcp_erp_action *erp_action)
zfcp_get_busid_by_adapter(adapter)); zfcp_get_busid_by_adapter(adapter));
break; break;
} }
if (atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
&adapter->status)) { if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT,
ZFCP_LOG_DEBUG("host connection still initialising... " &adapter->status))
"waiting and retrying...\n"); break;
/* sleep a little bit before retry */
msleep(jiffies_to_msecs(ZFCP_EXCHANGE_CONFIG_DATA_SLEEP)); ZFCP_LOG_DEBUG("host connection still initialising... "
} "waiting and retrying...\n");
} while ((retries--) && /* sleep a little bit before retry */
atomic_test_mask(ZFCP_STATUS_ADAPTER_HOST_CON_INIT, msleep(jiffies_to_msecs(sleep));
&adapter->status)); sleep *= 2;
}
if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK, if (!atomic_test_mask(ZFCP_STATUS_ADAPTER_XCONFIG_OK,
&adapter->status)) { &adapter->status)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment