Skip to content

Commit

Permalink
qlge: Fix firmware event handler loop.
Browse files Browse the repository at this point in the history
Check status on every iteration of event handler loop and exit
if an error occurred.  If an error occurred then recover process
will be queued so this loop should no continue.

Signed-off-by: Ron Mercer <ron.mercer@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Ron Mercer authored and David S. Miller committed Jun 8, 2009
1 parent df911e2 commit d6f58c2
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/net/qlge/qlge_mpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -831,13 +831,19 @@ void ql_mpi_work(struct work_struct *work)
container_of(work, struct ql_adapter, mpi_work.work);
struct mbox_params mbc;
struct mbox_params *mbcp = &mbc;
int err = 0;

mutex_lock(&qdev->mpi_mutex);

while (ql_read32(qdev, STS) & STS_PI) {
memset(mbcp, 0, sizeof(struct mbox_params));
mbcp->out_count = 1;
ql_mpi_handler(qdev, mbcp);
/* Don't continue if an async event
* did not complete properly.
*/
err = ql_mpi_handler(qdev, mbcp);
if (err)
break;
}

mutex_unlock(&qdev->mpi_mutex);
Expand Down

0 comments on commit d6f58c2

Please sign in to comment.