Bug #727

unloading sound driver panics box

Added by corecode over 7 years ago. Updated almost 5 years ago.

Status:ClosedStart date:
Priority:UrgentDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

details at <http://leaf.dragonflybsd.org/mailarchive/commits/2007-06/msg00231.html>

we should switch back to spinlocks and maybe sync the sound code to FreeBSD-7.

History

#1 Updated by dillon over 7 years ago

:
:we should switch back to spinlocks and maybe sync the sound code to FreeBSD-7.

We can't use spinlocks in that code. FreeBSD assumes they are sleepable
mutexes so we have to use lockmgr locks (which are basically the same
thing).

-Matt

#2 Updated by corecode over 7 years ago

actually it assumes so only in one place, the uaudio driver, and this is even a bug which has been fixed in freebsd-7. so i'd say let's sacrifice uaudio (seems our only consumer didn't come back) and make the rest work properly.

cheers
simon

#3 Updated by dillon over 7 years ago

:actually it assumes so only in one place, the uaudio driver, and this is =
:even a bug which has been fixed in freebsd-7. so i'd say let's sacrifice=
: uaudio (seems our only consumer didn't come back) and make the rest work=
: properly.
:
:cheers
: simon

The design of the audio stuff does not fill me with confidence.
I really think we need to stick with high level locks just from
a safety and kernel stability point of view, because snafus
will be a lot easier to debug. Our spinlocks are simply not
designed (on purpose) to handle large swaths of code.

-Matt

#4 Updated by corecode over 7 years ago

I agree, however we definitely want to avoid the interrupt thread blocking when grabbing the lock, because this will stall all interrupt processing on this IRQ. Spinlocks worked very well since the first import of the updated sound code, so we should keep them for this release. We can still find something better after the release.

cheers
simon

#5 Updated by dillon over 7 years ago

:I agree, however we definitely want to avoid the interrupt thread blockin=
:g when grabbing the lock, because this will stall all interrupt processin=
:g on this IRQ. Spinlocks worked very well since the first import of the =
:updated sound code, so we should keep them for this release. We can stil=
:l find something better after the release.
:
:cheers
: simon

Interrupt threads have a higher priority then anything else. The
moment the lock is released the thread will run. We don't
do priority inheritence so it isn't perfect, but we also do not
do preemptive scheduling between non-interrupt threads when a thread
is in the kernel so it doesn't matter (the non-interrupt thread holding
a sound lock will not be switched away).

-Matt

#6 Updated by corecode over 7 years ago

hack committed.

Also available in: Atom PDF