Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 12 Feb 2013 09:41:33 +0100
From:      Hans Petter Selasky <hselasky@c2i.net>
To:        Adrian Chadd <adrian@freebsd.org>
Cc:        svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin <jhb@freebsd.org>
Subject:   Re: svn commit: r246614 - head/sys/dev/usb/wlan
Message-ID:  <201302120941.33621.hselasky@c2i.net>
In-Reply-To: <CAJ-VmokFXM1mC=%2Bnp4pz1zzOgXdmzPVpjouJdrRR1GRU-2xynw@mail.gmail.com>
References:  <201302101036.r1AAaHs1022034@svn.freebsd.org> <201302120843.32349.hselasky@c2i.net> <CAJ-VmokFXM1mC=%2Bnp4pz1zzOgXdmzPVpjouJdrRR1GRU-2xynw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tuesday 12 February 2013 09:08:44 Adrian Chadd wrote:
> Well, how are you preventing the detach from running _during_ an ioctl()?
> 
> Have you eliminated the race, or just narrowed it?
> 

Hi,

This is not handled, like you suggest. I'm not sure what the best approach is, 
but probably we need to destroy the cdev calling the ioctl synchronously 
first.

Do you agree that we need a 3-step proces?

1) Stop everything
2) Drain the stopping
3) Free

The problem is atomicity and LOR. Some functions which free resources might 
have to wait for refcounts to go away, which means blocking operation. I can 
stop multiple USB transfers atomically, but can I also stop the network stack 
atomically? Else I need to have those checks around ieee80211_input() and I 
see btw, that we have to drop the WLAN USB locks to call that function, so it 
gets a bit more complicated. I.E. we need to stop and drain USB transfers 
first.

There are many USB WLAN drivers, but only one WLAN API. Should these checks be 
factored out of USB WLAN and into the WLAN API itself?

--HPS



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302120941.33621.hselasky>