2007-05-02 21:14:42

by Jiri Benc

[permalink] [raw]
Subject: [PATCH] mac80211: fix false lockdep warning

This makes lockdep aware of xmit_lock hierarchy between master and virtual
interfaces.

Signed-off-by: Jiri Benc <[email protected]>

---
net/mac80211/ieee80211.c | 12 +++++++++++-
1 files changed, 11 insertions(+), 1 deletion(-)

--- mac80211.orig/net/mac80211/ieee80211.c
+++ mac80211/net/mac80211/ieee80211.c
@@ -2167,6 +2167,16 @@ static int ieee80211_change_mtu_apdev(st
return 0;
}

+enum netif_tx_lock_class {
+ TX_LOCK_NORMAL,
+ TX_LOCK_MASTER,
+}
+
+static inline void netif_tx_lock_nested(struct net_device *dev, int subclass)
+{
+ spin_lock_nested(&dev->_xmit_lock, subclass);
+ dev->xmit_lock_owner = smp_processor_id();
+}

static void ieee80211_set_multicast_list(struct net_device *dev)
{
@@ -2174,7 +2184,7 @@ static void ieee80211_set_multicast_list
struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
unsigned short flags;

- netif_tx_lock(local->mdev);
+ netif_tx_lock_nested(local->mdev, TX_LOCK_MASTER);
if (((dev->flags & IFF_ALLMULTI) != 0) ^ (sdata->allmulti != 0)) {
if (sdata->allmulti) {
sdata->allmulti = 0;


--
Jiri Benc
SUSE Labs


2007-05-02 21:17:47

by Jiri Benc

[permalink] [raw]
Subject: Re: [PATCH] mac80211: fix false lockdep warning

On Wed, 2 May 2007 23:14:25 +0200, Jiri Benc wrote:
> +enum netif_tx_lock_class {
> + TX_LOCK_NORMAL,
> + TX_LOCK_MASTER,
> +}

Forgot to refresh the patch before sending. A semicolon is missing here.

J.

--
Jiri Benc
SUSE Labs