aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Vasquez <andrew.vasquez@qlogic.com>2011-03-30 14:46:31 -0400
committerJames Bottomley <James.Bottomley@suse.de>2011-05-01 11:14:17 -0400
commita4f92a32a0fb827f7bd40c69f021cf57d3dc4249 (patch)
treec6a991598b8dca872fd367026d75f0fd9c55361b
parent92dbf273921eb53a9d5b760a8f3b32eefd776b1b (diff)
[SCSI] qla2xxx: Verify login-state has transitioned to PRLI-completed.
Before driver's own internal state is marked as PLOGI/PRLI complete. This additional check closes a window seen with dual-personality initiator/target devices where a driver's PLOGI/PRLI request occurs within the window after the target's PLOGI request has completed, but prior to the target's PRLI arriving and processed by the firmware. Without this additional check, the firmware will return port-information stating that the port neither supports target nor initiator functions, causing the driver to register the rport prematurely to the FC-transport without the proper 'roles' being set. Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com> Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com> Signed-off-by: Madhuranath Iyengar <Madhu.Iyengar@qlogic.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/qla2xxx/qla_init.c11
-rw-r--r--drivers/scsi/qla2xxx/qla_mbx.c17
2 files changed, 23 insertions, 5 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 234c1c28bf44..d31ac9bd81d9 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -383,6 +383,17 @@ qla2x00_async_login_done(struct scsi_qla_host *vha, fc_port_t *fcport,
383 383
384 switch (data[0]) { 384 switch (data[0]) {
385 case MBS_COMMAND_COMPLETE: 385 case MBS_COMMAND_COMPLETE:
386 /*
387 * Driver must validate login state - If PRLI not complete,
388 * force a relogin attempt via implicit LOGO, PLOGI, and PRLI
389 * requests.
390 */
391 rval = qla2x00_get_port_database(vha, fcport, 0);
392 if (rval != QLA_SUCCESS) {
393 qla2x00_post_async_logout_work(vha, fcport, NULL);
394 qla2x00_post_async_login_work(vha, fcport, NULL);
395 break;
396 }
386 if (fcport->flags & FCF_FCP2_DEVICE) { 397 if (fcport->flags & FCF_FCP2_DEVICE) {
387 qla2x00_post_async_adisc_work(vha, fcport, data); 398 qla2x00_post_async_adisc_work(vha, fcport, data);
388 break; 399 break;
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 32b689061ea7..975aeaae297a 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -1261,11 +1261,12 @@ qla2x00_get_port_database(scsi_qla_host_t *vha, fc_port_t *fcport, uint8_t opt)
1261 /* Check for logged in state. */ 1261 /* Check for logged in state. */
1262 if (pd24->current_login_state != PDS_PRLI_COMPLETE && 1262 if (pd24->current_login_state != PDS_PRLI_COMPLETE &&
1263 pd24->last_login_state != PDS_PRLI_COMPLETE) { 1263 pd24->last_login_state != PDS_PRLI_COMPLETE) {
1264 DEBUG2(printk("%s(%ld): Unable to verify " 1264 DEBUG2(qla_printk(KERN_WARNING, ha,
1265 "login-state (%x/%x) for loop_id %x\n", 1265 "scsi(%ld): Unable to verify login-state (%x/%x) "
1266 __func__, vha->host_no, 1266 " - portid=%02x%02x%02x.\n", vha->host_no,
1267 pd24->current_login_state, 1267 pd24->current_login_state, pd24->last_login_state,
1268 pd24->last_login_state, fcport->loop_id)); 1268 fcport->d_id.b.domain, fcport->d_id.b.area,
1269 fcport->d_id.b.al_pa));
1269 rval = QLA_FUNCTION_FAILED; 1270 rval = QLA_FUNCTION_FAILED;
1270 goto gpd_error_out; 1271 goto gpd_error_out;
1271 } 1272 }
@@ -1289,6 +1290,12 @@ qla2x00_get_port_database(scsi_qla_host_t *vha, fc_port_t *fcport, uint8_t opt)
1289 /* Check for logged in state. */ 1290 /* Check for logged in state. */
1290 if (pd->master_state != PD_STATE_PORT_LOGGED_IN && 1291 if (pd->master_state != PD_STATE_PORT_LOGGED_IN &&
1291 pd->slave_state != PD_STATE_PORT_LOGGED_IN) { 1292 pd->slave_state != PD_STATE_PORT_LOGGED_IN) {
1293 DEBUG2(qla_printk(KERN_WARNING, ha,
1294 "scsi(%ld): Unable to verify login-state (%x/%x) "
1295 " - portid=%02x%02x%02x.\n", vha->host_no,
1296 pd->master_state, pd->slave_state,
1297 fcport->d_id.b.domain, fcport->d_id.b.area,
1298 fcport->d_id.b.al_pa));
1292 rval = QLA_FUNCTION_FAILED; 1299 rval = QLA_FUNCTION_FAILED;
1293 goto gpd_error_out; 1300 goto gpd_error_out;
1294 } 1301 }