Skip to content

Commit

Permalink
wl12xx: Power off after flushing work
Browse files Browse the repository at this point in the history
When stopping plt, the chip is powered off before all current work items
are flushed and interrupts are disabled. This might introduce a race in
which the driver tries to communicate with a powered off chip.

Fix this by powering off the device only after interrupts are disabled
and all work items are flushed.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Luciano Coelho <coelho@ti.com>
  • Loading branch information
Ido Yariv authored and Luciano Coelho committed Feb 15, 2012
1 parent f3df133 commit a454969
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions drivers/net/wireless/wl12xx/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1406,8 +1406,6 @@ int wl1271_plt_stop(struct wl1271 *wl)
goto out;
}

wl1271_power_off(wl);

wl->state = WL1271_STATE_OFF;
wl->rx_counter = 0;

Expand All @@ -1417,6 +1415,11 @@ int wl1271_plt_stop(struct wl1271 *wl)
wl1271_flush_deferred_work(wl);
cancel_work_sync(&wl->netstack_work);
cancel_work_sync(&wl->recovery_work);

mutex_lock(&wl->mutex);
wl1271_power_off(wl);
mutex_unlock(&wl->mutex);

out:
return ret;
}
Expand Down

0 comments on commit a454969

Please sign in to comment.