diff options
author | Jukka Rissanen <jukka.rissanen@linux.intel.com> | 2014-10-28 11:16:48 -0400 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2014-10-28 12:04:39 -0400 |
commit | df092306d688438b39f7d433f24e091fa387afaf (patch) | |
tree | 06e34b0b35e6cd6111e3371e640338e1af84a0d9 /net/bluetooth/6lowpan.c | |
parent | 90305829635d90a5053ec99a261035b4ce0a2649 (diff) |
Bluetooth: 6lowpan: Fix lockdep splats
When a device ndo_start_xmit() calls again dev_queue_xmit(),
lockdep can complain because dev_queue_xmit() is re-entered and the
spinlocks protecting tx queues share a common lockdep class.
Same issue was fixed for ieee802154 in commit "20e7c4e80dcd"
Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/6lowpan.c')
-rw-r--r-- | net/bluetooth/6lowpan.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/net/bluetooth/6lowpan.c b/net/bluetooth/6lowpan.c index a681247b0aee..7254bddaca2f 100644 --- a/net/bluetooth/6lowpan.c +++ b/net/bluetooth/6lowpan.c | |||
@@ -662,7 +662,26 @@ static netdev_tx_t bt_xmit(struct sk_buff *skb, struct net_device *netdev) | |||
662 | return err < 0 ? NET_XMIT_DROP : err; | 662 | return err < 0 ? NET_XMIT_DROP : err; |
663 | } | 663 | } |
664 | 664 | ||
665 | static struct lock_class_key bt_tx_busylock; | ||
666 | static struct lock_class_key bt_netdev_xmit_lock_key; | ||
667 | |||
668 | static void bt_set_lockdep_class_one(struct net_device *dev, | ||
669 | struct netdev_queue *txq, | ||
670 | void *_unused) | ||
671 | { | ||
672 | lockdep_set_class(&txq->_xmit_lock, &bt_netdev_xmit_lock_key); | ||
673 | } | ||
674 | |||
675 | static int bt_dev_init(struct net_device *dev) | ||
676 | { | ||
677 | netdev_for_each_tx_queue(dev, bt_set_lockdep_class_one, NULL); | ||
678 | dev->qdisc_tx_busylock = &bt_tx_busylock; | ||
679 | |||
680 | return 0; | ||
681 | } | ||
682 | |||
665 | static const struct net_device_ops netdev_ops = { | 683 | static const struct net_device_ops netdev_ops = { |
684 | .ndo_init = bt_dev_init, | ||
666 | .ndo_start_xmit = bt_xmit, | 685 | .ndo_start_xmit = bt_xmit, |
667 | }; | 686 | }; |
668 | 687 | ||