aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWayne Boyer <wayneb@linux.vnet.ibm.com>2010-11-04 12:36:16 -0400
committerJames Bottomley <James.Bottomley@suse.de>2010-12-21 13:23:55 -0500
commit110def851fc823bb1a4584cb6308e30e5ffb3e05 (patch)
tree208db8f5e55a06996215cb60ee8b75a257be8426
parent0cb992eda1f7e7672775032378690baa87c0e13d (diff)
[SCSI] ipr: fix mailbox register definition and add a delay before reading
The definition for the mailbox register for new adapters was incorrect. The value has been updated to the correct offset. After an adapter reset, the mailbox register on the new adapters takes a number of seconds to stabilize. A delay has been added before reading the register. Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com> Acked-by: Brian King <brking@linux.vnet.ibm.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
-rw-r--r--drivers/scsi/ipr.c47
-rw-r--r--drivers/scsi/ipr.h2
2 files changed, 43 insertions, 6 deletions
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c
index 04c1cea89dbe..de2e09e49a3e 100644
--- a/drivers/scsi/ipr.c
+++ b/drivers/scsi/ipr.c
@@ -146,7 +146,7 @@ static const struct ipr_chip_cfg_t ipr_chip_cfg[] = {
146 } 146 }
147 }, 147 },
148 { /* CRoC */ 148 { /* CRoC */
149 .mailbox = 0x00040, 149 .mailbox = 0x00044,
150 .cache_line_size = 0x20, 150 .cache_line_size = 0x20,
151 { 151 {
152 .set_interrupt_mask_reg = 0x00010, 152 .set_interrupt_mask_reg = 0x00010,
@@ -2900,6 +2900,12 @@ static void ipr_get_ioa_dump(struct ipr_ioa_cfg *ioa_cfg, struct ipr_dump *dump)
2900 return; 2900 return;
2901 } 2901 }
2902 2902
2903 if (ioa_cfg->sis64) {
2904 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
2905 ssleep(IPR_DUMP_DELAY_SECONDS);
2906 spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
2907 }
2908
2903 start_addr = readl(ioa_cfg->ioa_mailbox); 2909 start_addr = readl(ioa_cfg->ioa_mailbox);
2904 2910
2905 if (!ioa_cfg->sis64 && !ipr_sdt_is_fmt2(start_addr)) { 2911 if (!ioa_cfg->sis64 && !ipr_sdt_is_fmt2(start_addr)) {
@@ -7472,6 +7478,29 @@ static void ipr_get_unit_check_buffer(struct ipr_ioa_cfg *ioa_cfg)
7472} 7478}
7473 7479
7474/** 7480/**
7481 * ipr_reset_get_unit_check_job - Call to get the unit check buffer.
7482 * @ipr_cmd: ipr command struct
7483 *
7484 * Description: This function will call to get the unit check buffer.
7485 *
7486 * Return value:
7487 * IPR_RC_JOB_RETURN
7488 **/
7489static int ipr_reset_get_unit_check_job(struct ipr_cmnd *ipr_cmd)
7490{
7491 struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
7492
7493 ENTER;
7494 ioa_cfg->ioa_unit_checked = 0;
7495 ipr_get_unit_check_buffer(ioa_cfg);
7496 ipr_cmd->job_step = ipr_reset_alert;
7497 ipr_reset_start_timer(ipr_cmd, 0);
7498
7499 LEAVE;
7500 return IPR_RC_JOB_RETURN;
7501}
7502
7503/**
7475 * ipr_reset_restore_cfg_space - Restore PCI config space. 7504 * ipr_reset_restore_cfg_space - Restore PCI config space.
7476 * @ipr_cmd: ipr command struct 7505 * @ipr_cmd: ipr command struct
7477 * 7506 *
@@ -7511,11 +7540,17 @@ static int ipr_reset_restore_cfg_space(struct ipr_cmnd *ipr_cmd)
7511 } 7540 }
7512 7541
7513 if (ioa_cfg->ioa_unit_checked) { 7542 if (ioa_cfg->ioa_unit_checked) {
7514 ioa_cfg->ioa_unit_checked = 0; 7543 if (ioa_cfg->sis64) {
7515 ipr_get_unit_check_buffer(ioa_cfg); 7544 ipr_cmd->job_step = ipr_reset_get_unit_check_job;
7516 ipr_cmd->job_step = ipr_reset_alert; 7545 ipr_reset_start_timer(ipr_cmd, IPR_DUMP_DELAY_TIMEOUT);
7517 ipr_reset_start_timer(ipr_cmd, 0); 7546 return IPR_RC_JOB_RETURN;
7518 return IPR_RC_JOB_RETURN; 7547 } else {
7548 ioa_cfg->ioa_unit_checked = 0;
7549 ipr_get_unit_check_buffer(ioa_cfg);
7550 ipr_cmd->job_step = ipr_reset_alert;
7551 ipr_reset_start_timer(ipr_cmd, 0);
7552 return IPR_RC_JOB_RETURN;
7553 }
7519 } 7554 }
7520 7555
7521 if (ioa_cfg->in_ioa_bringdown) { 7556 if (ioa_cfg->in_ioa_bringdown) {
diff --git a/drivers/scsi/ipr.h b/drivers/scsi/ipr.h
index b28a00f1082c..13f425fb8851 100644
--- a/drivers/scsi/ipr.h
+++ b/drivers/scsi/ipr.h
@@ -218,6 +218,8 @@
218#define IPR_WAIT_FOR_BIST_TIMEOUT (2 * HZ) 218#define IPR_WAIT_FOR_BIST_TIMEOUT (2 * HZ)
219#define IPR_PCI_RESET_TIMEOUT (HZ / 2) 219#define IPR_PCI_RESET_TIMEOUT (HZ / 2)
220#define IPR_DUMP_TIMEOUT (15 * HZ) 220#define IPR_DUMP_TIMEOUT (15 * HZ)
221#define IPR_DUMP_DELAY_SECONDS 4
222#define IPR_DUMP_DELAY_TIMEOUT (IPR_DUMP_DELAY_SECONDS * HZ)
221 223
222/* 224/*
223 * SCSI Literals 225 * SCSI Literals