linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kalle.valo@iki.fi>
To: linux-wireless@vger.kernel.org
Cc: Johannes Berg <johannes@sipsolutions.net>
Subject: ieee80211_scan_completed() calling config() and possible deadlock
Date: Mon, 23 Feb 2009 15:05:20 +0200	[thread overview]
Message-ID: <87vdr1717z.fsf@litku.valot.fi> (raw)

Hello,

I'm currently wondering how to implement the locking
ieee80211_scan_completed() and I would like hear comments from people.

In wl12xx and at76c50x-usb the locking was originally implemented such
that drivers' config() function acquired a mutex. Also elsewhere the
drivers called ieee80211_scan_completed() under the same mutex. As we
know, ieee80211_scan_completed() calls ieee80211_hw_config() which
again calls driver's config() function. So this ended up to a
deadlock. The problem was easy to fix, just release the mutex in the
driver before calling the completed() function.

Now I need to add a similar function, currently named
ieee80211_beacon_loss(), for the beacon filtering patches I'm working
on. The function will disassociate whenever driver calls it. While
experimenting with stlc45xx I noticed that I have a similar problem as
with ieee80211_scan_completed(), ieee80211_beacon_loss() calls
driver's config() function eventually and I had a deadlock in stlc45xx.

I'm just wondering what's the right way(tm) to handle this. I see two
options:

1. Consider the (possible) deadlock as a feature, document it and let
   the drivers handle it. This is relatively easy.

2. Handle this in mac80211 (eg. schedule a workqueue) and drivers
   don't need to care. This might complicate mac80211 implementation a
   bit, but easier for the drivers.

I myself cannot decide which one is better. What do people think? 

-- 
Kalle Valo

             reply	other threads:[~2009-02-23 13:05 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-23 13:05 Kalle Valo [this message]
2009-02-23 13:13 ` ieee80211_scan_completed() calling config() and possible deadlock Michael Buesch
2009-02-23 13:23   ` Kalle Valo

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=87vdr1717z.fsf@litku.valot.fi \
    --to=kalle.valo@iki.fi \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).