From 0b7ece33405d99c1f6d8eae7e7c1bb19f40abb8b Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Wed, 3 Nov 2010 13:33:06 +0000 Subject: [PATCH] From 8eca3f39c4b11320787f7b216f63214aee8415a9 Mon Sep 17 00:00:00 2001 From: Andrew Vasquez Date: Thu, 22 Jan 2009 09:45:31 -0800 Subject: [PATCH] [SCSI] qla2xxx: Always serialize mailbox command execution. Original code would incorrectly bypass serialization if the DPC thread were performing a big-hammer operation (ISP abort). This short circuit, though rare, would subsequently stomp on a secondary thread's mailbox command execution. Found during ISP81XX testing. Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@2583 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla_mbx.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/qla2x00t/qla_mbx.c b/qla2x00t/qla_mbx.c index effb0865e..88f53987e 100644 --- a/qla2x00t/qla_mbx.c +++ b/qla2x00t/qla_mbx.c @@ -59,14 +59,11 @@ qla2x00_mailbox_command(scsi_qla_host_t *pvha, mbx_cmd_t *mcp) * seconds. This is to serialize actual issuing of mailbox cmds during * non ISP abort time. */ - if (!abort_active) { - if (!wait_for_completion_timeout(&ha->mbx_cmd_comp, - mcp->tov * HZ)) { - /* Timeout occurred. Return error. */ - DEBUG2_3_11(printk("%s(%ld): cmd access timeout. " - "Exiting.\n", __func__, ha->host_no)); - return QLA_FUNCTION_TIMEOUT; - } + if (!wait_for_completion_timeout(&ha->mbx_cmd_comp, mcp->tov * HZ)) { + /* Timeout occurred. Return error. */ + DEBUG2_3_11(printk("%s(%ld): cmd access timeout. " + "Exiting.\n", __func__, ha->host_no)); + return QLA_FUNCTION_TIMEOUT; } ha->flags.mbox_busy = 1; @@ -264,8 +261,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *pvha, mbx_cmd_t *mcp) } /* Allow next mbx cmd to come in. */ - if (!abort_active) - complete(&ha->mbx_cmd_comp); + complete(&ha->mbx_cmd_comp); if (rval != QLA_SUCCESS) { DEBUG2_3_11(printk("%s(%ld): **** FAILED. mbx0=%x, mbx1=%x, "