Commit b92f7d30 authored by Christian Lamparter's avatar Christian Lamparter Committed by John W. Linville

p54pci: revise tx locking

This patch continues the effort which began with:
"[PATCH] p54pci: move tx cleanup into tasklet".

Thanks to these changes, p54pci's interrupt & tx
cleanup routines can be made lock-less.
Signed-off-by: default avatarChristian Lamparter <chunkeey@googlemail.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent 59af099b
...@@ -238,7 +238,6 @@ static void p54p_check_tx_ring(struct ieee80211_hw *dev, u32 *index, ...@@ -238,7 +238,6 @@ static void p54p_check_tx_ring(struct ieee80211_hw *dev, u32 *index,
int ring_index, struct p54p_desc *ring, u32 ring_limit, int ring_index, struct p54p_desc *ring, u32 ring_limit,
struct sk_buff **tx_buf) struct sk_buff **tx_buf)
{ {
unsigned long flags;
struct p54p_priv *priv = dev->priv; struct p54p_priv *priv = dev->priv;
struct p54p_ring_control *ring_control = priv->ring_control; struct p54p_ring_control *ring_control = priv->ring_control;
struct p54p_desc *desc; struct p54p_desc *desc;
...@@ -249,7 +248,6 @@ static void p54p_check_tx_ring(struct ieee80211_hw *dev, u32 *index, ...@@ -249,7 +248,6 @@ static void p54p_check_tx_ring(struct ieee80211_hw *dev, u32 *index,
(*index) = idx = le32_to_cpu(ring_control->device_idx[1]); (*index) = idx = le32_to_cpu(ring_control->device_idx[1]);
idx %= ring_limit; idx %= ring_limit;
spin_lock_irqsave(&priv->lock, flags);
while (i != idx) { while (i != idx) {
desc = &ring[i]; desc = &ring[i];
...@@ -264,16 +262,12 @@ static void p54p_check_tx_ring(struct ieee80211_hw *dev, u32 *index, ...@@ -264,16 +262,12 @@ static void p54p_check_tx_ring(struct ieee80211_hw *dev, u32 *index,
desc->len = 0; desc->len = 0;
desc->flags = 0; desc->flags = 0;
if (skb && FREE_AFTER_TX(skb)) { if (skb && FREE_AFTER_TX(skb))
spin_unlock_irqrestore(&priv->lock, flags);
p54_free_skb(dev, skb); p54_free_skb(dev, skb);
spin_lock_irqsave(&priv->lock, flags);
}
i++; i++;
i %= ring_limit; i %= ring_limit;
} }
spin_unlock_irqrestore(&priv->lock, flags);
} }
static void p54p_tasklet(unsigned long dev_id) static void p54p_tasklet(unsigned long dev_id)
...@@ -306,7 +300,6 @@ static irqreturn_t p54p_interrupt(int irq, void *dev_id) ...@@ -306,7 +300,6 @@ static irqreturn_t p54p_interrupt(int irq, void *dev_id)
struct p54p_priv *priv = dev->priv; struct p54p_priv *priv = dev->priv;
__le32 reg; __le32 reg;
spin_lock(&priv->lock);
reg = P54P_READ(int_ident); reg = P54P_READ(int_ident);
if (unlikely(reg == cpu_to_le32(0xFFFFFFFF))) { if (unlikely(reg == cpu_to_le32(0xFFFFFFFF))) {
goto out; goto out;
...@@ -321,15 +314,14 @@ static irqreturn_t p54p_interrupt(int irq, void *dev_id) ...@@ -321,15 +314,14 @@ static irqreturn_t p54p_interrupt(int irq, void *dev_id)
complete(&priv->boot_comp); complete(&priv->boot_comp);
out: out:
spin_unlock(&priv->lock);
return reg ? IRQ_HANDLED : IRQ_NONE; return reg ? IRQ_HANDLED : IRQ_NONE;
} }
static void p54p_tx(struct ieee80211_hw *dev, struct sk_buff *skb) static void p54p_tx(struct ieee80211_hw *dev, struct sk_buff *skb)
{ {
unsigned long flags;
struct p54p_priv *priv = dev->priv; struct p54p_priv *priv = dev->priv;
struct p54p_ring_control *ring_control = priv->ring_control; struct p54p_ring_control *ring_control = priv->ring_control;
unsigned long flags;
struct p54p_desc *desc; struct p54p_desc *desc;
dma_addr_t mapping; dma_addr_t mapping;
u32 device_idx, idx, i; u32 device_idx, idx, i;
...@@ -370,14 +362,14 @@ static void p54p_stop(struct ieee80211_hw *dev) ...@@ -370,14 +362,14 @@ static void p54p_stop(struct ieee80211_hw *dev)
unsigned int i; unsigned int i;
struct p54p_desc *desc; struct p54p_desc *desc;
tasklet_kill(&priv->tasklet);
P54P_WRITE(int_enable, cpu_to_le32(0)); P54P_WRITE(int_enable, cpu_to_le32(0));
P54P_READ(int_enable); P54P_READ(int_enable);
udelay(10); udelay(10);
free_irq(priv->pdev->irq, dev); free_irq(priv->pdev->irq, dev);
tasklet_kill(&priv->tasklet);
P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_RESET)); P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_RESET));
for (i = 0; i < ARRAY_SIZE(priv->rx_buf_data); i++) { for (i = 0; i < ARRAY_SIZE(priv->rx_buf_data); i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment