[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1334333394-38404-7-git-send-email-antonz@parallels.com>
Date: Fri, 13 Apr 2012 20:09:51 +0400
From: Tony Zelenoff <antonz@...allels.com>
To: <davem@...emloft.net>
CC: <antonz@...allels.com>, <netdev@...r.kernel.org>,
<jcliburn@...il.com>, <csnook@...hat.com>, <khorenko@...allels.com>
Subject: [PATCH 6/9] atl1: add value to check ability of reenabling IRQs
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@...allels.com>
---
drivers/net/ethernet/atheros/atlx/atl1.h | 6 ++++++
drivers/net/ethernet/atheros/atlx/atlx.c | 2 ++
2 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/net/ethernet/atheros/atlx/atl1.h b/drivers/net/ethernet/atheros/atlx/atl1.h
index b55084c..5209875 100644
--- a/drivers/net/ethernet/atheros/atlx/atl1.h
+++ b/drivers/net/ethernet/atheros/atlx/atl1.h
@@ -782,6 +782,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;
diff --git a/drivers/net/ethernet/atheros/atlx/atlx.c b/drivers/net/ethernet/atheros/atlx/atlx.c
index 6c4a706..b4f3aa4 100644
--- a/drivers/net/ethernet/atheros/atlx/atlx.c
+++ b/drivers/net/ethernet/atheros/atlx/atlx.c
@@ -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);
}
--
1.7.1
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists