Linux wireless drivers development
 help / color / mirror / Atom feed
* comments on fix-subif-locking.patch
@ 2007-04-17 16:01 Johannes Berg
  0 siblings, 0 replies; only message in thread
From: Johannes Berg @ 2007-04-17 16:01 UTC (permalink / raw)
  To: Michael Wu; +Cc: linux-wireless

[-- 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 --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-04-18  9:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-17 16:01 comments on fix-subif-locking.patch Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox