diff options
author | Ron Mercer <ron.mercer@qlogic.com> | 2009-06-07 09:58:26 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-08 03:09:45 -0400 |
commit | 709ac4f43d76135daa9c2e33ab90eadd16bfce15 (patch) | |
tree | 0197a8c0f33079462c57ca09888dc729cb8dd49b /drivers/net/qlge/qlge_mpi.c | |
parent | d6f58c2e63b4197cba99edd3a4c5c7f4935708fb (diff) |
qlge: Fix bug in firmware event handler.
Each firmware mailbox command can have a different number of
valid data elements. When waiting for a mailbox command to
complete it the process passes it's element count and
waits for the completion. It is possible that while waiting
an unrelated firmware async event (AE) can arrive. When this
happens, the handler will over write the element count
with the value for the newly arrived AE. This can cause
the mailbox command to not get all of it's data.
This patch restores original mailbox count at the end
of the handler.
Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlge/qlge_mpi.c')
-rw-r--r-- | drivers/net/qlge/qlge_mpi.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/qlge/qlge_mpi.c b/drivers/net/qlge/qlge_mpi.c index 7cb30fdc9bac..ff8424330a9c 100644 --- a/drivers/net/qlge/qlge_mpi.c +++ b/drivers/net/qlge/qlge_mpi.c | |||
@@ -453,6 +453,13 @@ static int ql_mpi_handler(struct ql_adapter *qdev, struct mbox_params *mbcp) | |||
453 | } | 453 | } |
454 | end: | 454 | end: |
455 | ql_write32(qdev, CSR, CSR_CMD_CLR_R2PCI_INT); | 455 | ql_write32(qdev, CSR, CSR_CMD_CLR_R2PCI_INT); |
456 | /* Restore the original mailbox count to | ||
457 | * what the caller asked for. This can get | ||
458 | * changed when a mailbox command is waiting | ||
459 | * for a response and an AEN arrives and | ||
460 | * is handled. | ||
461 | * */ | ||
462 | mbcp->out_count = orig_count; | ||
456 | return status; | 463 | return status; |
457 | } | 464 | } |
458 | 465 | ||