From mboxrd@z Thu Jan 1 00:00:00 1970 From: Florian Fainelli Subject: [PATCH net-next v2 4/4] net: dsa: Utilize switchdev_port_bridge_getlink_deferred() Date: Mon, 9 Jan 2017 12:45:23 -0800 Message-ID: <20170109204523.5843-5-f.fainelli@gmail.com> References: <20170109204523.5843-1-f.fainelli@gmail.com> Cc: davem@davemloft.net, vivien.didelot@savoirfairelinux.com, andrew@lunn.ch, jiri@resnulli.us, marcelo.leitner@gmail.com, Florian Fainelli To: netdev@vger.kernel.org Return-path: Received: from mail-pf0-f193.google.com ([209.85.192.193]:36695 "EHLO mail-pf0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S941108AbdAIUpg (ORCPT ); Mon, 9 Jan 2017 15:45:36 -0500 Received: by mail-pf0-f193.google.com with SMTP id b22so8866641pfd.3 for ; Mon, 09 Jan 2017 12:45:30 -0800 (PST) In-Reply-To: <20170109204523.5843-1-f.fainelli@gmail.com> Sender: netdev-owner@vger.kernel.org List-ID: Fixes the following sleeping in atomic splat: [ 69.008021] BUG: sleeping function called from invalid context at kernel/locking/mutex.c:752 [ 69.016523] in_atomic(): 1, irqs_disabled(): 0, pid: 1528, name: bridge [ 69.023167] INFO: lockdep is turned off. [ 69.027118] CPU: 1 PID: 1528 Comm: bridge Not tainted 4.10.0-rc2-00131-g719651624789-dirty #205 [ 69.035840] Hardware name: Broadcom STB (Flattened Device Tree) [ 69.041796] [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [ 69.049570] [] (show_stack) from [] (dump_stack+0xb0/0xdc) [ 69.056823] [] (dump_stack) from [] (___might_sleep+0x1a4/0x2a4) [ 69.064599] [] (___might_sleep) from [] (mutex_lock_nested+0x28/0x7d8) [ 69.072897] [] (mutex_lock_nested) from [] (b53_vlan_dump+0x2c/0x104) [ 69.081105] [] (b53_vlan_dump) from [] (switchdev_port_obj_dump_now+0x30/0x6c) [ 69.090094] [] (switchdev_port_obj_dump_now) from [] (switchdev_port_obj_dump+0x3c/0x98) [ 69.099950] [] (switchdev_port_obj_dump) from [] (switchdev_port_vlan_fill+0x68/0x90) [ 69.109550] [] (switchdev_port_vlan_fill) from [] (ndo_dflt_bridge_getlink+0x28c/0x4fc) [ 69.119320] [] (ndo_dflt_bridge_getlink) from [] (switchdev_port_bridge_getlink+0xc4/0xd4) [ 69.129350] [] (switchdev_port_bridge_getlink) from [] (rtnl_bridge_getlink+0x12c/0x28c) [ 69.139206] [] (rtnl_bridge_getlink) from [] (netlink_dump+0xe8/0x268) [ 69.147495] [] (netlink_dump) from [] (__netlink_dump_start+0x12c/0x18c) [ 69.155958] [] (__netlink_dump_start) from [] (rtnetlink_rcv_msg+0x11c/0x228) [ 69.164857] [] (rtnetlink_rcv_msg) from [] (netlink_rcv_skb+0xc4/0xd8) [ 69.173145] [] (netlink_rcv_skb) from [] (rtnetlink_rcv+0x28/0x30) [ 69.181087] [] (rtnetlink_rcv) from [] (netlink_unicast+0x16c/0x238) [ 69.189201] [] (netlink_unicast) from [] (netlink_sendmsg+0x350/0x364) [ 69.197493] [] (netlink_sendmsg) from [] (sock_sendmsg+0x14/0x24) [ 69.205350] [] (sock_sendmsg) from [] (SyS_sendto+0xb8/0xe0) [ 69.212769] [] (SyS_sendto) from [] (SyS_send+0x18/0x20) [ 69.219841] [] (SyS_send) from [] (ret_fast_syscall+0x0/0x1c) Signed-off-by: Florian Fainelli --- net/dsa/slave.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/dsa/slave.c b/net/dsa/slave.c index 5cd5b8137c08..b38536f951ea 100644 --- a/net/dsa/slave.c +++ b/net/dsa/slave.c @@ -1038,7 +1038,7 @@ static const struct net_device_ops dsa_slave_netdev_ops = { .ndo_netpoll_cleanup = dsa_slave_netpoll_cleanup, .ndo_poll_controller = dsa_slave_poll_controller, #endif - .ndo_bridge_getlink = switchdev_port_bridge_getlink, + .ndo_bridge_getlink = switchdev_port_bridge_getlink_deferred, .ndo_bridge_setlink = switchdev_port_bridge_setlink, .ndo_bridge_dellink = switchdev_port_bridge_dellink, .ndo_get_phys_port_id = dsa_slave_get_phys_port_id, -- 2.9.3