Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Wayne Boyer and committed by
James Bottomley
110def85 0cb992ed

+43 -6
+41 -6
drivers/scsi/ipr.c
··· 146 146 } 147 147 }, 148 148 { /* CRoC */ 149 - .mailbox = 0x00040, 149 + .mailbox = 0x00044, 150 150 .cache_line_size = 0x20, 151 151 { 152 152 .set_interrupt_mask_reg = 0x00010, ··· 2898 2898 if (ioa_cfg->sdt_state != GET_DUMP) { 2899 2899 spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); 2900 2900 return; 2901 + } 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); 2901 2907 } 2902 2908 2903 2909 start_addr = readl(ioa_cfg->ioa_mailbox); ··· 7478 7472 } 7479 7473 7480 7474 /** 7475 + * ipr_reset_get_unit_check_job - Call to get the unit check buffer. 7476 + * @ipr_cmd: ipr command struct 7477 + * 7478 + * Description: This function will call to get the unit check buffer. 7479 + * 7480 + * Return value: 7481 + * IPR_RC_JOB_RETURN 7482 + **/ 7483 + static int ipr_reset_get_unit_check_job(struct ipr_cmnd *ipr_cmd) 7484 + { 7485 + struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg; 7486 + 7487 + ENTER; 7488 + ioa_cfg->ioa_unit_checked = 0; 7489 + ipr_get_unit_check_buffer(ioa_cfg); 7490 + ipr_cmd->job_step = ipr_reset_alert; 7491 + ipr_reset_start_timer(ipr_cmd, 0); 7492 + 7493 + LEAVE; 7494 + return IPR_RC_JOB_RETURN; 7495 + } 7496 + 7497 + /** 7481 7498 * ipr_reset_restore_cfg_space - Restore PCI config space. 7482 7499 * @ipr_cmd: ipr command struct 7483 7500 * ··· 7540 7511 } 7541 7512 7542 7513 if (ioa_cfg->ioa_unit_checked) { 7543 - ioa_cfg->ioa_unit_checked = 0; 7544 - ipr_get_unit_check_buffer(ioa_cfg); 7545 - ipr_cmd->job_step = ipr_reset_alert; 7546 - ipr_reset_start_timer(ipr_cmd, 0); 7547 - return IPR_RC_JOB_RETURN; 7514 + if (ioa_cfg->sis64) { 7515 + ipr_cmd->job_step = ipr_reset_get_unit_check_job; 7516 + ipr_reset_start_timer(ipr_cmd, IPR_DUMP_DELAY_TIMEOUT); 7517 + return IPR_RC_JOB_RETURN; 7518 + } else { 7519 + ioa_cfg->ioa_unit_checked = 0; 7520 + ipr_get_unit_check_buffer(ioa_cfg); 7521 + ipr_cmd->job_step = ipr_reset_alert; 7522 + ipr_reset_start_timer(ipr_cmd, 0); 7523 + return IPR_RC_JOB_RETURN; 7524 + } 7548 7525 } 7549 7526 7550 7527 if (ioa_cfg->in_ioa_bringdown) {
+2
drivers/scsi/ipr.h
··· 218 218 #define IPR_WAIT_FOR_BIST_TIMEOUT (2 * HZ) 219 219 #define IPR_PCI_RESET_TIMEOUT (HZ / 2) 220 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 225 * SCSI Literals