Commit 2ca5f2f3 authored by Tom Rini's avatar Tom Rini Committed by Linus Torvalds

[PATCH] ppc32: remove cli()/sti() in arch/ppc/8xx_io/fec.c

Replace save_flags()/resore_flags() with
spin_lock_irqsave()/spin_unlock_irqrestore() and document reasons for locking.
Signed-off-by: default avatarJames Nelson <james4765@gmail.com>
Signed-off-by: default avatarTom Rini <trini@kernel.crashing.org>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent c2ac130c
...@@ -389,6 +389,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev) ...@@ -389,6 +389,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
flush_dcache_range((unsigned long)skb->data, flush_dcache_range((unsigned long)skb->data,
(unsigned long)skb->data + skb->len); (unsigned long)skb->data + skb->len);
/* disable interrupts while triggering transmit */
spin_lock_irq(&fep->lock); spin_lock_irq(&fep->lock);
/* Send it on its way. Tell FEC its ready, interrupt when done, /* Send it on its way. Tell FEC its ready, interrupt when done,
...@@ -539,6 +540,7 @@ fec_enet_tx(struct net_device *dev) ...@@ -539,6 +540,7 @@ fec_enet_tx(struct net_device *dev)
struct sk_buff *skb; struct sk_buff *skb;
fep = dev->priv; fep = dev->priv;
/* lock while transmitting */
spin_lock(&fep->lock); spin_lock(&fep->lock);
bdp = fep->dirty_tx; bdp = fep->dirty_tx;
...@@ -799,6 +801,7 @@ fec_enet_mii(struct net_device *dev) ...@@ -799,6 +801,7 @@ fec_enet_mii(struct net_device *dev)
if ((mip = mii_head) != NULL) { if ((mip = mii_head) != NULL) {
ep->fec_mii_data = mip->mii_regval; ep->fec_mii_data = mip->mii_regval;
} }
} }
...@@ -817,8 +820,8 @@ mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_devi ...@@ -817,8 +820,8 @@ mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_devi
retval = 0; retval = 0;
save_flags(flags); /* lock while modifying mii_list */
cli(); spin_lock_irqsave(&fep->lock, flags);
if ((mip = mii_free) != NULL) { if ((mip = mii_free) != NULL) {
mii_free = mip->mii_next; mii_free = mip->mii_next;
...@@ -836,7 +839,7 @@ mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_devi ...@@ -836,7 +839,7 @@ mii_queue(struct net_device *dev, int regval, void (*func)(uint, struct net_devi
retval = 1; retval = 1;
} }
restore_flags(flags); spin_unlock_irqrestore(&fep->lock, flags);
return(retval); return(retval);
} }
......
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