atl1: add value to check ability of reenabling IRQs
authorTony Zelenoff <antonz@parallels.com>
Fri, 13 Apr 2012 06:09:51 +0000 (06:09 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 15 Apr 2012 16:56:02 +0000 (12:56 -0400)
Unfortunately it is not clear from code is usage of
IMR register possible or not. So, to prevent possible
side-effects of reading this register i prefer store
interrupts enable flag separately.

Signed-off-by: Tony Zelenoff <antonz@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/atheros/atlx/atl1.h
drivers/net/ethernet/atheros/atlx/atlx.c

index 71bb50dfc5fad3917c1c815bf404f456179e88f1..117a0da360b852eb00882f37d10af7e73322a86e 100644 (file)
@@ -783,6 +783,12 @@ struct atl1_adapter {
        u16 ict;                /* interrupt clear timer (2us resolution */
        struct mii_if_info mii; /* MII interface info */
 
+       /*
+        * Use this value to check is napi handler allowed to
+        * enable ints or not
+        */
+       bool int_enabled;
+
        u32 bd_number;          /* board number */
        bool pci_using_64;
        struct atl1_hw hw;
index ee83e1cc8b20edf77b94467609dfe42fdd071bac..95975b5b7f70ac87edc8d804fbcce026a1cbe0cf 100644 (file)
@@ -169,6 +169,7 @@ static inline void atlx_imr_set(struct atlx_adapter *adapter,
 static void atlx_irq_enable(struct atlx_adapter *adapter)
 {
        atlx_imr_set(adapter, IMR_NORMAL_MASK);
+       adapter->int_enabled = true;
 }
 
 /*
@@ -177,6 +178,7 @@ static void atlx_irq_enable(struct atlx_adapter *adapter)
  */
 static void atlx_irq_disable(struct atlx_adapter *adapter)
 {
+       adapter->int_enabled = false;
        atlx_imr_set(adapter, 0);
        synchronize_irq(adapter->pdev->irq);
 }