From: Neil Armstrong <narmstrong@baylibre.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: Andrew Lunn <andrew@lunn.ch>,
Florian Fainelli <f.fainelli@gmail.com>,
Guenter Roeck <linux@roeck-us.net>,
vivien.didelot@savoirfairelinux.com,
Fabian Frederick <fabf@skynet.be>,
Pavel Nakonechny <pavel.nakonechny@skitlab.ru>,
Joe Perches <joe@perches.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Frode Isaksen <fisaksen@baylibre.com>
Subject: [PATCH 5/6] net: dsa: Do not reschedule polling if driver removed
Date: Tue, 27 Oct 2015 15:49:15 +0100 [thread overview]
Message-ID: <562F8EEB.8060606@baylibre.com> (raw)
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
reply other threads:[~2015-10-27 14:49 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=562F8EEB.8060606@baylibre.com \
--to=narmstrong@baylibre.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=f.fainelli@gmail.com \
--cc=fabf@skynet.be \
--cc=fisaksen@baylibre.com \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=netdev@vger.kernel.org \
--cc=pavel.nakonechny@skitlab.ru \
--cc=vivien.didelot@savoirfairelinux.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).