diff options
author | Andrew Vasquez <andrew.vasquez@qlogic.com> | 2012-02-09 14:15:43 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-19 09:19:18 -0500 |
commit | af11f64dfd634e8116b7c4e2422e0e0c698b91c1 (patch) | |
tree | 9a16df493c3181bc7296f8c3420df73ad54fe586 /drivers | |
parent | 0b91d1169e5382040d80622fe79e40c60ff88555 (diff) |
[SCSI] qla2xxx: Perform implicit logout during rport tear-down.
During rport tear-down, make sure we do an implicit LOGO of the fcport in our
firmware to try to clear any residual commands associated with that fcport.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: Chad Dupuis <chad.dupuis@qlogic.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_attr.c | 12 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_dbg.c | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 1 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gbl.h | 3 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 37 |
5 files changed, 51 insertions, 5 deletions
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c index 5433f95f3edd..e21db2f78224 100644 --- a/drivers/scsi/qla2xxx/qla_attr.c +++ b/drivers/scsi/qla2xxx/qla_attr.c | |||
@@ -1647,10 +1647,14 @@ qla2x00_terminate_rport_io(struct fc_rport *rport) | |||
1647 | * final cleanup of firmware resources (PCBs and XCBs). | 1647 | * final cleanup of firmware resources (PCBs and XCBs). |
1648 | */ | 1648 | */ |
1649 | if (fcport->loop_id != FC_NO_LOOP_ID && | 1649 | if (fcport->loop_id != FC_NO_LOOP_ID && |
1650 | !test_bit(UNLOADING, &fcport->vha->dpc_flags)) | 1650 | !test_bit(UNLOADING, &fcport->vha->dpc_flags)) { |
1651 | fcport->vha->hw->isp_ops->fabric_logout(fcport->vha, | 1651 | if (IS_FWI2_CAPABLE(fcport->vha->hw)) |
1652 | fcport->loop_id, fcport->d_id.b.domain, | 1652 | fcport->vha->hw->isp_ops->fabric_logout(fcport->vha, |
1653 | fcport->d_id.b.area, fcport->d_id.b.al_pa); | 1653 | fcport->loop_id, fcport->d_id.b.domain, |
1654 | fcport->d_id.b.area, fcport->d_id.b.al_pa); | ||
1655 | else | ||
1656 | qla2x00_port_logout(fcport->vha, fcport); | ||
1657 | } | ||
1654 | } | 1658 | } |
1655 | 1659 | ||
1656 | static int | 1660 | static int |
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index b85ba1ea0106..4ba30b25f867 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c | |||
@@ -12,7 +12,8 @@ | |||
12 | * | Level | Last Value Used | Holes | | 12 | * | Level | Last Value Used | Holes | |
13 | * ---------------------------------------------------------------------- | 13 | * ---------------------------------------------------------------------- |
14 | * | Module Init and Probe | 0x0120 | 0x4b,0xba,0xfa | | 14 | * | Module Init and Probe | 0x0120 | 0x4b,0xba,0xfa | |
15 | * | Mailbox commands | 0x1139 | 0x112c-0x112e | | 15 | * | Mailbox commands | 0x113e | 0x112c-0x112e | |
16 | * | | | 0x113a | | ||
16 | * | Device Discovery | 0x2085 | 0x2020-0x2022 | | 17 | * | Device Discovery | 0x2085 | 0x2020-0x2022 | |
17 | * | Queue Command and IO tracing | 0x302f | 0x3006,0x3008 | | 18 | * | Queue Command and IO tracing | 0x302f | 0x3006,0x3008 | |
18 | * | | | 0x302d-0x302e | | 19 | * | | | 0x302d-0x302e | |
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index 7a224b710ad4..1281f5be6760 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -665,6 +665,7 @@ typedef struct { | |||
665 | #define MBC_CONFIGURE_VF 0x4b /* Configure VFs */ | 665 | #define MBC_CONFIGURE_VF 0x4b /* Configure VFs */ |
666 | #define MBC_RESET_LINK_STATUS 0x52 /* Reset Link Error Status */ | 666 | #define MBC_RESET_LINK_STATUS 0x52 /* Reset Link Error Status */ |
667 | #define MBC_IOCB_COMMAND_A64 0x54 /* Execute IOCB command (64) */ | 667 | #define MBC_IOCB_COMMAND_A64 0x54 /* Execute IOCB command (64) */ |
668 | #define MBC_PORT_LOGOUT 0x56 /* Port Logout request */ | ||
668 | #define MBC_SEND_RNID_ELS 0x57 /* Send RNID ELS request */ | 669 | #define MBC_SEND_RNID_ELS 0x57 /* Send RNID ELS request */ |
669 | #define MBC_SET_RNID_PARAMS 0x59 /* Set RNID parameters */ | 670 | #define MBC_SET_RNID_PARAMS 0x59 /* Set RNID parameters */ |
670 | #define MBC_GET_RNID_PARAMS 0x5a /* Data Rate */ | 671 | #define MBC_GET_RNID_PARAMS 0x5a /* Data Rate */ |
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 87fee23fd167..9f065804bd12 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h | |||
@@ -367,6 +367,9 @@ qla81xx_get_port_config(scsi_qla_host_t *, uint16_t *); | |||
367 | extern int | 367 | extern int |
368 | qla81xx_set_port_config(scsi_qla_host_t *, uint16_t *); | 368 | qla81xx_set_port_config(scsi_qla_host_t *, uint16_t *); |
369 | 369 | ||
370 | extern int | ||
371 | qla2x00_port_logout(scsi_qla_host_t *, struct fc_port *); | ||
372 | |||
370 | /* | 373 | /* |
371 | * Global Function Prototypes in qla_isr.c source file. | 374 | * Global Function Prototypes in qla_isr.c source file. |
372 | */ | 375 | */ |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 50ec272b61db..61e2fb75fbf0 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -4502,5 +4502,42 @@ qla83xx_write_remote_reg(scsi_qla_host_t *vha, uint32_t reg, uint32_t data) | |||
4502 | ql_dbg(ql_dbg_mbx, vha, 0x1132, | 4502 | ql_dbg(ql_dbg_mbx, vha, 0x1132, |
4503 | "Done %s.\n", __func__); | 4503 | "Done %s.\n", __func__); |
4504 | } | 4504 | } |
4505 | |||
4505 | return rval; | 4506 | return rval; |
4506 | } | 4507 | } |
4508 | |||
4509 | int | ||
4510 | qla2x00_port_logout(scsi_qla_host_t *vha, struct fc_port *fcport) | ||
4511 | { | ||
4512 | int rval; | ||
4513 | struct qla_hw_data *ha = vha->hw; | ||
4514 | mbx_cmd_t mc; | ||
4515 | mbx_cmd_t *mcp = &mc; | ||
4516 | |||
4517 | if (IS_QLA2100(ha) || IS_QLA2200(ha)) { | ||
4518 | ql_dbg(ql_dbg_mbx, vha, 0x113b, | ||
4519 | "Implicit LOGO Unsupported.\n"); | ||
4520 | return QLA_FUNCTION_FAILED; | ||
4521 | } | ||
4522 | |||
4523 | |||
4524 | ql_dbg(ql_dbg_mbx, vha, 0x113c, "Done %s.\n", __func__); | ||
4525 | |||
4526 | /* Perform Implicit LOGO. */ | ||
4527 | mcp->mb[0] = MBC_PORT_LOGOUT; | ||
4528 | mcp->mb[1] = fcport->loop_id; | ||
4529 | mcp->mb[10] = BIT_15; | ||
4530 | mcp->out_mb = MBX_10|MBX_1|MBX_0; | ||
4531 | mcp->in_mb = MBX_0; | ||
4532 | mcp->tov = MBX_TOV_SECONDS; | ||
4533 | mcp->flags = 0; | ||
4534 | rval = qla2x00_mailbox_command(vha, mcp); | ||
4535 | if (rval != QLA_SUCCESS) | ||
4536 | ql_dbg(ql_dbg_mbx, vha, 0x113d, | ||
4537 | "Failed=%x mb[0]=%x.\n", rval, mcp->mb[0]); | ||
4538 | else | ||
4539 | ql_dbg(ql_dbg_mbx, vha, 0x113e, "Done %s.\n", __func__); | ||
4540 | |||
4541 | return rval; | ||
4542 | } | ||
4543 | |||