Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3.8: add network fix from: https://groups.google.com/d/msg/beagleboar…
…d/mfQwHdfHyoo/SA9EnjpXoAsJ Signed-off-by: Robert Nelson <robertcnelson@gmail.com>
- Loading branch information
1 parent
9c7cb5b
commit 9a349c4
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
72 changes: 72 additions & 0 deletions
72
patches/net/0007-net-cpsw-fix-irq_disable-with-threaded-interrupts.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
From f7351e25e37cdd7fab871af5f66dbebe36a3d658 Mon Sep 17 00:00:00 2001 | ||
From: Robert Nelson <robertcnelson@gmail.com> | ||
Date: Fri, 3 Jan 2014 10:39:30 -0600 | ||
Subject: [PATCH 7/7] net/cpsw: fix irq_disable() with threaded interrupts | ||
|
||
https://groups.google.com/d/msg/beagleboard/mfQwHdfHyoo/SA9EnjpXoAsJ | ||
|
||
Signed-off-by: Eugene <e_berta@plutospin.com> | ||
Signed-off-by: Robert Nelson <robertcnelson@gmail.com> | ||
--- | ||
drivers/net/ethernet/ti/cpsw.c | 17 ++++++++++++++--- | ||
1 file changed, 14 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c | ||
index 21ba53e..9c72a69 100644 | ||
--- a/drivers/net/ethernet/ti/cpsw.c | ||
+++ b/drivers/net/ethernet/ti/cpsw.c | ||
@@ -342,6 +342,7 @@ struct cpsw_priv { | ||
/* snapshot of IRQ numbers */ | ||
u32 irqs_table[4]; | ||
u32 num_irqs; | ||
+ bool irq_enabled; | ||
struct cpts cpts; | ||
}; | ||
|
||
@@ -458,7 +459,10 @@ static irqreturn_t cpsw_interrupt(int irq, void *dev_id) | ||
|
||
if (likely(netif_running(priv->ndev))) { | ||
cpsw_intr_disable(priv); | ||
- cpsw_disable_irq(priv); | ||
+ if (priv->irq_enabled == true) { | ||
+ cpsw_disable_irq(priv); | ||
+ priv->irq_enabled = false; | ||
+ } | ||
napi_schedule(&priv->napi); | ||
} | ||
|
||
@@ -512,7 +516,10 @@ static int cpsw_poll(struct napi_struct *napi, int budget) | ||
if ((num_total_rx + num_total_tx) < budget) { | ||
napi_complete(napi); | ||
cpsw_intr_enable(priv); | ||
- cpsw_enable_irq(priv); | ||
+ if (priv->irq_enabled == false) { | ||
+ cpsw_enable_irq(priv); | ||
+ priv->irq_enabled = true; | ||
+ } | ||
} | ||
|
||
return num_total_rx + num_total_rx; | ||
@@ -812,7 +819,10 @@ static int cpsw_ndo_stop(struct net_device *ndev) | ||
struct cpsw_priv *priv = netdev_priv(ndev); | ||
|
||
cpsw_info(priv, ifdown, "shutting down cpsw device\n"); | ||
- cpsw_disable_irq(priv); | ||
+ if (priv->irq_enabled == true) { | ||
+ cpsw_disable_irq(priv); | ||
+ priv->irq_enabled = false; | ||
+ } | ||
netif_stop_queue(priv->ndev); | ||
if (!priv->data.disable_napi) | ||
napi_disable(&priv->napi); | ||
@@ -1306,6 +1316,7 @@ static int cpsw_probe(struct platform_device *pdev) | ||
priv->dev = &ndev->dev; | ||
priv->msg_enable = netif_msg_init(debug_level, CPSW_DEBUG); | ||
priv->rx_packet_max = max(rx_packet_max, 128); | ||
+ priv->irq_enabled = false; | ||
|
||
/* | ||
* This may be required here for child devices. | ||
-- | ||
1.8.5.2 | ||
|