* [PATCH 1/2] ipr: fix lun assignment and comparison
[not found] <20101104162643.264567565@linux.vnet.ibm.com>
@ 2010-11-04 16:35 ` Wayne Boyer
2010-11-04 17:33 ` Brian King
2010-11-04 16:36 ` [PATCH 2/2] ipr: fix mailbox register definition and add a delay before reading Wayne Boyer
1 sibling, 1 reply; 4+ messages in thread
From: Wayne Boyer @ 2010-11-04 16:35 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi, Brian King, Kleber Sacilotto de Souza
The lun value was not getting set up correctly for all devices attached to the
new 64 bit adapters. The fix is to move the logic to earlier in the
ipr_init_res_entry routine such that the value does get set correctly for all
devices.
Then the ipr_is_same_device comparison function was using the wrong lun value
in the logic for the new adapters. Change this to use the correct lun value.
Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
---
drivers/scsi/ipr.c | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
Index: b/drivers/scsi/ipr.c
===================================================================
--- a/drivers/scsi/ipr.c 2010-11-02 21:23:46.000000000 -0700
+++ b/drivers/scsi/ipr.c 2010-11-04 08:54:52.000000000 -0700
@@ -1048,6 +1048,8 @@ static void ipr_init_res_entry(struct ip
sizeof(res->res_path));
res->bus = 0;
+ memcpy(&res->dev_lun.scsi_lun, &cfgtew->u.cfgte64->lun,
+ sizeof(res->dev_lun.scsi_lun));
res->lun = scsilun_to_int(&res->dev_lun);
if (res->type == IPR_RES_TYPE_GENERIC_SCSI) {
@@ -1063,9 +1065,6 @@ static void ipr_init_res_entry(struct ip
ioa_cfg->max_devs_supported);
set_bit(res->target, ioa_cfg->target_ids);
}
-
- memcpy(&res->dev_lun.scsi_lun, &cfgtew->u.cfgte64->lun,
- sizeof(res->dev_lun.scsi_lun));
} else if (res->type == IPR_RES_TYPE_IOAFP) {
res->bus = IPR_IOAFP_VIRTUAL_BUS;
res->target = 0;
@@ -1116,7 +1115,7 @@ static int ipr_is_same_device(struct ipr
if (res->ioa_cfg->sis64) {
if (!memcmp(&res->dev_id, &cfgtew->u.cfgte64->dev_id,
sizeof(cfgtew->u.cfgte64->dev_id)) &&
- !memcmp(&res->lun, &cfgtew->u.cfgte64->lun,
+ !memcmp(&res->dev_lun.scsi_lun, &cfgtew->u.cfgte64->lun,
sizeof(cfgtew->u.cfgte64->lun))) {
return 1;
}
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 2/2] ipr: fix mailbox register definition and add a delay before reading
[not found] <20101104162643.264567565@linux.vnet.ibm.com>
2010-11-04 16:35 ` [PATCH 1/2] ipr: fix lun assignment and comparison Wayne Boyer
@ 2010-11-04 16:36 ` Wayne Boyer
2010-11-04 17:34 ` Brian King
1 sibling, 1 reply; 4+ messages in thread
From: Wayne Boyer @ 2010-11-04 16:36 UTC (permalink / raw)
To: James Bottomley; +Cc: linux-scsi, Brian King, Kleber Sacilotto de Souza
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>
---
drivers/scsi/ipr.c | 47 +++++++++++++++++++++++++++++++++++++++++------
drivers/scsi/ipr.h | 2 ++
2 files changed, 43 insertions(+), 6 deletions(-)
Index: b/drivers/scsi/ipr.c
===================================================================
--- a/drivers/scsi/ipr.c 2010-11-04 09:16:05.000000000 -0700
+++ b/drivers/scsi/ipr.c 2010-11-04 09:16:48.000000000 -0700
@@ -146,7 +146,7 @@ static const struct ipr_chip_cfg_t ipr_c
}
},
{ /* CRoC */
- .mailbox = 0x00040,
+ .mailbox = 0x00044,
.cache_line_size = 0x20,
{
.set_interrupt_mask_reg = 0x00010,
@@ -2900,6 +2900,12 @@ static void ipr_get_ioa_dump(struct ipr_
return;
}
+ if (ioa_cfg->sis64) {
+ spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
+ ssleep(IPR_DUMP_DELAY_SECONDS);
+ spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
+ }
+
start_addr = readl(ioa_cfg->ioa_mailbox);
if (!ioa_cfg->sis64 && !ipr_sdt_is_fmt2(start_addr)) {
@@ -7470,6 +7476,29 @@ static void ipr_get_unit_check_buffer(st
}
/**
+ * ipr_reset_get_unit_check_job - Call to get the unit check buffer.
+ * @ipr_cmd: ipr command struct
+ *
+ * Description: This function will call to get the unit check buffer.
+ *
+ * Return value:
+ * IPR_RC_JOB_RETURN
+ **/
+static int ipr_reset_get_unit_check_job(struct ipr_cmnd *ipr_cmd)
+{
+ struct ipr_ioa_cfg *ioa_cfg = ipr_cmd->ioa_cfg;
+
+ ENTER;
+ ioa_cfg->ioa_unit_checked = 0;
+ ipr_get_unit_check_buffer(ioa_cfg);
+ ipr_cmd->job_step = ipr_reset_alert;
+ ipr_reset_start_timer(ipr_cmd, 0);
+
+ LEAVE;
+ return IPR_RC_JOB_RETURN;
+}
+
+/**
* ipr_reset_restore_cfg_space - Restore PCI config space.
* @ipr_cmd: ipr command struct
*
@@ -7509,11 +7538,17 @@ static int ipr_reset_restore_cfg_space(s
}
if (ioa_cfg->ioa_unit_checked) {
- ioa_cfg->ioa_unit_checked = 0;
- ipr_get_unit_check_buffer(ioa_cfg);
- ipr_cmd->job_step = ipr_reset_alert;
- ipr_reset_start_timer(ipr_cmd, 0);
- return IPR_RC_JOB_RETURN;
+ if (ioa_cfg->sis64) {
+ ipr_cmd->job_step = ipr_reset_get_unit_check_job;
+ ipr_reset_start_timer(ipr_cmd, IPR_DUMP_DELAY_TIMEOUT);
+ return IPR_RC_JOB_RETURN;
+ } else {
+ ioa_cfg->ioa_unit_checked = 0;
+ ipr_get_unit_check_buffer(ioa_cfg);
+ ipr_cmd->job_step = ipr_reset_alert;
+ ipr_reset_start_timer(ipr_cmd, 0);
+ return IPR_RC_JOB_RETURN;
+ }
}
if (ioa_cfg->in_ioa_bringdown) {
Index: b/drivers/scsi/ipr.h
===================================================================
--- a/drivers/scsi/ipr.h 2010-11-04 09:16:05.000000000 -0700
+++ b/drivers/scsi/ipr.h 2010-11-04 09:16:48.000000000 -0700
@@ -218,6 +218,8 @@
#define IPR_WAIT_FOR_BIST_TIMEOUT (2 * HZ)
#define IPR_PCI_RESET_TIMEOUT (HZ / 2)
#define IPR_DUMP_TIMEOUT (15 * HZ)
+#define IPR_DUMP_DELAY_SECONDS 4
+#define IPR_DUMP_DELAY_TIMEOUT (IPR_DUMP_DELAY_SECONDS * HZ)
/*
* SCSI Literals
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] ipr: fix lun assignment and comparison
2010-11-04 16:35 ` [PATCH 1/2] ipr: fix lun assignment and comparison Wayne Boyer
@ 2010-11-04 17:33 ` Brian King
0 siblings, 0 replies; 4+ messages in thread
From: Brian King @ 2010-11-04 17:33 UTC (permalink / raw)
To: Wayne Boyer; +Cc: James Bottomley, linux-scsi, Kleber Sacilotto de Souza
Acked-by: Brian King <brking@linux.vnet.ibm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 2/2] ipr: fix mailbox register definition and add a delay before reading
2010-11-04 16:36 ` [PATCH 2/2] ipr: fix mailbox register definition and add a delay before reading Wayne Boyer
@ 2010-11-04 17:34 ` Brian King
0 siblings, 0 replies; 4+ messages in thread
From: Brian King @ 2010-11-04 17:34 UTC (permalink / raw)
To: Wayne Boyer; +Cc: James Bottomley, linux-scsi, Kleber Sacilotto de Souza
Acked-by: Brian King <brking@linux.vnet.ibm.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-11-04 17:34 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20101104162643.264567565@linux.vnet.ibm.com>
2010-11-04 16:35 ` [PATCH 1/2] ipr: fix lun assignment and comparison Wayne Boyer
2010-11-04 17:33 ` Brian King
2010-11-04 16:36 ` [PATCH 2/2] ipr: fix mailbox register definition and add a delay before reading Wayne Boyer
2010-11-04 17:34 ` Brian King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).