]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ppp: set qdisc_tx_busylock to avoid LOCKDEP splat
authorEric Dumazet <edumazet@google.com>
Tue, 19 Feb 2013 18:42:03 +0000 (10:42 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 28 Feb 2013 13:38:40 +0000 (05:38 -0800)
[ Upstream commit 303c07db487be59ae9fda10600ea65ca11c21497 ]

If a qdisc is installed on a ppp device, its possible to get
a lockdep splat under stress, because nested dev_queue_xmit() can
lock busylock a second time (on a different device, so its a false
positive)

Avoid this problem using a distinct lock_class_key for ppp
devices.

Reported-by: Yanko Kaneti <yaneti@declera.com>
Tested-by: Yanko Kaneti <yaneti@declera.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ppp/ppp_generic.c

index 0b2706abe3e3b06dbd158eff440d8c2ccc4fb50b..508570e6fc288c4564b9a8792f091ab3bcda5c4b 100644 (file)
@@ -1058,7 +1058,15 @@ ppp_get_stats64(struct net_device *dev, struct rtnl_link_stats64 *stats64)
        return stats64;
 }
 
+static struct lock_class_key ppp_tx_busylock;
+static int ppp_dev_init(struct net_device *dev)
+{
+       dev->qdisc_tx_busylock = &ppp_tx_busylock;
+       return 0;
+}
+
 static const struct net_device_ops ppp_netdev_ops = {
+       .ndo_init        = ppp_dev_init,
        .ndo_start_xmit  = ppp_start_xmit,
        .ndo_do_ioctl    = ppp_net_ioctl,
        .ndo_get_stats64 = ppp_get_stats64,