diff options
author | Giridhar Malavali <giridhar.malavali@qlogic.com> | 2011-03-30 14:46:30 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-05-01 11:13:55 -0400 |
commit | 92dbf273921eb53a9d5b760a8f3b32eefd776b1b (patch) | |
tree | ae495d89dfbd5bedcdc0b343223f04c29cdfda32 /drivers/scsi/qla2xxx | |
parent | ed0de87ce6be92bd84858ad496ffaf60344495a3 (diff) |
[SCSI] qla2xxx: Limit the logs in case device state does not change for ISP82xx.
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>
Diffstat (limited to 'drivers/scsi/qla2xxx')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_nx.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index a62856ef5448..acd1ad3f9574 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c | |||
@@ -3543,15 +3543,18 @@ int | |||
3543 | qla82xx_device_state_handler(scsi_qla_host_t *vha) | 3543 | qla82xx_device_state_handler(scsi_qla_host_t *vha) |
3544 | { | 3544 | { |
3545 | uint32_t dev_state; | 3545 | uint32_t dev_state; |
3546 | uint32_t old_dev_state; | ||
3546 | int rval = QLA_SUCCESS; | 3547 | int rval = QLA_SUCCESS; |
3547 | unsigned long dev_init_timeout; | 3548 | unsigned long dev_init_timeout; |
3548 | struct qla_hw_data *ha = vha->hw; | 3549 | struct qla_hw_data *ha = vha->hw; |
3550 | int loopcount = 0; | ||
3549 | 3551 | ||
3550 | qla82xx_idc_lock(ha); | 3552 | qla82xx_idc_lock(ha); |
3551 | if (!vha->flags.init_done) | 3553 | if (!vha->flags.init_done) |
3552 | qla82xx_set_drv_active(vha); | 3554 | qla82xx_set_drv_active(vha); |
3553 | 3555 | ||
3554 | dev_state = qla82xx_rd_32(ha, QLA82XX_CRB_DEV_STATE); | 3556 | dev_state = qla82xx_rd_32(ha, QLA82XX_CRB_DEV_STATE); |
3557 | old_dev_state = dev_state; | ||
3555 | qla_printk(KERN_INFO, ha, "1:Device state is 0x%x = %s\n", dev_state, | 3558 | qla_printk(KERN_INFO, ha, "1:Device state is 0x%x = %s\n", dev_state, |
3556 | dev_state < MAX_STATES ? qdev_state[dev_state] : "Unknown"); | 3559 | dev_state < MAX_STATES ? qdev_state[dev_state] : "Unknown"); |
3557 | 3560 | ||
@@ -3568,10 +3571,16 @@ qla82xx_device_state_handler(scsi_qla_host_t *vha) | |||
3568 | break; | 3571 | break; |
3569 | } | 3572 | } |
3570 | dev_state = qla82xx_rd_32(ha, QLA82XX_CRB_DEV_STATE); | 3573 | dev_state = qla82xx_rd_32(ha, QLA82XX_CRB_DEV_STATE); |
3571 | qla_printk(KERN_INFO, ha, | 3574 | if (old_dev_state != dev_state) { |
3572 | "2:Device state is 0x%x = %s\n", dev_state, | 3575 | loopcount = 0; |
3573 | dev_state < MAX_STATES ? | 3576 | old_dev_state = dev_state; |
3574 | qdev_state[dev_state] : "Unknown"); | 3577 | } |
3578 | if (loopcount < 5) { | ||
3579 | qla_printk(KERN_INFO, ha, | ||
3580 | "2:Device state is 0x%x = %s\n", dev_state, | ||
3581 | dev_state < MAX_STATES ? | ||
3582 | qdev_state[dev_state] : "Unknown"); | ||
3583 | } | ||
3575 | 3584 | ||
3576 | switch (dev_state) { | 3585 | switch (dev_state) { |
3577 | case QLA82XX_DEV_READY: | 3586 | case QLA82XX_DEV_READY: |
@@ -3620,6 +3629,7 @@ qla82xx_device_state_handler(scsi_qla_host_t *vha) | |||
3620 | msleep(1000); | 3629 | msleep(1000); |
3621 | qla82xx_idc_lock(ha); | 3630 | qla82xx_idc_lock(ha); |
3622 | } | 3631 | } |
3632 | loopcount++; | ||
3623 | } | 3633 | } |
3624 | exit: | 3634 | exit: |
3625 | qla82xx_idc_unlock(ha); | 3635 | qla82xx_idc_unlock(ha); |