Skip to content

Commit 957aa59

Browse files
abattersbymartinkpetersen
authored andcommitted
scsi: qla2xxx: Use reinit_completion on mbx_intr_comp
If a mailbox command completes immediately after wait_for_completion_timeout() times out, ha->mbx_intr_comp could be left in an inconsistent state, causing the next mailbox command not to wait for the hardware. Fix by reinitializing the completion before use. Signed-off-by: Tony Battersby <tonyb@cybernetics.com> Link: https://patch.msgid.link/11b6485e-0bfd-4784-8f99-c06a196dad94@cybernetics.com Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
1 parent 4f6aaad commit 957aa59

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/scsi/qla2xxx/qla_mbx.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
253253
/* Issue set host interrupt command to send cmd out. */
254254
ha->flags.mbox_int = 0;
255255
clear_bit(MBX_INTERRUPT, &ha->mbx_cmd_flags);
256+
reinit_completion(&ha->mbx_intr_comp);
256257

257258
/* Unlock mbx registers and wait for interrupt */
258259
ql_dbg(ql_dbg_mbx, vha, 0x100f,
@@ -279,6 +280,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
279280
"cmd=%x Timeout.\n", command);
280281
spin_lock_irqsave(&ha->hardware_lock, flags);
281282
clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags);
283+
reinit_completion(&ha->mbx_intr_comp);
282284
spin_unlock_irqrestore(&ha->hardware_lock, flags);
283285

284286
if (chip_reset != ha->chip_reset) {

0 commit comments

Comments
 (0)