Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 351832
b: refs/heads/master
c: c27a54d
h: refs/heads/master
v: v3
  • Loading branch information
Yogesh Ashok Powar authored and John W. Linville committed Jan 7, 2013
1 parent 00650a8 commit a4e46e7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cfacba12f573abd04a202e3e86c09f246339071f
refs/heads/master: c27a54d3f12383789b57a404649daf98a05cbd72
19 changes: 19 additions & 0 deletions trunk/drivers/net/wireless/mwl8k.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,8 @@ struct mwl8k_priv {
int fw_mutex_depth;
struct completion *hostcmd_wait;

atomic_t watchdog_event_pending;

/* lock held over TX and TX reap */
spinlock_t tx_lock;

Expand Down Expand Up @@ -1527,6 +1529,9 @@ static int mwl8k_tx_wait_empty(struct ieee80211_hw *hw)
return -EBUSY;
}

if (atomic_read(&priv->watchdog_event_pending))
return 0;

/*
* The TX queues are stopped at this point, so this test
* doesn't need to take ->tx_lock.
Expand All @@ -1548,6 +1553,14 @@ static int mwl8k_tx_wait_empty(struct ieee80211_hw *hw)
spin_unlock_bh(&priv->tx_lock);
timeout = wait_for_completion_timeout(&tx_wait,
msecs_to_jiffies(MWL8K_TX_WAIT_TIMEOUT_MS));

if (atomic_read(&priv->watchdog_event_pending)) {
spin_lock_bh(&priv->tx_lock);
priv->tx_wait = NULL;
spin_unlock_bh(&priv->tx_lock);
return 0;
}

spin_lock_bh(&priv->tx_lock);

if (timeout) {
Expand Down Expand Up @@ -3645,6 +3658,7 @@ static void mwl8k_watchdog_ba_events(struct work_struct *work)

spin_unlock(&priv->stream_lock);
done:
atomic_dec(&priv->watchdog_event_pending);
status = ioread32(priv->regs + MWL8K_HIU_A2H_INTERRUPT_STATUS_MASK);
iowrite32((status | MWL8K_A2H_INT_BA_WATCHDOG),
priv->regs + MWL8K_HIU_A2H_INTERRUPT_STATUS_MASK);
Expand Down Expand Up @@ -4346,6 +4360,10 @@ static irqreturn_t mwl8k_interrupt(int irq, void *dev_id)
}

if (status & MWL8K_A2H_INT_BA_WATCHDOG) {
iowrite32(~MWL8K_A2H_INT_BA_WATCHDOG,
priv->regs + MWL8K_HIU_A2H_INTERRUPT_STATUS_MASK);

atomic_inc(&priv->watchdog_event_pending);
status &= ~MWL8K_A2H_INT_BA_WATCHDOG;
ieee80211_queue_work(hw, &priv->watchdog_ba_handle);
}
Expand Down Expand Up @@ -5520,6 +5538,7 @@ static int mwl8k_probe_hw(struct ieee80211_hw *hw)
priv->sniffer_enabled = false;
priv->wmm_enabled = false;
priv->pending_tx_pkts = 0;
atomic_set(&priv->watchdog_event_pending, 0);

rc = mwl8k_rxq_init(hw, 0);
if (rc)
Expand Down

0 comments on commit a4e46e7

Please sign in to comment.