Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 15 Nov 2012 11:16:12 -0800
From:      Adrian Chadd <adrian@freebsd.org>
To:        Marko Zec <zec@fer.hr>
Cc:        freebsd-net@freebsd.org, Hans Petter Selasky <hselasky@freebsd.org>, freebsd-hackers@freebsd.org
Subject:   Re: VIMAGE crashes on 9.x with hotplug net80211 devices
Message-ID:  <CAJ-Vmo=WKJ6NxgGake4dqGV0jhOmpcsO2en=FC5U2zOkRqOn0A@mail.gmail.com>
In-Reply-To: <201211151836.04709.zec@fer.hr>
References:  <CAJ-VmomchJZ7GUKrAjmmyBXDw-6H6O5fAxT_tfAFfhU=HknG1g@mail.gmail.com> <201210291115.23845.zec@fer.hr> <CAJ-Vmom-kuqXwwTOpZLRFQNrRsdYw9aCOE-KndQH9hoWErhZmg@mail.gmail.com> <201211151836.04709.zec@fer.hr>

next in thread | previous in thread | raw e-mail | index | archive | help
Hans brings up a very good point for USB - they split if_alloc and
if_attach across two different threads.

So this works for non-USB devices, but not for USB devices.

Hans, does each device implement its own workqueue for this kind of
delayed action, or is there some generic work queue that is doing this
work?



Adrian

On 15 November 2012 09:36, Marko Zec <zec@fer.hr> wrote:
> On Thursday 15 November 2012 07:18:31 Adrian Chadd wrote:
>> Hi,
>>
>> Here's what I have thus far. Please ignore the device_printf() change.
>>
>> This works for me, both for hotplug cardbus wireless devices as well
>> as (inadvertently!) a USB bluetooth device.
>>
>> What do you think?
>
> It looks that you've hit the right spot to set curvnet context in
> device_probe_and_attach().
>
> Could you try out a slightly revised verstion (attached) - this one also
> removes now redundant curvnet setting from linker routines (kldload /
> kldunload), and adds a few extra bits which might be necessary for a
> broader range of drivers to work.
>
> Note that I haven't tested this myself as I don't have a -CURRENT machine
> ATM, but a similar patch for 8.3 apparently works fine, though I don't have
> hotplugabble network cards to play with (neither cardbus nor USB)...
>
> Cheers,
>
> Marko



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-Vmo=WKJ6NxgGake4dqGV0jhOmpcsO2en=FC5U2zOkRqOn0A>