bug in sound driver?
Konstantin Belousov
kostikbel at gmail.com
Fri Nov 20 14:03:34 UTC 2020
On Fri, Nov 20, 2020 at 01:44:26PM +0000, Wall, Stephen wrote:
> On Friday, November 20, 2020 6:34 AM, Konstantin Belousov wrote:
> > diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c
> > index 4df035f99c8..0593a585b0f 100644
> > --- a/sys/dev/sound/pcm/dsp.c
> > +++ b/sys/dev/sound/pcm/dsp.c
> > @@ -857,6 +857,8 @@ dsp_io_ops(struct cdev *i_dev, struct uio *buf)
> > getchns(i_dev, &rdch, &wrch, prio);
> >
> > if (*ch == NULL || !((*ch)->flags & CHN_F_BUSY)) {
> > + if (rdch != NULL || wrch != NULL)
> > + relchns(i_dev, rdch, wrch, prio);
> > PCM_GIANT_EXIT(d);
> > return (EBADF);
> > }
>
> That's better than what I used, I hadn't considered that getchns() might return only one channel. I've confirmed that this eliminates the "non-sleepable lock" panic in our driver. Note that I've never seen this with the sound driver, only with our copy of it. But, I also don't have any USB audio devices (aside from the device we are building, which is not supported by the sound driver).
Committed as r367892, thank you for the report.
More information about the freebsd-drivers
mailing list