* [PATCH 01/18] qla2xxx: Correct locking during NVRAM manipulation.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
@ 2008-07-10 23:55 ` Andrew Vasquez
2008-07-10 23:55 ` [PATCH 02/18] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support Andrew Vasquez
` (16 subsequent siblings)
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:55 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley; +Cc: Andrew Vasquez, Seokmann Ju
Commit 2c96d8d0c17978bbf5eb82314d488f46d4a51280 pushed the
acquisition of hardware_lock to too fine a level, which in turn
will cause problems with cond_resched()s added with
40a2e34a94c336b716f631b2952d233e1ba76e3c.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_sup.c | 3 ---
1 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
index 1728ab3..ebea622 100644
--- a/drivers/scsi/qla2xxx/qla_sup.c
+++ b/drivers/scsi/qla2xxx/qla_sup.c
@@ -869,11 +869,9 @@ qla24xx_write_nvram_data(scsi_qla_host_t *ha, uint8_t *buf, uint32_t naddr,
uint32_t i;
uint32_t *dwptr;
struct device_reg_24xx __iomem *reg = &ha->iobase->isp24;
- unsigned long flags;
ret = QLA_SUCCESS;
- spin_lock_irqsave(&ha->hardware_lock, flags);
/* Enable flash write. */
WRT_REG_DWORD(®->ctrl_status,
RD_REG_DWORD(®->ctrl_status) | CSRX_FLASH_ENABLE);
@@ -907,7 +905,6 @@ qla24xx_write_nvram_data(scsi_qla_host_t *ha, uint8_t *buf, uint32_t naddr,
WRT_REG_DWORD(®->ctrl_status,
RD_REG_DWORD(®->ctrl_status) & ~CSRX_FLASH_ENABLE);
RD_REG_DWORD(®->ctrl_status); /* PCI Posting. */
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
return ret;
}
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 02/18] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
2008-07-10 23:55 ` [PATCH 01/18] qla2xxx: Correct locking during NVRAM manipulation Andrew Vasquez
@ 2008-07-10 23:55 ` Andrew Vasquez
2008-07-11 17:32 ` Mike Christie
2008-07-11 17:37 ` [PATCH 02/18] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support Mike Christie
2008-07-10 23:55 ` [PATCH 03/18] qla2xxx: Set an rport's dev_loss_tmo value in a consistent manner Andrew Vasquez
` (15 subsequent siblings)
17 siblings, 2 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:55 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley; +Cc: Andrew Vasquez, Seokmann Ju
From: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_attr.c | 31 ++++++++++++++++++++++
drivers/scsi/qla2xxx/qla_def.h | 1 -
drivers/scsi/qla2xxx/qla_gbl.h | 2 +
drivers/scsi/qla2xxx/qla_init.c | 16 +++--------
drivers/scsi/qla2xxx/qla_os.c | 53 +++++++++++++++++++++++++++++---------
5 files changed, 78 insertions(+), 25 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 4c74538..f2fa373 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -969,6 +969,33 @@ qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
rport->dev_loss_tmo = ha->port_down_retry_count + 5;
}
+static void
+qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport)
+{
+ struct Scsi_Host *host = rport_to_shost(rport);
+ fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
+
+ qla2x00_abort_fcport_cmds(fcport);
+
+ /*
+ * Transport has effectively 'deleted' the rport, clear
+ * all local references.
+ */
+ spin_lock_irq(host->host_lock);
+ fcport->rport = NULL;
+ *((fc_port_t **)rport->dd_data) = NULL;
+ spin_unlock_irq(host->host_lock);
+}
+
+static void
+qla2x00_terminate_rport_io(struct fc_rport *rport)
+{
+ fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
+
+ qla2x00_abort_fcport_cmds(fcport);
+ scsi_target_unblock(&rport->dev);
+}
+
static int
qla2x00_issue_lip(struct Scsi_Host *shost)
{
@@ -1228,6 +1255,8 @@ struct fc_function_template qla2xxx_transport_functions = {
.show_rport_dev_loss_tmo = 1,
.issue_fc_host_lip = qla2x00_issue_lip,
+ .dev_loss_tmo_callbk = qla2x00_dev_loss_tmo_callbk,
+ .terminate_rport_io = qla2x00_terminate_rport_io,
.get_fc_host_stats = qla2x00_get_fc_host_stats,
.vport_create = qla24xx_vport_create,
@@ -1271,6 +1300,8 @@ struct fc_function_template qla2xxx_transport_vport_functions = {
.show_rport_dev_loss_tmo = 1,
.issue_fc_host_lip = qla2x00_issue_lip,
+ .dev_loss_tmo_callbk = qla2x00_dev_loss_tmo_callbk,
+ .terminate_rport_io = qla2x00_terminate_rport_io,
.get_fc_host_stats = qla2x00_get_fc_host_stats,
};
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 8dd6000..7b0ddc8 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -1544,7 +1544,6 @@ typedef struct fc_port {
int login_retry;
atomic_t port_down_timer;
- spinlock_t rport_lock;
struct fc_rport *rport, *drport;
u32 supported_classes;
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index 9b4bebe..5a50fb7 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -71,6 +71,8 @@ extern int qla2x00_post_aen_work(struct scsi_qla_host *, enum
extern int qla2x00_post_hwe_work(struct scsi_qla_host *, uint16_t , uint16_t,
uint16_t, uint16_t);
+extern void qla2x00_abort_fcport_cmds(fc_port_t *);
+
/*
* Global Functions in qla_mid.c source file.
*/
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index bbbc5a6..c7388fa 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1864,12 +1864,11 @@ qla2x00_rport_del(void *data)
{
fc_port_t *fcport = data;
struct fc_rport *rport;
- unsigned long flags;
- spin_lock_irqsave(&fcport->rport_lock, flags);
+ spin_lock_irq(fcport->ha->host->host_lock);
rport = fcport->drport;
fcport->drport = NULL;
- spin_unlock_irqrestore(&fcport->rport_lock, flags);
+ spin_unlock_irq(fcport->ha->host->host_lock);
if (rport)
fc_remote_port_delete(rport);
}
@@ -1898,7 +1897,6 @@ qla2x00_alloc_fcport(scsi_qla_host_t *ha, gfp_t flags)
atomic_set(&fcport->state, FCS_UNCONFIGURED);
fcport->flags = FCF_RLC_SUPPORT;
fcport->supported_classes = FC_COS_UNSPECIFIED;
- spin_lock_init(&fcport->rport_lock);
return fcport;
}
@@ -2243,28 +2241,24 @@ qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport)
{
struct fc_rport_identifiers rport_ids;
struct fc_rport *rport;
- unsigned long flags;
if (fcport->drport)
qla2x00_rport_del(fcport);
- if (fcport->rport)
- return;
rport_ids.node_name = wwn_to_u64(fcport->node_name);
rport_ids.port_name = wwn_to_u64(fcport->port_name);
rport_ids.port_id = fcport->d_id.b.domain << 16 |
fcport->d_id.b.area << 8 | fcport->d_id.b.al_pa;
rport_ids.roles = FC_RPORT_ROLE_UNKNOWN;
- rport = fc_remote_port_add(ha->host, 0, &rport_ids);
+ fcport->rport = rport = fc_remote_port_add(ha->host, 0, &rport_ids);
if (!rport) {
qla_printk(KERN_WARNING, ha,
"Unable to allocate fc remote port!\n");
return;
}
- spin_lock_irqsave(&fcport->rport_lock, flags);
- fcport->rport = rport;
+ spin_lock_irq(fcport->ha->host->host_lock);
*((fc_port_t **)rport->dd_data) = fcport;
- spin_unlock_irqrestore(&fcport->rport_lock, flags);
+ spin_unlock_irq(fcport->ha->host->host_lock);
rport->supported_classes = fcport->supported_classes;
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 48eaa3b..c5ad858 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -388,7 +388,7 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
}
/* Close window on fcport/rport state-transitioning. */
- if (!*(fc_port_t **)rport->dd_data) {
+ if (fcport->drport) {
cmd->result = DID_IMM_RETRY << 16;
goto qc_fail_command;
}
@@ -455,7 +455,7 @@ qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
}
/* Close window on fcport/rport state-transitioning. */
- if (!*(fc_port_t **)rport->dd_data) {
+ if (fcport->drport) {
cmd->result = DID_IMM_RETRY << 16;
goto qc24_fail_command;
}
@@ -617,6 +617,40 @@ qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
return (return_status);
}
+void
+qla2x00_abort_fcport_cmds(fc_port_t *fcport)
+{
+ int cnt;
+ unsigned long flags;
+ srb_t *sp;
+ scsi_qla_host_t *ha = fcport->ha;
+ scsi_qla_host_t *pha = to_qla_parent(ha);
+
+ spin_lock_irqsave(&pha->hardware_lock, flags);
+ for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
+ sp = pha->outstanding_cmds[cnt];
+ if (!sp)
+ continue;
+ if (sp->fcport != fcport)
+ continue;
+
+ spin_unlock_irqrestore(&pha->hardware_lock, flags);
+ if (ha->isp_ops->abort_command(ha, sp)) {
+ DEBUG2(qla_printk(KERN_WARNING, ha,
+ "Abort failed -- %lx\n", sp->cmd->serial_number));
+ } else {
+ if (qla2x00_eh_wait_on_command(ha, sp->cmd) !=
+ QLA_SUCCESS)
+ DEBUG2(qla_printk(KERN_WARNING, ha,
+ "Abort failed while waiting -- %lx\n",
+ sp->cmd->serial_number));
+
+ }
+ spin_lock_irqsave(&pha->hardware_lock, flags);
+ }
+ spin_unlock_irqrestore(&pha->hardware_lock, flags);
+}
+
static void
qla2x00_block_error_handler(struct scsi_cmnd *cmnd)
{
@@ -1813,7 +1847,6 @@ static inline void
qla2x00_schedule_rport_del(struct scsi_qla_host *ha, fc_port_t *fcport,
int defer)
{
- unsigned long flags;
struct fc_rport *rport;
if (!fcport->rport)
@@ -1821,19 +1854,13 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *ha, fc_port_t *fcport,
rport = fcport->rport;
if (defer) {
- spin_lock_irqsave(&fcport->rport_lock, flags);
+ spin_lock_irq(ha->host->host_lock);
fcport->drport = rport;
- fcport->rport = NULL;
- *(fc_port_t **)rport->dd_data = NULL;
- spin_unlock_irqrestore(&fcport->rport_lock, flags);
+ spin_unlock_irq(ha->host->host_lock);
set_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags);
- } else {
- spin_lock_irqsave(&fcport->rport_lock, flags);
- fcport->rport = NULL;
- *(fc_port_t **)rport->dd_data = NULL;
- spin_unlock_irqrestore(&fcport->rport_lock, flags);
+ qla2xxx_wake_dpc(ha);
+ } else
fc_remote_port_delete(rport);
- }
}
/*
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* Re: [PATCH 02/18] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support.
2008-07-10 23:55 ` [PATCH 02/18] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support Andrew Vasquez
@ 2008-07-11 17:32 ` Mike Christie
2008-07-11 18:04 ` [RESEND PATCH " Andrew Vasquez
2008-07-11 18:17 ` [PATCH] fc_transport: remove explicit calls to scsi_target_unblock() from terminate_rport_io() callbacks Andrew Vasquez
2008-07-11 17:37 ` [PATCH 02/18] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support Mike Christie
1 sibling, 2 replies; 26+ messages in thread
From: Mike Christie @ 2008-07-11 17:32 UTC (permalink / raw)
To: Andrew Vasquez; +Cc: Linux SCSI Mailing List, James Bottomley, Seokmann Ju
Andrew Vasquez wrote:
> +
> +static void
> +qla2x00_terminate_rport_io(struct fc_rport *rport)
> +{
> + fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
> +
> + qla2x00_abort_fcport_cmds(fcport);
> + scsi_target_unblock(&rport->dev);
I sent a patch so the unblock is always done by the fc class.
http://marc.info/?l=linux-scsi&m=121263015008613&w=2
Could we do that instead so qlogic and emulex and all other drivers
behave the same?
Here are the other patches in that patchset:
http://marc.info/?l=linux-scsi&m=121263014908607&w=2
http://marc.info/?l=linux-scsi&m=121263014908610&w=2
http://marc.info/?l=linux-scsi&m=121263015008613&w=2
http://marc.info/?l=linux-scsi&m=121263015008616&w=2
http://marc.info/?l=linux-scsi&m=121263015108620&w=2
http://marc.info/?l=linux-scsi&m=121263015108623&w=2
http://marc.info/?l=linux-scsi&m=121263015208626&w=2
^ permalink raw reply [flat|nested] 26+ messages in thread* [RESEND PATCH 02/18] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support.
2008-07-11 17:32 ` Mike Christie
@ 2008-07-11 18:04 ` Andrew Vasquez
2008-07-11 18:21 ` Mike Christie
2008-07-11 18:17 ` [PATCH] fc_transport: remove explicit calls to scsi_target_unblock() from terminate_rport_io() callbacks Andrew Vasquez
1 sibling, 1 reply; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-11 18:04 UTC (permalink / raw)
To: Mike Christie; +Cc: Linux SCSI Mailing List, James Bottomley, Seokmann Ju
From: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
On Fri, 11 Jul 2008, Mike Christie wrote:
> Andrew Vasquez wrote:
>> +
>> +static void
>> +qla2x00_terminate_rport_io(struct fc_rport *rport)
>> +{
>> + fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
>> +
>> + qla2x00_abort_fcport_cmds(fcport);
>> + scsi_target_unblock(&rport->dev);
>
> I sent a patch so the unblock is always done by the fc class.
> http://marc.info/?l=linux-scsi&m=121263015008613&w=2
>
> Could we do that instead so qlogic and emulex and all other drivers behave
> the same?
Sure. Here's a recut of the patch without the explicit
scsi_target_unblock().
---
drivers/scsi/qla2xxx/qla_attr.c | 30 ++++++++++++++++++++++
drivers/scsi/qla2xxx/qla_def.h | 1 -
drivers/scsi/qla2xxx/qla_gbl.h | 2 +
drivers/scsi/qla2xxx/qla_init.c | 16 +++--------
drivers/scsi/qla2xxx/qla_os.c | 53 +++++++++++++++++++++++++++++---------
5 files changed, 77 insertions(+), 25 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 4c74538..3587059 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -969,6 +969,32 @@ qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
rport->dev_loss_tmo = ha->port_down_retry_count + 5;
}
+static void
+qla2x00_dev_loss_tmo_callbk(struct fc_rport *rport)
+{
+ struct Scsi_Host *host = rport_to_shost(rport);
+ fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
+
+ qla2x00_abort_fcport_cmds(fcport);
+
+ /*
+ * Transport has effectively 'deleted' the rport, clear
+ * all local references.
+ */
+ spin_lock_irq(host->host_lock);
+ fcport->rport = NULL;
+ *((fc_port_t **)rport->dd_data) = NULL;
+ spin_unlock_irq(host->host_lock);
+}
+
+static void
+qla2x00_terminate_rport_io(struct fc_rport *rport)
+{
+ fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
+
+ qla2x00_abort_fcport_cmds(fcport);
+}
+
static int
qla2x00_issue_lip(struct Scsi_Host *shost)
{
@@ -1228,6 +1254,8 @@ struct fc_function_template qla2xxx_transport_functions = {
.show_rport_dev_loss_tmo = 1,
.issue_fc_host_lip = qla2x00_issue_lip,
+ .dev_loss_tmo_callbk = qla2x00_dev_loss_tmo_callbk,
+ .terminate_rport_io = qla2x00_terminate_rport_io,
.get_fc_host_stats = qla2x00_get_fc_host_stats,
.vport_create = qla24xx_vport_create,
@@ -1271,6 +1299,8 @@ struct fc_function_template qla2xxx_transport_vport_functions = {
.show_rport_dev_loss_tmo = 1,
.issue_fc_host_lip = qla2x00_issue_lip,
+ .dev_loss_tmo_callbk = qla2x00_dev_loss_tmo_callbk,
+ .terminate_rport_io = qla2x00_terminate_rport_io,
.get_fc_host_stats = qla2x00_get_fc_host_stats,
};
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 8dd6000..7b0ddc8 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -1544,7 +1544,6 @@ typedef struct fc_port {
int login_retry;
atomic_t port_down_timer;
- spinlock_t rport_lock;
struct fc_rport *rport, *drport;
u32 supported_classes;
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index 9b4bebe..5a50fb7 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -71,6 +71,8 @@ extern int qla2x00_post_aen_work(struct scsi_qla_host *, enum
extern int qla2x00_post_hwe_work(struct scsi_qla_host *, uint16_t , uint16_t,
uint16_t, uint16_t);
+extern void qla2x00_abort_fcport_cmds(fc_port_t *);
+
/*
* Global Functions in qla_mid.c source file.
*/
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index bbbc5a6..c7388fa 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1864,12 +1864,11 @@ qla2x00_rport_del(void *data)
{
fc_port_t *fcport = data;
struct fc_rport *rport;
- unsigned long flags;
- spin_lock_irqsave(&fcport->rport_lock, flags);
+ spin_lock_irq(fcport->ha->host->host_lock);
rport = fcport->drport;
fcport->drport = NULL;
- spin_unlock_irqrestore(&fcport->rport_lock, flags);
+ spin_unlock_irq(fcport->ha->host->host_lock);
if (rport)
fc_remote_port_delete(rport);
}
@@ -1898,7 +1897,6 @@ qla2x00_alloc_fcport(scsi_qla_host_t *ha, gfp_t flags)
atomic_set(&fcport->state, FCS_UNCONFIGURED);
fcport->flags = FCF_RLC_SUPPORT;
fcport->supported_classes = FC_COS_UNSPECIFIED;
- spin_lock_init(&fcport->rport_lock);
return fcport;
}
@@ -2243,28 +2241,24 @@ qla2x00_reg_remote_port(scsi_qla_host_t *ha, fc_port_t *fcport)
{
struct fc_rport_identifiers rport_ids;
struct fc_rport *rport;
- unsigned long flags;
if (fcport->drport)
qla2x00_rport_del(fcport);
- if (fcport->rport)
- return;
rport_ids.node_name = wwn_to_u64(fcport->node_name);
rport_ids.port_name = wwn_to_u64(fcport->port_name);
rport_ids.port_id = fcport->d_id.b.domain << 16 |
fcport->d_id.b.area << 8 | fcport->d_id.b.al_pa;
rport_ids.roles = FC_RPORT_ROLE_UNKNOWN;
- rport = fc_remote_port_add(ha->host, 0, &rport_ids);
+ fcport->rport = rport = fc_remote_port_add(ha->host, 0, &rport_ids);
if (!rport) {
qla_printk(KERN_WARNING, ha,
"Unable to allocate fc remote port!\n");
return;
}
- spin_lock_irqsave(&fcport->rport_lock, flags);
- fcport->rport = rport;
+ spin_lock_irq(fcport->ha->host->host_lock);
*((fc_port_t **)rport->dd_data) = fcport;
- spin_unlock_irqrestore(&fcport->rport_lock, flags);
+ spin_unlock_irq(fcport->ha->host->host_lock);
rport->supported_classes = fcport->supported_classes;
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 48eaa3b..c5ad858 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -388,7 +388,7 @@ qla2x00_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
}
/* Close window on fcport/rport state-transitioning. */
- if (!*(fc_port_t **)rport->dd_data) {
+ if (fcport->drport) {
cmd->result = DID_IMM_RETRY << 16;
goto qc_fail_command;
}
@@ -455,7 +455,7 @@ qla24xx_queuecommand(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
}
/* Close window on fcport/rport state-transitioning. */
- if (!*(fc_port_t **)rport->dd_data) {
+ if (fcport->drport) {
cmd->result = DID_IMM_RETRY << 16;
goto qc24_fail_command;
}
@@ -617,6 +617,40 @@ qla2x00_wait_for_loop_ready(scsi_qla_host_t *ha)
return (return_status);
}
+void
+qla2x00_abort_fcport_cmds(fc_port_t *fcport)
+{
+ int cnt;
+ unsigned long flags;
+ srb_t *sp;
+ scsi_qla_host_t *ha = fcport->ha;
+ scsi_qla_host_t *pha = to_qla_parent(ha);
+
+ spin_lock_irqsave(&pha->hardware_lock, flags);
+ for (cnt = 1; cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
+ sp = pha->outstanding_cmds[cnt];
+ if (!sp)
+ continue;
+ if (sp->fcport != fcport)
+ continue;
+
+ spin_unlock_irqrestore(&pha->hardware_lock, flags);
+ if (ha->isp_ops->abort_command(ha, sp)) {
+ DEBUG2(qla_printk(KERN_WARNING, ha,
+ "Abort failed -- %lx\n", sp->cmd->serial_number));
+ } else {
+ if (qla2x00_eh_wait_on_command(ha, sp->cmd) !=
+ QLA_SUCCESS)
+ DEBUG2(qla_printk(KERN_WARNING, ha,
+ "Abort failed while waiting -- %lx\n",
+ sp->cmd->serial_number));
+
+ }
+ spin_lock_irqsave(&pha->hardware_lock, flags);
+ }
+ spin_unlock_irqrestore(&pha->hardware_lock, flags);
+}
+
static void
qla2x00_block_error_handler(struct scsi_cmnd *cmnd)
{
@@ -1813,7 +1847,6 @@ static inline void
qla2x00_schedule_rport_del(struct scsi_qla_host *ha, fc_port_t *fcport,
int defer)
{
- unsigned long flags;
struct fc_rport *rport;
if (!fcport->rport)
@@ -1821,19 +1854,13 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *ha, fc_port_t *fcport,
rport = fcport->rport;
if (defer) {
- spin_lock_irqsave(&fcport->rport_lock, flags);
+ spin_lock_irq(ha->host->host_lock);
fcport->drport = rport;
- fcport->rport = NULL;
- *(fc_port_t **)rport->dd_data = NULL;
- spin_unlock_irqrestore(&fcport->rport_lock, flags);
+ spin_unlock_irq(ha->host->host_lock);
set_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags);
- } else {
- spin_lock_irqsave(&fcport->rport_lock, flags);
- fcport->rport = NULL;
- *(fc_port_t **)rport->dd_data = NULL;
- spin_unlock_irqrestore(&fcport->rport_lock, flags);
+ qla2xxx_wake_dpc(ha);
+ } else
fc_remote_port_delete(rport);
- }
}
/*
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* Re: [RESEND PATCH 02/18] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support.
2008-07-11 18:04 ` [RESEND PATCH " Andrew Vasquez
@ 2008-07-11 18:21 ` Mike Christie
2008-07-11 19:16 ` Andrew Vasquez
0 siblings, 1 reply; 26+ messages in thread
From: Mike Christie @ 2008-07-11 18:21 UTC (permalink / raw)
To: Andrew Vasquez
Cc: Linux SCSI Mailing List, James Bottomley, Seokmann Ju,
James Smart
Andrew Vasquez wrote:
> From: Seokmann Ju <seokmann.ju@qlogic.com>
>
> Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
> Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
> ---
>
> On Fri, 11 Jul 2008, Mike Christie wrote:
>
> > Andrew Vasquez wrote:
> >> +
> >> +static void
> >> +qla2x00_terminate_rport_io(struct fc_rport *rport)
> >> +{
> >> + fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
> >> +
> >> + qla2x00_abort_fcport_cmds(fcport);
> >> + scsi_target_unblock(&rport->dev);
> >
> > I sent a patch so the unblock is always done by the fc class.
> > http://marc.info/?l=linux-scsi&m=121263015008613&w=2
> >
> > Could we do that instead so qlogic and emulex and all other drivers behave
> > the same?
>
> Sure. Here's a recut of the patch without the explicit
> scsi_target_unblock().
Thanks, I think maybe your first patch should go in with this patchset
now. Later when my patch goes in I will cleanup the unblock for you.
Well, actually I guess it is buggy either way :) I think you guys need
it right now for when the terminate callback is called when we remove
the port. But if the terminate callback is called for just when the fast
io fail tmo fires, we would unblock the queue and then IO in there will
just bounce around because when it hits the queuecommand the rport
chkready function will just queue it back up. My patches allow us to
fail the IO instead of having it bounce around.
JamesB and JamesS, what do you guys think of my patches? I can just do
this one
http://marc.info/?l=linux-scsi&m=121263015008613&w=2
(but not use the DID_TRANSPORT_ values)
so that we do not hit the problem above. I will also add some
scsi_target_unblock calls when the terminate call back is called for
rport removal so the drivers do not have to handle in those cases too.
^ permalink raw reply [flat|nested] 26+ messages in thread* Re: [RESEND PATCH 02/18] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support.
2008-07-11 18:21 ` Mike Christie
@ 2008-07-11 19:16 ` Andrew Vasquez
0 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-11 19:16 UTC (permalink / raw)
To: Mike Christie
Cc: Linux SCSI Mailing List, James Bottomley, Seokmann Ju,
James Smart
On Fri, 11 Jul 2008, Mike Christie wrote:
> Thanks, I think maybe your first patch should go in with this patchset now.
> Later when my patch goes in I will cleanup the unblock for you.
Thats fine with me as well...
Thanks, av
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH] fc_transport: remove explicit calls to scsi_target_unblock() from terminate_rport_io() callbacks.
2008-07-11 17:32 ` Mike Christie
2008-07-11 18:04 ` [RESEND PATCH " Andrew Vasquez
@ 2008-07-11 18:17 ` Andrew Vasquez
1 sibling, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-11 18:17 UTC (permalink / raw)
To: Mike Christie
Cc: Linux SCSI Mailing List, James Bottomley, Seokmann Ju,
James Smart, Brian King
Recent work in the transport
(http://marc.info/?l=linux-scsi&m=121263015008613&w=2) centralizes an
'unblock' operation on an rports scsi-target after the
terminate_rport_io() callback.
Cc: James Smart <james.smart@emulex.com>
Cc: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
On Fri, 11 Jul 2008, Mike Christie wrote:
> Andrew Vasquez wrote:
>> +
>> +static void
>> +qla2x00_terminate_rport_io(struct fc_rport *rport)
>> +{
>> + fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
>> +
>> + qla2x00_abort_fcport_cmds(fcport);
>> + scsi_target_unblock(&rport->dev);
>
> I sent a patch so the unblock is always done by the fc class.
> http://marc.info/?l=linux-scsi&m=121263015008613&w=2
>
> Could we do that instead so qlogic and emulex and all other drivers behave
> the same?
And here's a patch to drop the explicit calls to scsi_target_unblock()
from current fc-tranport consumers with a terminate_rport_io()
callback.
BTW: I don't see the patchset in scsi-misc-2.6.git.
diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
index eb702b9..4c6c6a9 100644
--- a/drivers/scsi/ibmvscsi/ibmvfc.c
+++ b/drivers/scsi/ibmvscsi/ibmvfc.c
@@ -2002,7 +2002,6 @@ static void ibmvfc_terminate_rport_io(struct fc_rport *rport)
} else
ibmvfc_issue_fc_host_lip(shost);
- scsi_target_unblock(&rport->dev);
LEAVE;
}
diff --git a/drivers/scsi/lpfc/lpfc_hbadisc.c b/drivers/scsi/lpfc/lpfc_hbadisc.c
index a98d11b..f6f50a7 100644
--- a/drivers/scsi/lpfc/lpfc_hbadisc.c
+++ b/drivers/scsi/lpfc/lpfc_hbadisc.c
@@ -89,12 +89,6 @@ lpfc_terminate_rport_io(struct fc_rport *rport)
ndlp->nlp_sid, 0, LPFC_CTX_TGT);
}
- /*
- * A device is normally blocked for rediscovery and unblocked when
- * devloss timeout happens. In case a vport is removed or driver
- * unloaded before devloss timeout happens, we need to unblock here.
- */
- scsi_target_unblock(&rport->dev);
return;
}
^ permalink raw reply related [flat|nested] 26+ messages in thread
* Re: [PATCH 02/18] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support.
2008-07-10 23:55 ` [PATCH 02/18] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support Andrew Vasquez
2008-07-11 17:32 ` Mike Christie
@ 2008-07-11 17:37 ` Mike Christie
2008-07-11 17:49 ` Andrew Vasquez
1 sibling, 1 reply; 26+ messages in thread
From: Mike Christie @ 2008-07-11 17:37 UTC (permalink / raw)
To: Andrew Vasquez; +Cc: Linux SCSI Mailing List, James Bottomley, Seokmann Ju
Andrew Vasquez wrote:
> +static void
> +qla2x00_terminate_rport_io(struct fc_rport *rport)
> +{
> + fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
> +
> + qla2x00_abort_fcport_cmds(fcport);
Hey, I was also wondering how we get commands still in the driver at
this point? I was doing some testing on my patches and could not hit it.
Does it only occur with things like tape commands or what type of errors
would block/remove the rport but not end up failing the commands at the
time the error is detected? Like with the CS_TIMEOUT case I hit here
http://marc.info/?l=linux-scsi&m=121263015108620&w=2
the IO is failed right away, so when I got to where the terminate
callback is called there was no IO in the driver.
Thanks.
^ permalink raw reply [flat|nested] 26+ messages in thread* Re: [PATCH 02/18] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support.
2008-07-11 17:37 ` [PATCH 02/18] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support Mike Christie
@ 2008-07-11 17:49 ` Andrew Vasquez
0 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-11 17:49 UTC (permalink / raw)
To: Mike Christie; +Cc: Linux SCSI Mailing List, James Bottomley, Seokmann Ju
On Fri, 11 Jul 2008, Mike Christie wrote:
> Andrew Vasquez wrote:
>> +static void
>> +qla2x00_terminate_rport_io(struct fc_rport *rport)
>> +{
>> + fc_port_t *fcport = *(fc_port_t **)rport->dd_data;
>> +
>> + qla2x00_abort_fcport_cmds(fcport);
>
>
> Hey, I was also wondering how we get commands still in the driver at this
> point? I was doing some testing on my patches and could not hit it. Does it
> only occur with things like tape commands or what type of errors would
> block/remove the rport but not end up failing the commands at the time the
> error is detected? Like with the CS_TIMEOUT case I hit here
> http://marc.info/?l=linux-scsi&m=121263015108620&w=2
> the IO is failed right away, so when I got to where the terminate callback
> is called there was no IO in the driver.
Yes, typically, the firmware will return all I/Os of a given lost
port. The exception is FCP2 commands (FC-tape) where additional
recovery (via REC) can be used to recover from short-term link-loss.
--
av
^ permalink raw reply [flat|nested] 26+ messages in thread
* [PATCH 03/18] qla2xxx: Set an rport's dev_loss_tmo value in a consistent manner.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
2008-07-10 23:55 ` [PATCH 01/18] qla2xxx: Correct locking during NVRAM manipulation Andrew Vasquez
2008-07-10 23:55 ` [PATCH 02/18] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support Andrew Vasquez
@ 2008-07-10 23:55 ` Andrew Vasquez
2008-07-10 23:55 ` [PATCH 04/18] qla2xxx: Track total number of ISP aborts Andrew Vasquez
` (14 subsequent siblings)
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:55 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley; +Cc: Andrew Vasquez, Seokmann Ju
As there's no point in adding a fixed-fudge value (originally 5
seconds), honor the user settings only. We also remove the
driver's dead-callback get_rport_dev_loss_tmo function
(qla2x00_get_rport_loss_tmo()).
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_attr.c | 20 ++------------------
drivers/scsi/qla2xxx/qla_os.c | 2 +-
2 files changed, 3 insertions(+), 19 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index f2fa373..2a3bc35 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -947,26 +947,12 @@ qla2x00_get_starget_port_id(struct scsi_target *starget)
}
static void
-qla2x00_get_rport_loss_tmo(struct fc_rport *rport)
-{
- struct Scsi_Host *host = rport_to_shost(rport);
- scsi_qla_host_t *ha = shost_priv(host);
-
- rport->dev_loss_tmo = ha->port_down_retry_count + 5;
-}
-
-static void
qla2x00_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout)
{
- struct Scsi_Host *host = rport_to_shost(rport);
- scsi_qla_host_t *ha = shost_priv(host);
-
if (timeout)
- ha->port_down_retry_count = timeout;
+ rport->dev_loss_tmo = timeout;
else
- ha->port_down_retry_count = 1;
-
- rport->dev_loss_tmo = ha->port_down_retry_count + 5;
+ rport->dev_loss_tmo = 1;
}
static void
@@ -1250,7 +1236,6 @@ struct fc_function_template qla2xxx_transport_functions = {
.get_starget_port_id = qla2x00_get_starget_port_id,
.show_starget_port_id = 1,
- .get_rport_dev_loss_tmo = qla2x00_get_rport_loss_tmo,
.set_rport_dev_loss_tmo = qla2x00_set_rport_loss_tmo,
.show_rport_dev_loss_tmo = 1,
@@ -1295,7 +1280,6 @@ struct fc_function_template qla2xxx_transport_vport_functions = {
.get_starget_port_id = qla2x00_get_starget_port_id,
.show_starget_port_id = 1,
- .get_rport_dev_loss_tmo = qla2x00_get_rport_loss_tmo,
.set_rport_dev_loss_tmo = qla2x00_set_rport_loss_tmo,
.show_rport_dev_loss_tmo = 1,
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index c5ad858..047ee64 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1107,7 +1107,7 @@ qla2xxx_slave_configure(struct scsi_device *sdev)
else
scsi_deactivate_tcq(sdev, ha->max_q_depth);
- rport->dev_loss_tmo = ha->port_down_retry_count + 5;
+ rport->dev_loss_tmo = ha->port_down_retry_count;
return 0;
}
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 04/18] qla2xxx: Track total number of ISP aborts.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
` (2 preceding siblings ...)
2008-07-10 23:55 ` [PATCH 03/18] qla2xxx: Set an rport's dev_loss_tmo value in a consistent manner Andrew Vasquez
@ 2008-07-10 23:55 ` Andrew Vasquez
2008-07-10 23:55 ` [PATCH 05/18] qla2xxx: Add LIP count to FC-transport statistics Andrew Vasquez
` (13 subsequent siblings)
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:55 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley
Cc: Andrew Vasquez, Seokmann Ju, Harish Zunjarrao
From: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
This parameter counts the total number of ISP aborts during
driver execution. The value is exported through a DEVICE_ATTR()
off the scsi_host.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_attr.c | 13 +++++++++++++
drivers/scsi/qla2xxx/qla_def.h | 5 +++++
drivers/scsi/qla2xxx/qla_init.c | 1 +
3 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 2a3bc35..5538fa9 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -784,6 +784,16 @@ qla2x00_optrom_fw_version_show(struct device *dev,
ha->fw_revision[3]);
}
+static ssize_t
+qla2x00_total_isp_aborts_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
+
+ return snprintf(buf, PAGE_SIZE, "%d\n",
+ ha->qla_stats.total_isp_aborts);
+}
+
static DEVICE_ATTR(driver_version, S_IRUGO, qla2x00_drvr_version_show, NULL);
static DEVICE_ATTR(fw_version, S_IRUGO, qla2x00_fw_version_show, NULL);
static DEVICE_ATTR(serial_num, S_IRUGO, qla2x00_serial_num_show, NULL);
@@ -806,6 +816,8 @@ static DEVICE_ATTR(optrom_fcode_version, S_IRUGO,
qla2x00_optrom_fcode_version_show, NULL);
static DEVICE_ATTR(optrom_fw_version, S_IRUGO, qla2x00_optrom_fw_version_show,
NULL);
+static DEVICE_ATTR(total_isp_aborts, S_IRUGO, qla2x00_total_isp_aborts_show,
+ NULL);
struct device_attribute *qla2x00_host_attrs[] = {
&dev_attr_driver_version,
@@ -824,6 +836,7 @@ struct device_attribute *qla2x00_host_attrs[] = {
&dev_attr_optrom_efi_version,
&dev_attr_optrom_fcode_version,
&dev_attr_optrom_fw_version,
+ &dev_attr_total_isp_aborts,
NULL,
};
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 7b0ddc8..fe1eada 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2154,6 +2154,10 @@ struct qla_chip_state_84xx {
uint32_t gold_fw_version;
};
+struct qla_statistics {
+ uint32_t total_isp_aborts;
+};
+
/*
* Linux Host Adapter structure
*/
@@ -2595,6 +2599,7 @@ typedef struct scsi_qla_host {
int cur_vport_count;
struct qla_chip_state_84xx *cs84xx;
+ struct qla_statistics qla_stats;
} scsi_qla_host_t;
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index c7388fa..833a642 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -3237,6 +3237,7 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
if (ha->flags.online) {
ha->flags.online = 0;
clear_bit(ISP_ABORT_NEEDED, &ha->dpc_flags);
+ ha->qla_stats.total_isp_aborts++;
qla_printk(KERN_INFO, ha,
"Performing ISP error recovery - ha= %p.\n", ha);
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 05/18] qla2xxx: Add LIP count to FC-transport statistics.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
` (3 preceding siblings ...)
2008-07-10 23:55 ` [PATCH 04/18] qla2xxx: Track total number of ISP aborts Andrew Vasquez
@ 2008-07-10 23:55 ` Andrew Vasquez
2008-07-10 23:55 ` [PATCH 06/18] qla2xxx: Cleanup NPIV related functions Andrew Vasquez
` (12 subsequent siblings)
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:55 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley
Cc: Andrew Vasquez, Seokmann Ju, Harish Zunjarrao
From: Harish Zunjarrao <harish.zunjarrao@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_attr.c | 1 +
drivers/scsi/qla2xxx/qla_def.h | 3 ++-
2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 5538fa9..5d6dd95 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -1046,6 +1046,7 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost)
pfc_host_stat->invalid_tx_word_count = stats->inval_xmit_word_cnt;
pfc_host_stat->invalid_crc_count = stats->inval_crc_cnt;
if (IS_FWI2_CAPABLE(ha)) {
+ pfc_host_stat->lip_count = stats->lip_cnt;
pfc_host_stat->tx_frames = stats->tx_frames;
pfc_host_stat->rx_frames = stats->rx_frames;
pfc_host_stat->dumped_frames = stats->dumped_frames;
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index fe1eada..2b1bc57 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -864,7 +864,8 @@ struct link_statistics {
uint32_t prim_seq_err_cnt;
uint32_t inval_xmit_word_cnt;
uint32_t inval_crc_cnt;
- uint32_t unused1[0x1b];
+ uint32_t lip_cnt;
+ uint32_t unused1[0x1a];
uint32_t tx_frames;
uint32_t rx_frames;
uint32_t dumped_frames;
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 06/18] qla2xxx: Cleanup NPIV related functions
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
` (4 preceding siblings ...)
2008-07-10 23:55 ` [PATCH 05/18] qla2xxx: Add LIP count to FC-transport statistics Andrew Vasquez
@ 2008-07-10 23:55 ` Andrew Vasquez
2008-07-10 23:55 ` [PATCH 07/18] qla2xxx: Allow the user the option of disabling iIDMA Andrew Vasquez
` (11 subsequent siblings)
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:55 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley; +Cc: Andrew Vasquez, Seokmann Ju
From: Seokmann Ju <seokmann.ju@qlogic.com>
Removed repeated or unnecessary operations during vport
creation/deletion.
Signed-off-by: Shyam Sundar <shyam.sundar@qlogic.com>
Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Ravi Anand <ravi.anand@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_attr.c | 6 ------
drivers/scsi/qla2xxx/qla_def.h | 1 -
drivers/scsi/qla2xxx/qla_gbl.h | 1 -
drivers/scsi/qla2xxx/qla_mid.c | 11 +++--------
drivers/scsi/qla2xxx/qla_os.c | 8 +-------
5 files changed, 4 insertions(+), 23 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 5d6dd95..2775413 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -1175,17 +1175,11 @@ vport_create_failed_2:
static int
qla24xx_vport_delete(struct fc_vport *fc_vport)
{
- scsi_qla_host_t *ha = shost_priv(fc_vport->shost);
scsi_qla_host_t *vha = fc_vport->dd_data;
qla24xx_disable_vp(vha);
qla24xx_deallocate_vp_id(vha);
- mutex_lock(&ha->vport_lock);
- ha->cur_vport_count--;
- clear_bit(vha->vp_idx, ha->vp_idx_map);
- mutex_unlock(&ha->vport_lock);
-
kfree(vha->node_name);
kfree(vha->port_name);
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 2b1bc57..00c7052 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2170,7 +2170,6 @@ typedef struct scsi_qla_host {
struct pci_dev *pdev;
unsigned long host_no;
- unsigned long instance;
volatile struct {
uint32_t init_done :1;
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index 5a50fb7..1d57ddd 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -62,7 +62,6 @@ extern int ql2xfdmienable;
extern int ql2xallocfwdump;
extern int ql2xextended_error_logging;
extern int ql2xqfullrampup;
-extern int num_hosts;
extern int qla2x00_loop_reset(scsi_qla_host_t *);
extern void qla2x00_abort_all_cmds(scsi_qla_host_t *, int);
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index 62a3ad6..fa35339 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -43,6 +43,7 @@ qla24xx_allocate_vp_id(scsi_qla_host_t *vha)
set_bit(vp_id, ha->vp_idx_map);
ha->num_vhosts++;
+ ha->cur_vport_count++;
vha->vp_idx = vp_id;
list_add_tail(&vha->vp_list, &ha->vp_list);
mutex_unlock(&ha->vport_lock);
@@ -58,6 +59,7 @@ qla24xx_deallocate_vp_id(scsi_qla_host_t *vha)
mutex_lock(&ha->vport_lock);
vp_id = vha->vp_idx;
ha->num_vhosts--;
+ ha->cur_vport_count--;
clear_bit(vp_id, ha->vp_idx_map);
list_del(&vha->vp_list);
mutex_unlock(&ha->vport_lock);
@@ -390,7 +392,6 @@ qla24xx_create_vhost(struct fc_vport *fc_vport)
vha->parent = ha;
vha->fc_vport = fc_vport;
vha->device_flags = 0;
- vha->instance = num_hosts;
vha->vp_idx = qla24xx_allocate_vp_id(vha);
if (vha->vp_idx > ha->max_npiv_vports) {
DEBUG15(printk("scsi(%ld): Couldn't allocate vp_id.\n",
@@ -428,7 +429,7 @@ qla24xx_create_vhost(struct fc_vport *fc_vport)
host->max_cmd_len = MAX_CMDSZ;
host->max_channel = MAX_BUSES - 1;
host->max_lun = MAX_LUNS;
- host->unique_id = vha->instance;
+ host->unique_id = host->host_no;
host->max_id = MAX_TARGETS_2200;
host->transportt = qla2xxx_transport_vport_template;
@@ -436,12 +437,6 @@ qla24xx_create_vhost(struct fc_vport *fc_vport)
vha->host_no, vha));
vha->flags.init_done = 1;
- num_hosts++;
-
- mutex_lock(&ha->vport_lock);
- set_bit(vha->vp_idx, ha->vp_idx_map);
- ha->cur_vport_count++;
- mutex_unlock(&ha->vport_lock);
return vha;
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 047ee64..e98d502 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -27,7 +27,6 @@ char qla2x00_version_str[40];
*/
static struct kmem_cache *srb_cachep;
-int num_hosts;
int ql2xlogintimeout = 20;
module_param(ql2xlogintimeout, int, S_IRUGO|S_IRUSR);
MODULE_PARM_DESC(ql2xlogintimeout,
@@ -1663,9 +1662,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
}
host->can_queue = ha->request_q_length + 128;
- /* load the F/W, read paramaters, and init the H/W */
- ha->instance = num_hosts;
-
mutex_init(&ha->vport_lock);
init_completion(&ha->mbx_cmd_comp);
complete(&ha->mbx_cmd_comp);
@@ -1713,7 +1709,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
host->this_id = 255;
host->cmd_per_lun = 3;
- host->unique_id = ha->instance;
+ host->unique_id = host->host_no;
host->max_cmd_len = MAX_CMDSZ;
host->max_channel = MAX_BUSES - 1;
host->max_lun = MAX_LUNS;
@@ -1734,8 +1730,6 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
ha->flags.init_done = 1;
ha->flags.online = 1;
- num_hosts++;
-
ret = scsi_add_host(host, &pdev->dev);
if (ret)
goto probe_failed;
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 07/18] qla2xxx: Allow the user the option of disabling iIDMA.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
` (5 preceding siblings ...)
2008-07-10 23:55 ` [PATCH 06/18] qla2xxx: Cleanup NPIV related functions Andrew Vasquez
@ 2008-07-10 23:55 ` Andrew Vasquez
2008-07-10 23:55 ` [PATCH 08/18] qla2xxx: Retrieve board serial-number and description from VPD Andrew Vasquez
` (10 subsequent siblings)
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:55 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley; +Cc: Andrew Vasquez, Seokmann Ju
iIDMA support requires the driver issue several additional
fabric-managegment (FM) commands per port discovered during SNS
scanning -- GFPN (Get Fabric Port Name) and GPSC (Get Port Speed
Capabilities). It has been found during testing that some
switches do not respond as *well* as expected to these commands
(silence -- no ACC nor BS_RJT). So, to handle such conditions,
allow the user the ability to indirectly disable the FM commands
by disabling iIDMA with the ql2xiidmaenable module-parameter.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_gbl.h | 1 +
drivers/scsi/qla2xxx/qla_init.c | 3 ++-
drivers/scsi/qla2xxx/qla_os.c | 7 +++++++
3 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index 1d57ddd..f921ccd 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -62,6 +62,7 @@ extern int ql2xfdmienable;
extern int ql2xallocfwdump;
extern int ql2xextended_error_logging;
extern int ql2xqfullrampup;
+extern int ql2xiidmaenable;
extern int qla2x00_loop_reset(scsi_qla_host_t *);
extern void qla2x00_abort_all_cmds(scsi_qla_host_t *, int);
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 833a642..f4cd2cd 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2559,7 +2559,8 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *ha, struct list_head *new_fcports)
} else if (qla2x00_gnn_id(ha, swl) != QLA_SUCCESS) {
kfree(swl);
swl = NULL;
- } else if (qla2x00_gfpn_id(ha, swl) == QLA_SUCCESS) {
+ } else if (ql2xiidmaenable &&
+ qla2x00_gfpn_id(ha, swl) == QLA_SUCCESS) {
qla2x00_gpsc(ha, swl);
}
}
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index e98d502..9c3a57f 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -86,6 +86,13 @@ MODULE_PARM_DESC(ql2xqfullrampup,
"depth for a device after a queue-full condition has been "
"detected. Default is 120 seconds.");
+int ql2xiidmaenable=1;
+module_param(ql2xiidmaenable, int, S_IRUGO|S_IRUSR);
+MODULE_PARM_DESC(ql2xiidmaenable,
+ "Enables iIDMA settings "
+ "Default is 1 - perform iIDMA. 0 - no iIDMA.");
+
+
/*
* SCSI host template entry points
*/
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 08/18] qla2xxx: Retrieve board serial-number and description from VPD.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
` (6 preceding siblings ...)
2008-07-10 23:55 ` [PATCH 07/18] qla2xxx: Allow the user the option of disabling iIDMA Andrew Vasquez
@ 2008-07-10 23:55 ` Andrew Vasquez
2008-07-10 23:55 ` [PATCH 09/18] qla2xxx: Swap enablement order of EFT and FCE Andrew Vasquez
` (9 subsequent siblings)
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:55 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley
Cc: Andrew Vasquez, Seokmann Ju, Joe Carnuccio
From: Joe Carnuccio <joe.carnuccio@qlogic.com>
Recent ISPs have this information written at manufacturing time,
so use the information. This also reduces future churn of the
qla_devtbl.h file contents, as the driver can now depend on the
information to be present in VPD.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_attr.c | 6 +++-
drivers/scsi/qla2xxx/qla_def.h | 2 +-
drivers/scsi/qla2xxx/qla_gbl.h | 1 +
drivers/scsi/qla2xxx/qla_init.c | 11 +++++++-
drivers/scsi/qla2xxx/qla_sup.c | 45 +++++++++++++++++++++++++++++++++++++++
5 files changed, 60 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_attr.c b/drivers/scsi/qla2xxx/qla_attr.c
index 2775413..fbae98c 100644
--- a/drivers/scsi/qla2xxx/qla_attr.c
+++ b/drivers/scsi/qla2xxx/qla_attr.c
@@ -532,8 +532,10 @@ qla2x00_serial_num_show(struct device *dev, struct device_attribute *attr,
scsi_qla_host_t *ha = shost_priv(class_to_shost(dev));
uint32_t sn;
- if (IS_FWI2_CAPABLE(ha))
- return snprintf(buf, PAGE_SIZE, "\n");
+ if (IS_FWI2_CAPABLE(ha)) {
+ qla2xxx_get_vpd_field(ha, "SN", buf, PAGE_SIZE);
+ return snprintf(buf, PAGE_SIZE, "%s\n", buf);
+ }
sn = ((ha->serial0 & 0x1f) << 16) | (ha->serial2 << 8) | ha->serial1;
return snprintf(buf, PAGE_SIZE, "%c%05d\n", 'A' + sn / 100000,
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 00c7052..6da31ba 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2518,7 +2518,7 @@ typedef struct scsi_qla_host {
uint8_t model_number[16+1];
#define BINZERO "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"
- char *model_desc;
+ char model_desc[80];
uint8_t adapter_id[16+1];
uint8_t *node_name;
diff --git a/drivers/scsi/qla2xxx/qla_gbl.h b/drivers/scsi/qla2xxx/qla_gbl.h
index f921ccd..0b15673 100644
--- a/drivers/scsi/qla2xxx/qla_gbl.h
+++ b/drivers/scsi/qla2xxx/qla_gbl.h
@@ -314,6 +314,7 @@ extern int qla2xxx_hw_event_log(scsi_qla_host_t *, uint16_t , uint16_t,
uint16_t, uint16_t);
extern void qla2xxx_get_flash_info(scsi_qla_host_t *);
+extern int qla2xxx_get_vpd_field(scsi_qla_host_t *, char *, char *, size_t);
/*
* Global Function Prototypes in qla_dbg.c source file.
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index f4cd2cd..08bdba5 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -1501,18 +1501,25 @@ qla2x00_set_model_info(scsi_qla_host_t *ha, uint8_t *model, size_t len, char *de
index = (ha->pdev->subsystem_device & 0xff);
if (ha->pdev->subsystem_vendor == PCI_VENDOR_ID_QLOGIC &&
index < QLA_MODEL_NAMES)
- ha->model_desc = qla2x00_model_name[index * 2 + 1];
+ strncpy(ha->model_desc,
+ qla2x00_model_name[index * 2 + 1],
+ sizeof(ha->model_desc) - 1);
} else {
index = (ha->pdev->subsystem_device & 0xff);
if (ha->pdev->subsystem_vendor == PCI_VENDOR_ID_QLOGIC &&
index < QLA_MODEL_NAMES) {
strcpy(ha->model_number,
qla2x00_model_name[index * 2]);
- ha->model_desc = qla2x00_model_name[index * 2 + 1];
+ strncpy(ha->model_desc,
+ qla2x00_model_name[index * 2 + 1],
+ sizeof(ha->model_desc) - 1);
} else {
strcpy(ha->model_number, def);
}
}
+ if (IS_FWI2_CAPABLE(ha))
+ qla2xxx_get_vpd_field(ha, "\x82", ha->model_desc,
+ sizeof(ha->model_desc));
}
/* On sparc systems, obtain port and node WWN from firmware
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c
index ebea622..1bca744 100644
--- a/drivers/scsi/qla2xxx/qla_sup.c
+++ b/drivers/scsi/qla2xxx/qla_sup.c
@@ -2303,6 +2303,51 @@ qla24xx_get_flash_version(scsi_qla_host_t *ha, void *mbuf)
}
static int
+qla2xxx_is_vpd_valid(uint8_t *pos, uint8_t *end)
+{
+ if (pos >= end || *pos != 0x82)
+ return 0;
+
+ pos += 3 + pos[1];
+ if (pos >= end || *pos != 0x90)
+ return 0;
+
+ pos += 3 + pos[1];
+ if (pos >= end || *pos != 0x78)
+ return 0;
+
+ return 1;
+}
+
+int
+qla2xxx_get_vpd_field(scsi_qla_host_t *ha, char *key, char *str, size_t size)
+{
+ uint8_t *pos = ha->vpd;
+ uint8_t *end = pos + ha->vpd_size;
+ int len = 0;
+
+ if (!IS_FWI2_CAPABLE(ha) || !qla2xxx_is_vpd_valid(pos, end))
+ return 0;
+
+ while (pos < end && *pos != 0x78) {
+ len = (*pos == 0x82) ? pos[1] : pos[2];
+
+ if (!strncmp(pos, key, strlen(key)))
+ break;
+
+ if (*pos != 0x90 && *pos != 0x91)
+ pos += len;
+
+ pos += 3;
+ }
+
+ if (pos < end - len && *pos != 0x78)
+ return snprintf(str, size, "%.*s", len, pos + 3);
+
+ return 0;
+}
+
+static int
qla2xxx_hw_event_store(scsi_qla_host_t *ha, uint32_t *fdata)
{
uint32_t d[2], faddr;
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 09/18] qla2xxx: Swap enablement order of EFT and FCE.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
` (7 preceding siblings ...)
2008-07-10 23:55 ` [PATCH 08/18] qla2xxx: Retrieve board serial-number and description from VPD Andrew Vasquez
@ 2008-07-10 23:55 ` Andrew Vasquez
2008-07-10 23:55 ` [PATCH 10/18] qla2xxx: Always aquire the parent's hardware_lock Andrew Vasquez
` (8 subsequent siblings)
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:55 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley; +Cc: Andrew Vasquez, Seokmann Ju
The firmware group has suggested that FCE (Fibre Channel Event)
tracing be enabled prior to EFT (Extended Firmware Tracing) to
maximize the capturing of data on the wire. This change has no
real semantic effect on driver operation, as it's mostly a
shuffling of code.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_init.c | 80 +++++++++++++++++++-------------------
1 files changed, 40 insertions(+), 40 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 08bdba5..80f4f9d 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -768,42 +768,16 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *ha)
mem_size = (ha->fw_memory_size - 0x100000 + 1) *
sizeof(uint32_t);
- /* Allocate memory for Extended Trace Buffer. */
- tc = dma_alloc_coherent(&ha->pdev->dev, EFT_SIZE, &tc_dma,
- GFP_KERNEL);
- if (!tc) {
- qla_printk(KERN_WARNING, ha, "Unable to allocate "
- "(%d KB) for EFT.\n", EFT_SIZE / 1024);
- goto cont_alloc;
- }
-
- memset(tc, 0, EFT_SIZE);
- rval = qla2x00_enable_eft_trace(ha, tc_dma, EFT_NUM_BUFFERS);
- if (rval) {
- qla_printk(KERN_WARNING, ha, "Unable to initialize "
- "EFT (%d).\n", rval);
- dma_free_coherent(&ha->pdev->dev, EFT_SIZE, tc,
- tc_dma);
- goto cont_alloc;
- }
-
- qla_printk(KERN_INFO, ha, "Allocated (%d KB) for EFT...\n",
- EFT_SIZE / 1024);
-
- eft_size = EFT_SIZE;
- ha->eft_dma = tc_dma;
- ha->eft = tc;
-
/* Allocate memory for Fibre Channel Event Buffer. */
if (!IS_QLA25XX(ha))
- goto cont_alloc;
+ goto try_eft;
tc = dma_alloc_coherent(&ha->pdev->dev, FCE_SIZE, &tc_dma,
GFP_KERNEL);
if (!tc) {
qla_printk(KERN_WARNING, ha, "Unable to allocate "
"(%d KB) for FCE.\n", FCE_SIZE / 1024);
- goto cont_alloc;
+ goto try_eft;
}
memset(tc, 0, FCE_SIZE);
@@ -815,7 +789,7 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *ha)
dma_free_coherent(&ha->pdev->dev, FCE_SIZE, tc,
tc_dma);
ha->flags.fce_enabled = 0;
- goto cont_alloc;
+ goto try_eft;
}
qla_printk(KERN_INFO, ha, "Allocated (%d KB) for FCE...\n",
@@ -825,6 +799,32 @@ qla2x00_alloc_fw_dump(scsi_qla_host_t *ha)
ha->flags.fce_enabled = 1;
ha->fce_dma = tc_dma;
ha->fce = tc;
+try_eft:
+ /* Allocate memory for Extended Trace Buffer. */
+ tc = dma_alloc_coherent(&ha->pdev->dev, EFT_SIZE, &tc_dma,
+ GFP_KERNEL);
+ if (!tc) {
+ qla_printk(KERN_WARNING, ha, "Unable to allocate "
+ "(%d KB) for EFT.\n", EFT_SIZE / 1024);
+ goto cont_alloc;
+ }
+
+ memset(tc, 0, EFT_SIZE);
+ rval = qla2x00_enable_eft_trace(ha, tc_dma, EFT_NUM_BUFFERS);
+ if (rval) {
+ qla_printk(KERN_WARNING, ha, "Unable to initialize "
+ "EFT (%d).\n", rval);
+ dma_free_coherent(&ha->pdev->dev, EFT_SIZE, tc,
+ tc_dma);
+ goto cont_alloc;
+ }
+
+ qla_printk(KERN_INFO, ha, "Allocated (%d KB) for EFT...\n",
+ EFT_SIZE / 1024);
+
+ eft_size = EFT_SIZE;
+ ha->eft_dma = tc_dma;
+ ha->eft = tc;
}
cont_alloc:
req_q_size = ha->request_q_length * sizeof(request_t);
@@ -3286,17 +3286,6 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
ha->isp_abort_cnt = 0;
clear_bit(ISP_ABORT_RETRY, &ha->dpc_flags);
- if (ha->eft) {
- memset(ha->eft, 0, EFT_SIZE);
- rval = qla2x00_enable_eft_trace(ha,
- ha->eft_dma, EFT_NUM_BUFFERS);
- if (rval) {
- qla_printk(KERN_WARNING, ha,
- "Unable to reinitialize EFT "
- "(%d).\n", rval);
- }
- }
-
if (ha->fce) {
ha->flags.fce_enabled = 1;
memset(ha->fce, 0,
@@ -3311,6 +3300,17 @@ qla2x00_abort_isp(scsi_qla_host_t *ha)
ha->flags.fce_enabled = 0;
}
}
+
+ if (ha->eft) {
+ memset(ha->eft, 0, EFT_SIZE);
+ rval = qla2x00_enable_eft_trace(ha,
+ ha->eft_dma, EFT_NUM_BUFFERS);
+ if (rval) {
+ qla_printk(KERN_WARNING, ha,
+ "Unable to reinitialize EFT "
+ "(%d).\n", rval);
+ }
+ }
} else { /* failed the ISP abort */
ha->flags.online = 1;
if (test_bit(ISP_ABORT_RETRY, &ha->dpc_flags)) {
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 10/18] qla2xxx: Always aquire the parent's hardware_lock.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
` (8 preceding siblings ...)
2008-07-10 23:55 ` [PATCH 09/18] qla2xxx: Swap enablement order of EFT and FCE Andrew Vasquez
@ 2008-07-10 23:55 ` Andrew Vasquez
2008-07-10 23:55 ` [PATCH 11/18] qla2xxx: Correct fcport state-management during loss Andrew Vasquez
` (7 subsequent siblings)
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:55 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley; +Cc: Andrew Vasquez, Seokmann Ju
From: Seokmann Ju <seokmann.ju@qlogic.com>
While issuing a marker, manipulating the request/response queues
and modifying the outstanding command array.
Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_init.c | 2 +-
drivers/scsi/qla2xxx/qla_iocb.c | 23 +++++++++++++----------
drivers/scsi/qla2xxx/qla_mbx.c | 10 ++++++----
3 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 80f4f9d..4c83ff8 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -4052,7 +4052,7 @@ qla24xx_configure_vhba(scsi_qla_host_t *ha)
rval = qla2x00_fw_ready(ha->parent);
if (rval == QLA_SUCCESS) {
clear_bit(RESET_MARKER_NEEDED, &ha->dpc_flags);
- qla2x00_marker(ha->parent, 0, 0, MK_SYNC_ALL);
+ qla2x00_marker(ha, 0, 0, MK_SYNC_ALL);
}
ha->flags.management_server_logged_in = 0;
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c
index 5489d50..6e14c8e 100644
--- a/drivers/scsi/qla2xxx/qla_iocb.c
+++ b/drivers/scsi/qla2xxx/qla_iocb.c
@@ -269,7 +269,7 @@ qla2x00_start_scsi(srb_t *sp)
{
int ret, nseg;
unsigned long flags;
- scsi_qla_host_t *ha;
+ scsi_qla_host_t *ha, *pha;
struct scsi_cmnd *cmd;
uint32_t *clr_ptr;
uint32_t index;
@@ -283,6 +283,7 @@ qla2x00_start_scsi(srb_t *sp)
/* Setup device pointers. */
ret = 0;
ha = sp->ha;
+ pha = to_qla_parent(ha);
reg = &ha->iobase->isp;
cmd = sp->cmd;
/* So we know we haven't pci_map'ed anything yet */
@@ -297,7 +298,7 @@ qla2x00_start_scsi(srb_t *sp)
}
/* Acquire ring specific lock */
- spin_lock_irqsave(&ha->hardware_lock, flags);
+ spin_lock_irqsave(&pha->hardware_lock, flags);
/* Check for room in outstanding command list. */
handle = ha->current_outstanding_cmd;
@@ -386,14 +387,14 @@ qla2x00_start_scsi(srb_t *sp)
ha->response_ring_ptr->signature != RESPONSE_PROCESSED)
qla2x00_process_response_queue(ha);
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
+ spin_unlock_irqrestore(&pha->hardware_lock, flags);
return (QLA_SUCCESS);
queuing_error:
if (tot_dsds)
scsi_dma_unmap(cmd);
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
+ spin_unlock_irqrestore(&pha->hardware_lock, flags);
return (QLA_FUNCTION_FAILED);
}
@@ -454,10 +455,11 @@ qla2x00_marker(scsi_qla_host_t *ha, uint16_t loop_id, uint16_t lun,
{
int ret;
unsigned long flags = 0;
+ scsi_qla_host_t *pha = to_qla_parent(ha);
- spin_lock_irqsave(&ha->hardware_lock, flags);
+ spin_lock_irqsave(&pha->hardware_lock, flags);
ret = __qla2x00_marker(ha, loop_id, lun, type);
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
+ spin_unlock_irqrestore(&pha->hardware_lock, flags);
return (ret);
}
@@ -672,7 +674,7 @@ qla24xx_start_scsi(srb_t *sp)
{
int ret, nseg;
unsigned long flags;
- scsi_qla_host_t *ha;
+ scsi_qla_host_t *ha, *pha;
struct scsi_cmnd *cmd;
uint32_t *clr_ptr;
uint32_t index;
@@ -686,6 +688,7 @@ qla24xx_start_scsi(srb_t *sp)
/* Setup device pointers. */
ret = 0;
ha = sp->ha;
+ pha = to_qla_parent(ha);
reg = &ha->iobase->isp24;
cmd = sp->cmd;
/* So we know we haven't pci_map'ed anything yet */
@@ -700,7 +703,7 @@ qla24xx_start_scsi(srb_t *sp)
}
/* Acquire ring specific lock */
- spin_lock_irqsave(&ha->hardware_lock, flags);
+ spin_lock_irqsave(&pha->hardware_lock, flags);
/* Check for room in outstanding command list. */
handle = ha->current_outstanding_cmd;
@@ -795,14 +798,14 @@ qla24xx_start_scsi(srb_t *sp)
ha->response_ring_ptr->signature != RESPONSE_PROCESSED)
qla24xx_process_response_queue(ha);
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
+ spin_unlock_irqrestore(&pha->hardware_lock, flags);
return QLA_SUCCESS;
queuing_error:
if (tot_dsds)
scsi_dma_unmap(cmd);
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
+ spin_unlock_irqrestore(&pha->hardware_lock, flags);
return QLA_FUNCTION_FAILED;
}
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index 250d2f6..dc5788b 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -749,17 +749,18 @@ qla2x00_abort_command(scsi_qla_host_t *ha, srb_t *sp)
uint32_t handle;
mbx_cmd_t mc;
mbx_cmd_t *mcp = &mc;
+ scsi_qla_host_t *pha = to_qla_parent(ha);
DEBUG11(printk("qla2x00_abort_command(%ld): entered.\n", ha->host_no));
fcport = sp->fcport;
- spin_lock_irqsave(&ha->hardware_lock, flags);
+ spin_lock_irqsave(&pha->hardware_lock, flags);
for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) {
if (ha->outstanding_cmds[handle] == sp)
break;
}
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
+ spin_unlock_irqrestore(&pha->hardware_lock, flags);
if (handle == MAX_OUTSTANDING_COMMANDS) {
/* command not found */
@@ -2161,17 +2162,18 @@ qla24xx_abort_command(scsi_qla_host_t *ha, srb_t *sp)
struct abort_entry_24xx *abt;
dma_addr_t abt_dma;
uint32_t handle;
+ scsi_qla_host_t *pha = to_qla_parent(ha);
DEBUG11(printk("%s(%ld): entered.\n", __func__, ha->host_no));
fcport = sp->fcport;
- spin_lock_irqsave(&ha->hardware_lock, flags);
+ spin_lock_irqsave(&pha->hardware_lock, flags);
for (handle = 1; handle < MAX_OUTSTANDING_COMMANDS; handle++) {
if (ha->outstanding_cmds[handle] == sp)
break;
}
- spin_unlock_irqrestore(&ha->hardware_lock, flags);
+ spin_unlock_irqrestore(&pha->hardware_lock, flags);
if (handle == MAX_OUTSTANDING_COMMANDS) {
/* Command not found. */
return QLA_FUNCTION_FAILED;
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 11/18] qla2xxx: Correct fcport state-management during loss.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
` (9 preceding siblings ...)
2008-07-10 23:55 ` [PATCH 10/18] qla2xxx: Always aquire the parent's hardware_lock Andrew Vasquez
@ 2008-07-10 23:55 ` Andrew Vasquez
2008-07-10 23:55 ` [PATCH 12/18] qla2xxx: Correct vport management of MBA_PORT_UPDATE Andrew Vasquez
` (6 subsequent siblings)
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:55 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley; +Cc: Andrew Vasquez, Seokmann Ju
From: Seokmann Ju <seokmann.ju@qlogic.com>
All fcport->state management should be done within
qla2x00_mark_device_lost(), the assignment of state within
qla2x00_mark_vp_devices_dead() caused associated rports to not be
removed.
Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_mid.c | 1 -
drivers/scsi/qla2xxx/qla_os.c | 13 +++----------
2 files changed, 3 insertions(+), 11 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index fa35339..e756576 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -105,7 +105,6 @@ qla2x00_mark_vp_devices_dead(scsi_qla_host_t *vha)
"loop_id=0x%04x :%x\n",
vha->host_no, fcport->loop_id, fcport->vp_idx));
- atomic_set(&fcport->state, FCS_DEVICE_DEAD);
qla2x00_mark_device_lost(vha, fcport, 0, 0);
}
}
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 9c3a57f..3f39169 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1931,7 +1931,7 @@ qla2x00_mark_all_devices_lost(scsi_qla_host_t *ha, int defer)
scsi_qla_host_t *pha = to_qla_parent(ha);
list_for_each_entry(fcport, &pha->fcports, list) {
- if (ha->vp_idx != 0 && ha->vp_idx != fcport->vp_idx)
+ if (ha->vp_idx != fcport->vp_idx)
continue;
/*
* No point in marking the device as lost, if the device is
@@ -1939,17 +1939,10 @@ qla2x00_mark_all_devices_lost(scsi_qla_host_t *ha, int defer)
*/
if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD)
continue;
- if (atomic_read(&fcport->state) == FCS_ONLINE) {
- if (defer)
- qla2x00_schedule_rport_del(ha, fcport, defer);
- else if (ha->vp_idx == fcport->vp_idx)
- qla2x00_schedule_rport_del(ha, fcport, defer);
- }
+ if (atomic_read(&fcport->state) == FCS_ONLINE)
+ qla2x00_schedule_rport_del(ha, fcport, defer);
atomic_set(&fcport->state, FCS_DEVICE_LOST);
}
-
- if (defer)
- qla2xxx_wake_dpc(ha);
}
/*
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 12/18] qla2xxx: Correct vport management of MBA_PORT_UPDATE.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
` (10 preceding siblings ...)
2008-07-10 23:55 ` [PATCH 11/18] qla2xxx: Correct fcport state-management during loss Andrew Vasquez
@ 2008-07-10 23:55 ` Andrew Vasquez
2008-07-10 23:55 ` [PATCH 13/18] qla2xxx: Correct rport/fcport visibility-state handling during loop-resync Andrew Vasquez
` (5 subsequent siblings)
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:55 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley; +Cc: Andrew Vasquez, Seokmann Ju
From: Seokmann Ju <seokmann.ju@qlogic.com>
By allowing the qla2x00_alert_all_vps() to manage per-vport
recognition of the MBA.
Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_isr.c | 4 ----
1 files changed, 0 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index ec63b79..874d802 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -542,10 +542,6 @@ qla2x00_async_event(scsi_qla_host_t *ha, uint16_t *mb)
break;
case MBA_PORT_UPDATE: /* Port database update */
- /* Only handle SCNs for our Vport index. */
- if (ha->parent && ha->vp_idx != (mb[3] & 0xff))
- break;
-
/*
* If PORT UPDATE is global (recieved LIP_OCCURED/LIP_RESET
* event etc. earlier indicating loop is down) then process
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 13/18] qla2xxx: Correct rport/fcport visibility-state handling during loop-resync.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
` (11 preceding siblings ...)
2008-07-10 23:55 ` [PATCH 12/18] qla2xxx: Correct vport management of MBA_PORT_UPDATE Andrew Vasquez
@ 2008-07-10 23:55 ` Andrew Vasquez
2008-07-10 23:55 ` [PATCH 14/18] qla2xxx: Skip FDMI registration on ISP21xx/22xx parts Andrew Vasquez
` (4 subsequent siblings)
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:55 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley; +Cc: Andrew Vasquez, Seokmann Ju
From: Seokmann Ju <seokmann.ju@qlogic.com>
There were several issues here, one, during RSCN handling if a
follow-on RSCN occurred (within interrupt context) the DPC thread
could inadvertantly leave the fcport in a stale lost state.
Secondly, scheduled rport removal is handled exclusively by the
'parent' DPC thread, so wake up the proper thread. Finally,
process vport loop-resync's only when the vport has in an
"active" state (ID acquired).
Signed-off-by: Seokmann Ju <seokmann.ju@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_init.c | 4 +++-
drivers/scsi/qla2xxx/qla_mid.c | 3 ++-
drivers/scsi/qla2xxx/qla_os.c | 5 +++--
3 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index 4c83ff8..f8cfeb0 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -2012,8 +2012,10 @@ qla2x00_configure_loop(scsi_qla_host_t *ha)
if (test_bit(LOOP_RESYNC_NEEDED, &ha->dpc_flags)) {
if (test_bit(LOCAL_LOOP_UPDATE, &save_flags))
set_bit(LOCAL_LOOP_UPDATE, &ha->dpc_flags);
- if (test_bit(RSCN_UPDATE, &save_flags))
+ if (test_bit(RSCN_UPDATE, &save_flags)) {
+ ha->flags.rscn_queue_overflow = 1;
set_bit(RSCN_UPDATE, &ha->dpc_flags);
+ }
}
return (rval);
diff --git a/drivers/scsi/qla2xxx/qla_mid.c b/drivers/scsi/qla2xxx/qla_mid.c
index e756576..9a850a2 100644
--- a/drivers/scsi/qla2xxx/qla_mid.c
+++ b/drivers/scsi/qla2xxx/qla_mid.c
@@ -277,7 +277,8 @@ qla2x00_do_dpc_vp(scsi_qla_host_t *vha)
clear_bit(RESET_ACTIVE, &vha->dpc_flags);
}
- if (test_and_clear_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) {
+ if (atomic_read(&vha->vp_state) == VP_ACTIVE &&
+ test_and_clear_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags)) {
if (!(test_and_set_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags))) {
qla2x00_loop_resync(vha);
clear_bit(LOOP_RESYNC_ACTIVE, &vha->dpc_flags);
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c
index 3f39169..0f44914 100644
--- a/drivers/scsi/qla2xxx/qla_os.c
+++ b/drivers/scsi/qla2xxx/qla_os.c
@@ -1849,6 +1849,7 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *ha, fc_port_t *fcport,
int defer)
{
struct fc_rport *rport;
+ scsi_qla_host_t *pha = to_qla_parent(ha);
if (!fcport->rport)
return;
@@ -1858,8 +1859,8 @@ qla2x00_schedule_rport_del(struct scsi_qla_host *ha, fc_port_t *fcport,
spin_lock_irq(ha->host->host_lock);
fcport->drport = rport;
spin_unlock_irq(ha->host->host_lock);
- set_bit(FCPORT_UPDATE_NEEDED, &ha->dpc_flags);
- qla2xxx_wake_dpc(ha);
+ set_bit(FCPORT_UPDATE_NEEDED, &pha->dpc_flags);
+ qla2xxx_wake_dpc(pha);
} else
fc_remote_port_delete(rport);
}
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 14/18] qla2xxx: Skip FDMI registration on ISP21xx/22xx parts.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
` (12 preceding siblings ...)
2008-07-10 23:55 ` [PATCH 13/18] qla2xxx: Correct rport/fcport visibility-state handling during loop-resync Andrew Vasquez
@ 2008-07-10 23:55 ` Andrew Vasquez
2008-07-10 23:56 ` [PATCH 15/18] qla2xxx: Correct overflow during dump-processing on large-memory ISP23xx parts Andrew Vasquez
` (3 subsequent siblings)
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:55 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley; +Cc: Andrew Vasquez, Seokmann Ju
Firmware does not have the facilities to issue management server
IOCBs.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_gs.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index 4cb80b4..c2a4bfb 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -1661,6 +1661,12 @@ qla2x00_fdmi_register(scsi_qla_host_t *ha)
{
int rval;
+ if (IS_QLA2100(ha) || IS_QLA2200(ha)) {
+ DEBUG2(printk("scsi(%ld): FDMI unsupported on "
+ "ISP2100/ISP2200.\n", ha->host_no));
+ return QLA_SUCCESS;
+ }
+
rval = qla2x00_mgmt_svr_login(ha);
if (rval)
return rval;
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 15/18] qla2xxx: Correct overflow during dump-processing on large-memory ISP23xx parts.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
` (13 preceding siblings ...)
2008-07-10 23:55 ` [PATCH 14/18] qla2xxx: Skip FDMI registration on ISP21xx/22xx parts Andrew Vasquez
@ 2008-07-10 23:56 ` Andrew Vasquez
2008-07-10 23:56 ` [PATCH 16/18] qla2xxx: Verify the RISC is not in ROM code if firmware-load is disabled Andrew Vasquez
` (2 subsequent siblings)
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:56 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley; +Cc: Andrew Vasquez, Seokmann Ju
Total ram words can exceed a 16bit value on large-memory boards.
Safely extend to a 32bit width.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_dbg.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c
index cbef785..510ba64 100644
--- a/drivers/scsi/qla2xxx/qla_dbg.c
+++ b/drivers/scsi/qla2xxx/qla_dbg.c
@@ -216,7 +216,7 @@ qla24xx_soft_reset(scsi_qla_host_t *ha)
static int
qla2xxx_dump_ram(scsi_qla_host_t *ha, uint32_t addr, uint16_t *ram,
- uint16_t ram_words, void **nxt)
+ uint32_t ram_words, void **nxt)
{
int rval;
uint32_t cnt, stat, timer, words, idx;
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 16/18] qla2xxx: Verify the RISC is not in ROM code if firmware-load is disabled.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
` (14 preceding siblings ...)
2008-07-10 23:56 ` [PATCH 15/18] qla2xxx: Correct overflow during dump-processing on large-memory ISP23xx parts Andrew Vasquez
@ 2008-07-10 23:56 ` Andrew Vasquez
2008-07-10 23:56 ` [PATCH 17/18] qla2xxx: Don't hardcode fw_transfer_size for ISP2[45]xx parts Andrew Vasquez
2008-07-10 23:56 ` [PATCH 18/18] qla2xxx: Update version number to 8.02.01-k5 Andrew Vasquez
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:56 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley; +Cc: Andrew Vasquez, Seokmann Ju
Add an additional check to verify that the current executing
firmware is in fact non-ROM code. The non-ROM Get-ID mailbox
command is used for verification.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_init.c | 7 +++++++
drivers/scsi/qla2xxx/qla_mbx.c | 2 ++
2 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index f8cfeb0..fd3ff5e 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -334,6 +334,8 @@ static int
qla2x00_isp_firmware(scsi_qla_host_t *ha)
{
int rval;
+ uint16_t loop_id, topo, sw_cap;
+ uint8_t domain, area, al_pa;
/* Assume loading risc code */
rval = QLA_FUNCTION_FAILED;
@@ -345,6 +347,11 @@ qla2x00_isp_firmware(scsi_qla_host_t *ha)
/* Verify checksum of loaded RISC code. */
rval = qla2x00_verify_checksum(ha, ha->fw_srisc_address);
+ if (rval == QLA_SUCCESS) {
+ /* And, verify we are not in ROM code. */
+ rval = qla2x00_get_adapter_id(ha, &loop_id, &al_pa,
+ &area, &domain, &topo, &sw_cap);
+ }
}
if (rval) {
diff --git a/drivers/scsi/qla2xxx/qla_mbx.c b/drivers/scsi/qla2xxx/qla_mbx.c
index dc5788b..7d7de59 100644
--- a/drivers/scsi/qla2xxx/qla_mbx.c
+++ b/drivers/scsi/qla2xxx/qla_mbx.c
@@ -919,6 +919,8 @@ qla2x00_get_adapter_id(scsi_qla_host_t *ha, uint16_t *id, uint8_t *al_pa,
rval = qla2x00_mailbox_command(ha, mcp);
if (mcp->mb[0] == MBS_COMMAND_ERROR)
rval = QLA_COMMAND_ERROR;
+ else if (mcp->mb[0] == MBS_INVALID_COMMAND)
+ rval = QLA_INVALID_COMMAND;
/* Return data. */
*id = mcp->mb[1];
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 17/18] qla2xxx: Don't hardcode fw_transfer_size for ISP2[45]xx parts.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
` (15 preceding siblings ...)
2008-07-10 23:56 ` [PATCH 16/18] qla2xxx: Verify the RISC is not in ROM code if firmware-load is disabled Andrew Vasquez
@ 2008-07-10 23:56 ` Andrew Vasquez
2008-07-10 23:56 ` [PATCH 18/18] qla2xxx: Update version number to 8.02.01-k5 Andrew Vasquez
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:56 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley; +Cc: Andrew Vasquez, Seokmann Ju
Use the full buffer size available, as there's no reason to limit
the firwmare-image load-segment size for these parts.
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_init.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
index fd3ff5e..44c0117 100644
--- a/drivers/scsi/qla2xxx/qla_init.c
+++ b/drivers/scsi/qla2xxx/qla_init.c
@@ -729,7 +729,7 @@ qla24xx_chip_diag(scsi_qla_host_t *ha)
/* Perform RISC reset. */
qla24xx_reset_risc(ha);
- ha->fw_transfer_size = REQUEST_ENTRY_SIZE * 1024;
+ ha->fw_transfer_size = REQUEST_ENTRY_SIZE * ha->request_q_length;
rval = qla2x00_mbx_reg_test(ha);
if (rval) {
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread* [PATCH 18/18] qla2xxx: Update version number to 8.02.01-k5.
2008-07-10 23:54 [PATCH 0/18] qla2xxx: updates for 2.6.27 [8.02.01-k5] Andrew Vasquez
` (16 preceding siblings ...)
2008-07-10 23:56 ` [PATCH 17/18] qla2xxx: Don't hardcode fw_transfer_size for ISP2[45]xx parts Andrew Vasquez
@ 2008-07-10 23:56 ` Andrew Vasquez
17 siblings, 0 replies; 26+ messages in thread
From: Andrew Vasquez @ 2008-07-10 23:56 UTC (permalink / raw)
To: Linux SCSI Mailing List, James Bottomley; +Cc: Andrew Vasquez, Seokmann Ju
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
---
drivers/scsi/qla2xxx/qla_version.h | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h
index d058c88..ae60229 100644
--- a/drivers/scsi/qla2xxx/qla_version.h
+++ b/drivers/scsi/qla2xxx/qla_version.h
@@ -7,7 +7,7 @@
/*
* Driver version
*/
-#define QLA2XXX_VERSION "8.02.01-k4"
+#define QLA2XXX_VERSION "8.02.01-k5"
#define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 2
--
1.5.6.2.292.ga9a3
^ permalink raw reply related [flat|nested] 26+ messages in thread