From 72affdecdd4901a8a1b71b2120731498e46347a4 Mon Sep 17 00:00:00 2001 From: Murali Karicheri Date: Thu, 17 Sep 2015 09:02:14 -0700 Subject: [PATCH] soc: ti: reset irq affinity before freeing irq When using accumulator queue for rx side for network driver, following warning is seen when doing a reboot command from Linux console. This is because, affinity value is not reset before calling free_irq(). This patch fixes this. Deconfiguring network interfaces... ------------[ cut here ]----------- WARNING: CPU: 0 PID: 2081 at kernel/irq/manage.c:1370 __free_irq+0x208/0x214 Modules linked in: CPU: 0 PID: 2081 Comm: ifconfig Not tainted 4.1.5-00908-g1049e206-dirty #1 Hardware name: Keystone Backtrace: [] (dump_backtrace) from [] (show_stack+0x18/0x1c) r7:c005d0a8 r6:c06e2184 r5:c06e2184 r4:00000000 [] (show_stack) from [] (dump_stack+0x8c/0xcc) [] (dump_stack) from [] (warn_slowpath_common+0x88/0xb8) r7:c005d0a8 r6:0000055a r5:00000009 r4:0000000 [] (warn_slowpath_common) from [] (warn_slowpath_null+0x 24/0x2c) r8:0000006c r7:ee513f60 r6:ee513f00 r5:ee611010 r4:cc873a00 (warn_slowpath_null) from [] (__free_irq+0x208/0x214) [] (__free_irq) from [] (free_irq+0x54/0xac) r10:00000002 r9:00000000 r8:00000000 r7:ee611010 r6:0000006c r5:00000000 r4:ee513f00 r3:00000000 [] (free_irq) from [] (knav_range_setup_acc_irq+0xb0/0x1 28) r7:00000001 r6:0000006c r5:ee611010 r4:00000001 [] (knav_range_setup_acc_irq) from [] (knav_acc_close_qu eue+0x20/0x24) r8:edd1a4c8 r7:00001000 r6:eed89980 r5:ee616650 r4:edf9d990 [] (knav_acc_close_queue) from [] (knav_queue_close+0xb4 /0xb8) [] (knav_queue_close) from [] (netcp_free_navigator_reso urces+0x1d4/0x2c0) r5:edd1a480 r4:00000400 [] (netcp_free_navigator_resources) from [] (netcp_ndo_stop+0x220/0x230) r10:00008914 r9:edf34400 r8:00000000 r7:edd1a5d8 r6:edd1a480 r5:00000400 r4:edd1a000 [] (netcp_ndo_stop) from [ (__dev_close_many+0x90/0xd8) r7:00001003 r6:00001042 r5:edb0de20 r4:edd1a000 [] (__dev_close_many) from [] (__dev_close+0x30/0x48) r5:00000001 r4:edd1a000 [] (__dev_close) from [] (__dev_change_flags+0x9c/0x14c) [] (__dev_change_flags) from [] (dev_change_flags+0x20/0 r9:edf34400 r8:00000000 r7:00000000 r6:00001003 r5:edd1a138 r4:edd1a000 [] (dev_change_flags) from [] (devinet_ioctl+0x680/0x754 r9:edf34400 r8:bef6af3c r7:00000000 r6:bef6ac64 r5:edf3440c r4:00000000 [] (devinet_ioctl) from [] (inet_ioctl+0x1a8/0x1d0) r10:00000000 r9:edb0c000 r8:bef6ac64 r7:00000003 r6:bef6ac64 r5:bef6ac64 r4:00008914 [] (inet_ioctl) from [] (sock_ioctl+0x1d0/0x2a8) [] (sock_ioctl) from [] (do_vfs_ioctl+0x414/0x604) r7:00000003 r6:ed8b60c0 r5:bef6ac64 r4:ccc88f20 [] (do_vfs_ioctl) from [] (SyS_ioctl+0x3c/0x64) r9:edb0c000 r8:bef6ac64 r7:00008914 r6:ed8b60c0 r5:00000003 r4:ed8b60c0 [] (SyS_ioctl) from [] (ret_fast_syscall+0x0/0x3c) r9:edb0c000 r8:c000f924 r7:00000036 r6:0007e77c r5:bef6ac64 r4:0007e7d0 ---[ end trace f565594c905af0b4 ]--- Signed-off-by: Murali Karicheri Signed-off-by: Santosh Shilimkar Signed-off-by: Arnd Bergmann --- drivers/soc/ti/knav_qmss_acc.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/soc/ti/knav_qmss_acc.c b/drivers/soc/ti/knav_qmss_acc.c index ef6f69db0bd0..b98fe56598dd 100644 --- a/drivers/soc/ti/knav_qmss_acc.c +++ b/drivers/soc/ti/knav_qmss_acc.c @@ -261,6 +261,10 @@ static int knav_range_setup_acc_irq(struct knav_range_info *range, if (old && !new) { dev_dbg(kdev->dev, "setup-acc-irq: freeing %s for channel %s\n", acc->name, acc->name); + ret = irq_set_affinity_hint(irq, NULL); + if (ret) + dev_warn(range->kdev->dev, + "Failed to set IRQ affinity\n"); free_irq(irq, range); }