bug in sound driver?

Wall, Stephen stephen.wall at redcom.com
Fri Nov 20 13:44:30 UTC 2020


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).

-spw


More information about the freebsd-drivers mailing list