From: Alexander Aring Date: Mon, 31 Mar 2014 01:26:51 +0000 (+0200) Subject: at86rf230: mask irq's before deregister device X-Git-Tag: Ubuntu-5.2.0-15.16~13741^2~17^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=17e84a9253467552fb06f99c009bb0bc1d7bfd39;p=mirror_ubuntu-eoan-kernel.git at86rf230: mask irq's before deregister device While transmit over a at86rf231 device and unloading the module I got: [ 29.643073] WARNING: CPU: 0 PID: 3 at kernel/workqueue.c:1335 __queue_work+0xb4/0x224() [ 29.651457] Modules linked in: at86rf230(-) autofs4 [ 29.656612] CPU: 0 PID: 3 Comm: ksoftirqd/0 Tainted: G W 3.14.0-rc6-01602-g902659e-dirty #294 [ 29.666490] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 29.674628] [] (show_stack) from [] (warn_slowpath_common+0x60/0x80) [ 29.683116] [] (warn_slowpath_common) from [] (warn_slowpath_null+0x18/0x20) [ 29.692329] [] (warn_slowpath_null) from [] (__queue_work+0xb4/0x224) [ 29.700906] [] (__queue_work) from [] (queue_work_on+0x50/0x78) [ 29.708944] [] (queue_work_on) from [] (mac802154_tx+0x1e4/0x240) [ 29.717164] [] (mac802154_tx) from [] (dev_hard_start_xmit+0x2f0/0x43c) [ 29.725926] [] (dev_hard_start_xmit) from [] (sch_direct_xmit+0x64/0x2a0) [ 29.734867] [] (sch_direct_xmit) from [] (__qdisc_run+0x12c/0x18c) [ 29.743169] [] (__qdisc_run) from [] (net_tx_action+0xe0/0x178) [ 29.751205] [] (net_tx_action) from [] (__do_softirq+0x100/0x264) [ 29.759420] [] (__do_softirq) from [] (run_ksoftirqd+0x24/0x4c) [ 29.767453] [] (run_ksoftirqd) from [] (smpboot_thread_fn+0x128/0x13c) [ 29.776121] [] (smpboot_thread_fn) from [] (kthread+0xd0/0xe4) [ 29.784061] [] (kthread) from [] (ret_from_fork+0x14/0x2c) [ 29.791628] ---[ end trace 3406ff24bd973834 ]--- The problem is there are still interrupts after deregister ieee802154 device. This patch mask all interrupts in the at86rf2xx chips before deregister the device. Signed-off-by: Alexander Aring Signed-off-by: David S. Miller --- diff --git a/drivers/net/ieee802154/at86rf230.c b/drivers/net/ieee802154/at86rf230.c index a30258aad139..fbb83d175da3 100644 --- a/drivers/net/ieee802154/at86rf230.c +++ b/drivers/net/ieee802154/at86rf230.c @@ -997,6 +997,8 @@ static int at86rf230_remove(struct spi_device *spi) { struct at86rf230_local *lp = spi_get_drvdata(spi); + /* mask all at86rf230 irq's */ + at86rf230_write_subreg(lp, SR_IRQ_MASK, 0); ieee802154_unregister_device(lp->dev); free_irq(spi->irq, lp);