aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi
diff options
context:
space:
mode:
authorBrian King <brking@linux.vnet.ibm.com>2009-06-18 10:06:55 -0400
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2009-06-21 12:09:57 -0400
commit017b2ae33c0fc7d70320cc7f1cce0efb6ce8d929 (patch)
tree1f598b0900ab8b3cdf4093c032f6fdf90feeca78 /drivers/scsi
parentf1d7fb7a8ab55357b6c7d44a53f644a043680ed1 (diff)
ibmvfc: Fix endless PRLI loop in discovery
Fixes a problem seen where sending a PRLI to a target resulted in it sending a LOGO. This caused the ibmvfc driver to go back through discovery again, which caused another PRLI attempt, which caused another LOGO. Fix this behavior by ignoring LOGO if we haven't even logged into the target yet. Signed-off-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.c16
-rw-r--r--drivers/scsi/ibmvscsi/ibmvfc.h1
2 files changed, 13 insertions, 4 deletions
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index 497a4cc4d9ef..166d96450a0e 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -2254,10 +2254,13 @@ static void ibmvfc_handle_async(struct ibmvfc_async_crq *crq,
2254 continue; 2254 continue;
2255 if (crq->node_name && tgt->ids.node_name != crq->node_name) 2255 if (crq->node_name && tgt->ids.node_name != crq->node_name)
2256 continue; 2256 continue;
2257 ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT); 2257 if (tgt->need_login && crq->event == IBMVFC_AE_ELS_LOGO)
2258 tgt->logo_rcvd = 1;
2259 if (!tgt->need_login || crq->event == IBMVFC_AE_ELS_PLOGI) {
2260 ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT);
2261 ibmvfc_reinit_host(vhost);
2262 }
2258 } 2263 }
2259
2260 ibmvfc_reinit_host(vhost);
2261 break; 2264 break;
2262 case IBMVFC_AE_LINK_DOWN: 2265 case IBMVFC_AE_LINK_DOWN:
2263 case IBMVFC_AE_ADAPTER_FAILED: 2266 case IBMVFC_AE_ADAPTER_FAILED:
@@ -2927,7 +2930,11 @@ static void ibmvfc_tgt_prli_done(struct ibmvfc_event *evt)
2927 break; 2930 break;
2928 case IBMVFC_MAD_FAILED: 2931 case IBMVFC_MAD_FAILED:
2929 default: 2932 default:
2930 if (ibmvfc_retry_cmd(rsp->status, rsp->error)) 2933 if ((rsp->status & IBMVFC_VIOS_FAILURE) && rsp->error == IBMVFC_PLOGI_REQUIRED)
2934 level += ibmvfc_retry_tgt_init(tgt, ibmvfc_tgt_send_plogi);
2935 else if (tgt->logo_rcvd)
2936 level += ibmvfc_retry_tgt_init(tgt, ibmvfc_tgt_send_plogi);
2937 else if (ibmvfc_retry_cmd(rsp->status, rsp->error))
2931 level += ibmvfc_retry_tgt_init(tgt, ibmvfc_tgt_send_prli); 2938 level += ibmvfc_retry_tgt_init(tgt, ibmvfc_tgt_send_prli);
2932 else 2939 else
2933 ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT); 2940 ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_DEL_RPORT);
@@ -3054,6 +3061,7 @@ static void ibmvfc_tgt_send_plogi(struct ibmvfc_target *tgt)
3054 return; 3061 return;
3055 3062
3056 kref_get(&tgt->kref); 3063 kref_get(&tgt->kref);
3064 tgt->logo_rcvd = 0;
3057 evt = ibmvfc_get_event(vhost); 3065 evt = ibmvfc_get_event(vhost);
3058 vhost->discovery_threads++; 3066 vhost->discovery_threads++;
3059 ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_INIT_WAIT); 3067 ibmvfc_set_tgt_action(tgt, IBMVFC_TGT_ACTION_INIT_WAIT);
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.h b/drivers/scsi/ibmvscsi/ibmvfc.h
index c2668d7d67f5..007fa1c9ef14 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.h
+++ b/drivers/scsi/ibmvscsi/ibmvfc.h
@@ -605,6 +605,7 @@ struct ibmvfc_target {
605 int need_login; 605 int need_login;
606 int add_rport; 606 int add_rport;
607 int init_retries; 607 int init_retries;
608 int logo_rcvd;
608 u32 cancel_key; 609 u32 cancel_key;
609 struct ibmvfc_service_parms service_parms; 610 struct ibmvfc_service_parms service_parms;
610 struct ibmvfc_service_parms service_parms_change; 611 struct ibmvfc_service_parms service_parms_change;