All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan@kernel.org>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>,
	linux-wireless@vger.kernel.org
Subject: Re: wifi: mac80211: lockdep splat with 6.7-rc1
Date: Wed, 15 Nov 2023 08:34:59 +0100	[thread overview]
Message-ID: <ZVR0o7Jvp6-zCS7R@hovoldconsulting.com> (raw)
In-Reply-To: <02159e92fd1d9a6fd993ae9f913c7ed756b6d3ac.camel@sipsolutions.net>

On Tue, Nov 14, 2023 at 06:02:33PM +0100, Johannes Berg wrote:
> On Tue, 2023-11-14 at 16:50 +0100, Johan Hovold wrote:

> > Naively adding locking around the call in ieee80211_get_tx_power()
> > (e.g. similar to 6b348f6e34ce ("wifi: mac80211: ethtool: always hold
> > wiphy mutex")) does not work as there are other paths that call this
> > function with the lock held, specifically via ieee80211_register_hw().
> 
> The latter we can just take the lock I guess?

ieee80211_register_hw() is specifically already taking the lock. 
 
> > [    7.127780]  ieee80211_get_tx_power+0x19c/0x1c0 [mac80211]
> > [    7.127859]  nl80211_send_iface+0x208/0x6a4 [cfg80211]
> > [    7.127946]  nl80211_dump_interface+0x120/0x254 [cfg80211]
> 
> And here maybe we should just take the mutex at the nl80211 level.

Yeah, it looks like you can possibly add it to nl80211_dump_interface().

nl80211_send_iface() is already called in paths like:

    ieee80211_get_tx_power+0x28/0x1c0 [mac80211]
    nl80211_send_iface+0x208/0x6a4 [cfg80211]
    nl80211_notify_iface+0x58/0xcc [cfg80211]
    cfg80211_register_wdev+0xa0/0x12c [cfg80211]
    cfg80211_register_netdevice+0x7c/0x108 [cfg80211]
    ieee80211_if_add+0x4b0/0x5cc [mac80211]
    ieee80211_register_hw+0xbec/0xc2c [mac80211]

> That's the nice thing now, it's shared between the layers :)
> 
> I can't do it right now, but I'll take a look tomorrow.

Sounds good, thanks.

Johan

      reply	other threads:[~2023-11-15  7:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-14 15:50 wifi: mac80211: lockdep splat with 6.7-rc1 Johan Hovold
2023-11-14 17:02 ` Johannes Berg
2023-11-15  7:34   ` Johan Hovold [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ZVR0o7Jvp6-zCS7R@hovoldconsulting.com \
    --to=johan@kernel.org \
    --cc=emmanuel.grumbach@intel.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.