diff options
author | Michael Hernandez <michael.hernandez@qlogic.com> | 2009-12-16 00:29:44 -0500 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2009-12-30 12:09:45 -0500 |
commit | 3064ff39b8121acbd731f64d046218ebf3c2f9c0 (patch) | |
tree | 8858b9af58db67c662ad3db6b6f3a8c0abd1a256 /drivers | |
parent | 44214ab474671e1ab5a860954db413bce52f7e04 (diff) |
[SCSI] qla2xxx: Get the link data rate explicitly during device resync.
When the hba port gets logged out of the fabric, or other
such transitional state when the physical link is still present,
the driver doesn't receive a loop up asyn event (where the link
data rate currently gets set). Hence send a explicit mailbox command
to get the link rate in such conditions.
Signed-off-by: Giridhar Malavali <giridhar.malavali@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_gbl.h | 1 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 2 | ||||
-rw-r--r-- | drivers/scsi/qla2xxx/qla_mbx.c | 33 |
3 files changed, 36 insertions, 0 deletions
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h index 0b6801fc6389..f61fb8d01330 100644 --- a/drivers/scsi/qla2xxx/qla_gbl.h +++ b/drivers/scsi/qla2xxx/qla_gbl.h | |||
@@ -324,6 +324,7 @@ qla2x00_read_ram_word(scsi_qla_host_t *, uint32_t, uint32_t *); | |||
324 | extern int | 324 | extern int |
325 | qla2x00_write_ram_word(scsi_qla_host_t *, uint32_t, uint32_t); | 325 | qla2x00_write_ram_word(scsi_qla_host_t *, uint32_t, uint32_t); |
326 | 326 | ||
327 | extern int qla2x00_get_data_rate(scsi_qla_host_t *); | ||
327 | /* | 328 | /* |
328 | * Global Function Prototypes in qla_isr.c source file. | 329 | * Global Function Prototypes in qla_isr.c source file. |
329 | */ | 330 | */ |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 73a793539d45..0f7ea6cc02f6 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -2266,6 +2266,8 @@ qla2x00_configure_loop(scsi_qla_host_t *vha) | |||
2266 | clear_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); | 2266 | clear_bit(LOCAL_LOOP_UPDATE, &vha->dpc_flags); |
2267 | clear_bit(RSCN_UPDATE, &vha->dpc_flags); | 2267 | clear_bit(RSCN_UPDATE, &vha->dpc_flags); |
2268 | 2268 | ||
2269 | qla2x00_get_data_rate(vha); | ||
2270 | |||
2269 | /* Determine what we need to do */ | 2271 | /* Determine what we need to do */ |
2270 | if (ha->current_topology == ISP_CFG_FL && | 2272 | if (ha->current_topology == ISP_CFG_FL && |
2271 | (test_bit(LOCAL_LOOP_UPDATE, &flags))) { | 2273 | (test_bit(LOCAL_LOOP_UPDATE, &flags))) { |
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c index 05d595d9a7ef..e91f3d82b2fd 100644 --- a/drivers/scsi/qla2xxx/qla_mbx.c +++ b/drivers/scsi/qla2xxx/qla_mbx.c | |||
@@ -3643,3 +3643,36 @@ qla2x00_write_ram_word(scsi_qla_host_t *vha, uint32_t risc_addr, uint32_t data) | |||
3643 | 3643 | ||
3644 | return rval; | 3644 | return rval; |
3645 | } | 3645 | } |
3646 | |||
3647 | int | ||
3648 | qla2x00_get_data_rate(scsi_qla_host_t *vha) | ||
3649 | { | ||
3650 | int rval; | ||
3651 | mbx_cmd_t mc; | ||
3652 | mbx_cmd_t *mcp = &mc; | ||
3653 | struct qla_hw_data *ha = vha->hw; | ||
3654 | |||
3655 | if (!IS_FWI2_CAPABLE(ha)) | ||
3656 | return QLA_FUNCTION_FAILED; | ||
3657 | |||
3658 | DEBUG11(printk(KERN_INFO "%s(%ld): entered.\n", __func__, vha->host_no)); | ||
3659 | |||
3660 | mcp->mb[0] = MBC_DATA_RATE; | ||
3661 | mcp->mb[1] = 0; | ||
3662 | mcp->out_mb = MBX_1|MBX_0; | ||
3663 | mcp->in_mb = MBX_2|MBX_1|MBX_0; | ||
3664 | mcp->tov = MBX_TOV_SECONDS; | ||
3665 | mcp->flags = 0; | ||
3666 | rval = qla2x00_mailbox_command(vha, mcp); | ||
3667 | if (rval != QLA_SUCCESS) { | ||
3668 | DEBUG2_3_11(printk(KERN_INFO "%s(%ld): failed=%x mb[0]=%x.\n", | ||
3669 | __func__, vha->host_no, rval, mcp->mb[0])); | ||
3670 | } else { | ||
3671 | DEBUG11(printk(KERN_INFO | ||
3672 | "%s(%ld): done.\n", __func__, vha->host_no)); | ||
3673 | if (mcp->mb[1] != 0x7) | ||
3674 | ha->link_data_rate = mcp->mb[1]; | ||
3675 | } | ||
3676 | |||
3677 | return rval; | ||
3678 | } | ||