FreeBSD Bugzilla – Attachment 218672 Details for
Bug 194727
uaudio device gets disconnected, and hangs usb until everything using /dev/mixer* is closed
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
mixer patch
kern_sound_mixer.patch (text/plain), 2.15 KB, created by
Ivan Rozhuk
on 2020-10-11 20:37:18 UTC
(
hide
)
Description:
mixer patch
Filename:
MIME Type:
Creator:
Ivan Rozhuk
Created:
2020-10-11 20:37:18 UTC
Size:
2.15 KB
patch
obsolete
>Index: /usr/src/sys/dev/sound/pcm/mixer.c >=================================================================== >--- /usr/src/sys/dev/sound/pcm/mixer.c (revision 366623) >+++ /usr/src/sys/dev/sound/pcm/mixer.c (working copy) >@@ -774,25 +774,14 @@ > > d = device_get_softc(dev); > pdev = mixer_get_devt(dev); >- if (d == NULL || pdev == NULL || pdev->si_drv1 == NULL) >+ if (d == NULL || pdev == NULL || (m = pdev->si_drv1) == NULL) > return EBADF; > >- m = pdev->si_drv1; > KASSERT(m != NULL, ("NULL snd_mixer")); > KASSERT(m->type == MIXER_TYPE_PRIMARY, > ("%s(): illegal mixer type=%d", __func__, m->type)); > >- snd_mtxlock(m->lock); >- >- if (m->busy) { >- snd_mtxunlock(m->lock); >- return EBUSY; >- } >- >- /* destroy dev can sleep --hps */ >- >- snd_mtxunlock(m->lock); >- >+ d->mixer_dev = NULL; > pdev->si_drv1 = NULL; > destroy_dev(pdev); > >@@ -812,7 +801,6 @@ > snd_mtxfree(m->lock); > kobj_delete((kobj_t)m, M_MIXER); > >- d->mixer_dev = NULL; > > --mixer_count; > >Index: /usr/src/sys/dev/sound/pcm/sound.c >=================================================================== >--- /usr/src/sys/dev/sound/pcm/sound.c (revision 366623) >+++ /usr/src/sys/dev/sound/pcm/sound.c (working copy) >@@ -1145,9 +1145,7 @@ > { > struct snddev_info *d; > struct pcm_channel *ch; >- struct thread *td; > >- td = curthread; > d = device_get_softc(dev); > > if (!PCM_ALIVE(d)) { >@@ -1194,15 +1192,7 @@ > } > } > >- if (mixer_uninit(dev) == EBUSY) { >- device_printf(dev, "unregister: mixer busy\n"); >- PCM_LOCK(d); >- if (d->clones != NULL) >- (void)snd_clone_enable(d->clones); >- PCM_RELEASE(d); >- PCM_UNLOCK(d); >- return (EBUSY); >- } >+ mixer_uninit(dev); > > /* remove /dev/sndstat entry first */ > sndstat_unregister(dev); >Index: /usr/src/sys/dev/sound/usb/uaudio.c >=================================================================== >--- /usr/src/sys/dev/sound/usb/uaudio.c (revision 366623) >+++ /usr/src/sys/dev/sound/usb/uaudio.c (working copy) >@@ -1230,8 +1230,10 @@ > if (sc->sc_child[i].pcm_registered) { > error = pcm_unregister(dev); > } else { >- if (sc->sc_child[i].mixer_init) >- error = mixer_uninit(dev); >+ if (sc->sc_child[i].mixer_init) { >+ error = 0; >+ mixer_uninit(dev); >+ } > } > > if (error) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 194727
:
212945
| 218672 |
221375
|
234198