Home Home > GIT Browse
diff options
authorJason Wang <jasowang@redhat.com>2012-04-11 22:10:54 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-04-27 09:51:20 -0700
commit68b80be09c226e303e94241880b4a80248ee62ef (patch)
parentbb2f6102c815c14572642205191eb0fa883d8723 (diff)
8139cp: set intr mask after its handler is registered
[ Upstream commit a8c9cb106fe79c28d6b7f1397652cadd228715ff ] We set intr mask before its handler is registered, this does not work well when 8139cp is sharing irq line with other devices. As the irq could be enabled by the device before 8139cp's hander is registered which may lead unhandled irq. Fix this by introducing an helper cp_irq_enable() and call it after request_irq(). Signed-off-by: Jason Wang <jasowang@redhat.com> Reviewed-by: Flavio Leitner <fbl@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
index 10c45051caea..a8b82da3956e 100644
--- a/drivers/net/8139cp.c
+++ b/drivers/net/8139cp.c
@@ -992,6 +992,11 @@ static inline void cp_start_hw (struct cp_private *cp)
cpw8(Cmd, RxOn | TxOn);
+static void cp_enable_irq(struct cp_private *cp)
+ cpw16_f(IntrMask, cp_intr_mask);
static void cp_init_hw (struct cp_private *cp)
struct net_device *dev = cp->dev;
@@ -1031,8 +1036,6 @@ static void cp_init_hw (struct cp_private *cp)
cpw16(MultiIntr, 0);
- cpw16_f(IntrMask, cp_intr_mask);
cpw8_f(Cfg9346, Cfg9346_Lock);
@@ -1164,6 +1167,8 @@ static int cp_open (struct net_device *dev)
if (rc)
goto err_out_hw;
+ cp_enable_irq(cp);
mii_check_media(&cp->mii_if, netif_msg_link(cp), true);
@@ -2052,6 +2057,7 @@ static int cp_resume (struct pci_dev *pdev)
/* FIXME: sh*t may happen if the Rx ring buffer is depleted */
cp_init_rings_index (cp);
cp_init_hw (cp);
+ cp_enable_irq(cp);
netif_start_queue (dev);
spin_lock_irqsave (&cp->lock, flags);