Linux wireless drivers development
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Michael Wu <flamingice@sourmilk.net>
Cc: linux-wireless <linux-wireless@vger.kernel.org>
Subject: comments on fix-subif-locking.patch
Date: Tue, 17 Apr 2007 18:01:22 +0200	[thread overview]
Message-ID: <1176825682.3902.41.camel@johannes.berg> (raw)

[-- Attachment #1: Type: text/plain, Size: 1377 bytes --]

Hi,

Looks pretty good. There's one catch with rtnl-less wext however: you
cannot call unregister_netdev from a wext handler any more.

The problem is that because we no longer hold rtnl for the ioctl call we
need to hold a reference to the device instead. Hence, calling
unregister_netdev will rtnl_lock(), unlink the device from the list and
then rtnl_unlock() which runs the netdev todo which should free the
device, but this fails and hangs because there's still a taken reference
to the device.

Therefore, the private prism ioctl for removing interfaces needs to go
and hostapd and whatever else uses it just needs to use cfg80211 (i.e.
sysfs or nl80211.)

In cfg80211 we do not have this problem because we pass in an interface
index to the remove call and not a device reference so that the generic
code doesn't need to hold a reference. Since cfg80211 guarantees that at
most one call is in progress at the same time, this is still race free
as long as the driver/stack doesn't provide multiple ways to delete an
interface in which case they have to do synchronisation there.

If we absolutely cannot get rid of the prism ioctl for removing devices
yet, we'll have to return success in all cases, save the name and
schedule something that then calls ieee80211_if_remove with the saved
name and without the netdev reference held.

johannes

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 190 bytes --]

                 reply	other threads:[~2007-04-18  9:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1176825682.3902.41.camel@johannes.berg \
    --to=johannes@sipsolutions.net \
    --cc=flamingice@sourmilk.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