diff options
author | Thomas Bogendoerfer <tbogendoerfer@suse.de> | 2019-08-30 11:25:37 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-08-30 22:54:36 +0200 |
commit | d1c9454274d84671737574ec21c69f26c0433307 (patch) | |
tree | 05e4c59356d699ecc1997c53f4eef66eaed51858 /drivers/net/ethernet/sgi | |
parent | net: sgi: ioc3-eth: Fix IPG settings (diff) | |
download | linux-d1c9454274d84671737574ec21c69f26c0433307.tar.xz linux-d1c9454274d84671737574ec21c69f26c0433307.zip |
net: sgi: ioc3-eth: protect emcr in all cases
emcr in private struct wasn't always protected by spinlock.
Signed-off-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/sgi')
-rw-r--r-- | drivers/net/ethernet/sgi/ioc3-eth.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/net/ethernet/sgi/ioc3-eth.c b/drivers/net/ethernet/sgi/ioc3-eth.c index 971986433d4c..963ed0f9787c 100644 --- a/drivers/net/ethernet/sgi/ioc3-eth.c +++ b/drivers/net/ethernet/sgi/ioc3-eth.c @@ -729,6 +729,8 @@ static inline void ioc3_setup_duplex(struct ioc3_private *ip) { struct ioc3_ethregs *regs = ip->regs; + spin_lock_irq(&ip->ioc3_lock); + if (ip->mii.full_duplex) { writel(ETCSR_FD, ®s->etcsr); ip->emcr |= EMCR_DUPLEX; @@ -737,6 +739,8 @@ static inline void ioc3_setup_duplex(struct ioc3_private *ip) ip->emcr &= ~EMCR_DUPLEX; } writel(ip->emcr, ®s->emcr); + + spin_unlock_irq(&ip->ioc3_lock); } static void ioc3_timer(struct timer_list *t) @@ -1625,6 +1629,8 @@ static void ioc3_set_multicast_list(struct net_device *dev) netif_stop_queue(dev); /* Lock out others. */ + spin_lock_irq(&ip->ioc3_lock); + if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */ ip->emcr |= EMCR_PROMISC; writel(ip->emcr, ®s->emcr); @@ -1653,6 +1659,8 @@ static void ioc3_set_multicast_list(struct net_device *dev) writel(ip->ehar_l, ®s->ehar_l); } + spin_unlock_irq(&ip->ioc3_lock); + netif_wake_queue(dev); /* Let us get going again. */ } |