* [PATCH 5/6] net: dsa: Do not reschedule polling if driver removed
@ 2015-10-27 14:49 Neil Armstrong
0 siblings, 0 replies; only message in thread
From: Neil Armstrong @ 2015-10-27 14:49 UTC (permalink / raw)
To: David S. Miller
Cc: Andrew Lunn, Florian Fainelli, Guenter Roeck, vivien.didelot,
Fabian Frederick, Pavel Nakonechny, Joe Perches, netdev,
linux-kernel, Frode Isaksen
Do not reschedule the delayed work used for polling when
the driver is removed, by testing the 'poll_link_needed'
flag.
Avoids this crash:
dsa dsa ethmv2 (unregistering): Link is Down
device eth1 left promiscuous mode
Unable to handle kernel paging request at virtual address bacc5cf6
...
(run_timer_softirq) from [<c003e810>] (__do_softirq+0xcc/0x320)
(__do_softirq) from [<c003ed40>] (irq_exit+0xac/0x10c)
(irq_exit) from [<c007ec20>] (__handle_domain_irq+0x50/0xa8)
Signed-off-by: Frode Isaksen <fisaksen@baylibre.com>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
---
net/dsa/dsa.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 9240a46..9881b17 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -526,7 +526,8 @@ static void dsa_link_poll_work(struct work_struct *ugly)
ds->drv->poll_link(ds);
}
- schedule_delayed_work(&dst->link_poll_work, round_jiffies_relative(HZ));
+ if (dst->link_poll_needed)
+ schedule_delayed_work(&dst->link_poll_work, round_jiffies_relative(HZ));
}
/* platform driver init and cleanup *****************************************/
@@ -949,6 +950,7 @@ static void dsa_remove_dst(struct dsa_switch_tree *dst)
int i;
if (dst->link_poll_needed) {
+ dst->link_poll_needed = 0;
cancel_delayed_work_sync(&dst->link_poll_work);
flush_delayed_work(&dst->link_poll_work);
}
--
1.9.1
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2015-10-27 14:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-10-27 14:49 [PATCH 5/6] net: dsa: Do not reschedule polling if driver removed Neil Armstrong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).