* [PATCH] ath5k: fix locking in tx_complete_poll_work
@ 2011-01-18 13:06 Bob Copeland
2011-01-19 0:58 ` Bruno Randolf
0 siblings, 1 reply; 2+ messages in thread
From: Bob Copeland @ 2011-01-18 13:06 UTC (permalink / raw)
To: linville, jirislaby, mickflemm, lrodriguez, br1
Cc: linux-wireless, ath5k-devel, Bob Copeland
ath5k_reset must be called with sc->lock. Since the tx queue
watchdog runs in a workqueue and accesses sc, it's appropriate
to just take the lock over the whole function.
Signed-off-by: Bob Copeland <me@bobcopeland.com>
---
drivers/net/wireless/ath/ath5k/base.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/net/wireless/ath/ath5k/base.c b/drivers/net/wireless/ath/ath5k/base.c
index 019a74d..09ae4ef 100644
--- a/drivers/net/wireless/ath/ath5k/base.c
+++ b/drivers/net/wireless/ath/ath5k/base.c
@@ -2294,6 +2294,8 @@ ath5k_tx_complete_poll_work(struct work_struct *work)
int i;
bool needreset = false;
+ mutex_lock(&sc->lock);
+
for (i = 0; i < ARRAY_SIZE(sc->txqs); i++) {
if (sc->txqs[i].setup) {
txq = &sc->txqs[i];
@@ -2321,6 +2323,8 @@ ath5k_tx_complete_poll_work(struct work_struct *work)
ath5k_reset(sc, NULL, true);
}
+ mutex_unlock(&sc->lock);
+
ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work,
msecs_to_jiffies(ATH5K_TX_COMPLETE_POLL_INT));
}
--
1.7.1.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] ath5k: fix locking in tx_complete_poll_work
2011-01-18 13:06 [PATCH] ath5k: fix locking in tx_complete_poll_work Bob Copeland
@ 2011-01-19 0:58 ` Bruno Randolf
0 siblings, 0 replies; 2+ messages in thread
From: Bruno Randolf @ 2011-01-19 0:58 UTC (permalink / raw)
To: Bob Copeland
Cc: linville, jirislaby, mickflemm, lrodriguez, linux-wireless,
ath5k-devel
On Tue January 18 2011 22:06:43 Bob Copeland wrote:
> ath5k_reset must be called with sc->lock. Since the tx queue
> watchdog runs in a workqueue and accesses sc, it's appropriate
> to just take the lock over the whole function.
>
> Signed-off-by: Bob Copeland <me@bobcopeland.com>
> ---
> drivers/net/wireless/ath/ath5k/base.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath5k/base.c
> b/drivers/net/wireless/ath/ath5k/base.c index 019a74d..09ae4ef 100644
> --- a/drivers/net/wireless/ath/ath5k/base.c
> +++ b/drivers/net/wireless/ath/ath5k/base.c
> @@ -2294,6 +2294,8 @@ ath5k_tx_complete_poll_work(struct work_struct *work)
> int i;
> bool needreset = false;
>
> + mutex_lock(&sc->lock);
> +
> for (i = 0; i < ARRAY_SIZE(sc->txqs); i++) {
> if (sc->txqs[i].setup) {
> txq = &sc->txqs[i];
> @@ -2321,6 +2323,8 @@ ath5k_tx_complete_poll_work(struct work_struct *work)
> ath5k_reset(sc, NULL, true);
> }
>
> + mutex_unlock(&sc->lock);
> +
> ieee80211_queue_delayed_work(sc->hw, &sc->tx_complete_work,
> msecs_to_jiffies(ATH5K_TX_COMPLETE_POLL_INT));
> }
Acked-by: Bruno Randolf <br1@einfach.org>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-01-19 0:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-18 13:06 [PATCH] ath5k: fix locking in tx_complete_poll_work Bob Copeland
2011-01-19 0:58 ` Bruno Randolf
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox