提交 16095595 编写于 作者: S Steve Glendinning 提交者: David S. Miller

smsc9420: fix interrupt signalling test failures

smsc9420 performs an interrupt signalling test when the interface is
brought up.  The current code mistakenly sets its test flag to false
AFTER enabling the software interrupt source, making failure quite
likely.

This patch changes the code to set the test flag BEFORE enabling
interrupts. I've also removed an smp_wmb because the following spinlock
provides an implicit memory barrier.
Signed-off-by: NSteve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 b1c4a9dd
...@@ -1378,6 +1378,7 @@ static int smsc9420_open(struct net_device *dev) ...@@ -1378,6 +1378,7 @@ static int smsc9420_open(struct net_device *dev)
/* test the IRQ connection to the ISR */ /* test the IRQ connection to the ISR */
smsc_dbg(IFUP, "Testing ISR using IRQ %d", dev->irq); smsc_dbg(IFUP, "Testing ISR using IRQ %d", dev->irq);
pd->software_irq_signal = false;
spin_lock_irqsave(&pd->int_lock, flags); spin_lock_irqsave(&pd->int_lock, flags);
/* configure interrupt deassertion timer and enable interrupts */ /* configure interrupt deassertion timer and enable interrupts */
...@@ -1393,8 +1394,6 @@ static int smsc9420_open(struct net_device *dev) ...@@ -1393,8 +1394,6 @@ static int smsc9420_open(struct net_device *dev)
smsc9420_pci_flush_write(pd); smsc9420_pci_flush_write(pd);
timeout = 1000; timeout = 1000;
pd->software_irq_signal = false;
smp_wmb();
while (timeout--) { while (timeout--) {
if (pd->software_irq_signal) if (pd->software_irq_signal)
break; break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册