79 lines
2.4 KiB
Diff
79 lines
2.4 KiB
Diff
From 271b3e203a92b4ba55b4a6ff3281a59e99ad486c Mon Sep 17 00:00:00 2001
|
|
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
Date: Tue, 25 Mar 2014 18:34:20 +0100
|
|
Subject: [PATCH] net: gianfar: do not disable interrupts
|
|
Origin: https://www.kernel.org/pub/linux/kernel/projects/rt/4.0/patches-4.0.4-rt1.tar.xz
|
|
|
|
each per-queue lock is taken with spin_lock_irqsave() except in the case
|
|
where all of them are taken for some kind of serialisation. As an
|
|
optimisation local_irq_save() is used so that lock_tx_qs() and
|
|
lock_rx_qs() can use just the spin_lock() variant instead.
|
|
On RT local_irq_save() behaves differently so we use the nort()
|
|
variant.
|
|
Lockdep screems easily by "ethtool -K eth0 rx off tx off"
|
|
|
|
What remains is missing lockdep annotation that makes lockdep think
|
|
lock_tx_qs() may cause a dead lock.
|
|
|
|
Cc: stable-rt@vger.kernel.org
|
|
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
|
---
|
|
drivers/net/ethernet/freescale/gianfar.c | 12 ++++++------
|
|
1 file changed, 6 insertions(+), 6 deletions(-)
|
|
|
|
--- a/drivers/net/ethernet/freescale/gianfar.c
|
|
+++ b/drivers/net/ethernet/freescale/gianfar.c
|
|
@@ -1522,7 +1522,7 @@ static int gfar_suspend(struct device *d
|
|
|
|
if (netif_running(ndev)) {
|
|
|
|
- local_irq_save(flags);
|
|
+ local_irq_save_nort(flags);
|
|
lock_tx_qs(priv);
|
|
|
|
gfar_halt_nodisable(priv);
|
|
@@ -1538,7 +1538,7 @@ static int gfar_suspend(struct device *d
|
|
gfar_write(®s->maccfg1, tempval);
|
|
|
|
unlock_tx_qs(priv);
|
|
- local_irq_restore(flags);
|
|
+ local_irq_restore_nort(flags);
|
|
|
|
disable_napi(priv);
|
|
|
|
@@ -1580,7 +1580,7 @@ static int gfar_resume(struct device *de
|
|
/* Disable Magic Packet mode, in case something
|
|
* else woke us up.
|
|
*/
|
|
- local_irq_save(flags);
|
|
+ local_irq_save_nort(flags);
|
|
lock_tx_qs(priv);
|
|
|
|
tempval = gfar_read(®s->maccfg2);
|
|
@@ -1590,7 +1590,7 @@ static int gfar_resume(struct device *de
|
|
gfar_start(priv);
|
|
|
|
unlock_tx_qs(priv);
|
|
- local_irq_restore(flags);
|
|
+ local_irq_restore_nort(flags);
|
|
|
|
netif_device_attach(ndev);
|
|
|
|
@@ -3384,14 +3384,14 @@ static irqreturn_t gfar_error(int irq, v
|
|
dev->stats.tx_dropped++;
|
|
atomic64_inc(&priv->extra_stats.tx_underrun);
|
|
|
|
- local_irq_save(flags);
|
|
+ local_irq_save_nort(flags);
|
|
lock_tx_qs(priv);
|
|
|
|
/* Reactivate the Tx Queues */
|
|
gfar_write(®s->tstat, gfargrp->tstat);
|
|
|
|
unlock_tx_qs(priv);
|
|
- local_irq_restore(flags);
|
|
+ local_irq_restore_nort(flags);
|
|
}
|
|
netif_dbg(priv, tx_err, dev, "Transmit Error\n");
|
|
}
|