[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20160831205746.23786-12-aaro.koskinen@iki.fi>
Date: Wed, 31 Aug 2016 23:57:46 +0300
From: Aaro Koskinen <aaro.koskinen@....fi>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
David Daney <ddaney@...iumnetworks.com>,
Ed Swierk <eswierk@...portsystems.com>,
devel@...verdev.osuosl.org
Cc: linux-kernel@...r.kernel.org, Aaro Koskinen <aaro.koskinen@....fi>
Subject: [PATCH v2 11/11] staging: octeon: prevent poll during rx init
Prevent poll before the RX init has been completed.
Signed-off-by: Aaro Koskinen <aaro.koskinen@....fi>
---
drivers/staging/octeon/ethernet-rx.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/staging/octeon/ethernet-rx.c b/drivers/staging/octeon/ethernet-rx.c
index 4f32fa3..ce1e2a3 100644
--- a/drivers/staging/octeon/ethernet-rx.c
+++ b/drivers/staging/octeon/ethernet-rx.c
@@ -43,6 +43,8 @@
#include <asm/octeon/cvmx-gmxx-defs.h>
+static atomic_t oct_rx_ready = ATOMIC_INIT(0);
+
static struct oct_rx_group {
int irq;
int group;
@@ -444,6 +446,9 @@ void cvm_oct_poll_controller(struct net_device *dev)
{
int i;
+ if (!atomic_read(&oct_rx_ready))
+ return;
+
for (i = 0; i < ARRAY_SIZE(oct_rx_group); i++) {
if (!(pow_receive_groups & BIT(i)))
@@ -524,6 +529,7 @@ void cvm_oct_rx_initialize(void)
*/
napi_schedule(&oct_rx_group[i].napi);
}
+ atomic_inc(&oct_rx_ready);
}
void cvm_oct_rx_shutdown(void)
--
2.9.2
Powered by blists - more mailing lists