Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Nov 2020 13:44:26 +0000
From:      "Wall, Stephen" <stephen.wall@redcom.com>
To:        Konstantin Belousov <kostikbel@gmail.com>
Cc:        "freebsd-drivers@freebsd.org" <freebsd-drivers@freebsd.org>
Subject:   Re: bug in sound driver?
Message-ID:  <DM6PR09MB4807A9E98A645420B53F005FEEFF0@DM6PR09MB4807.namprd09.prod.outlook.com>
In-Reply-To: <X7epxqZFFzH75no5@kib.kiev.ua>
References:  <DM6PR09MB4807F15897B9571B9D824D78EEE00@DM6PR09MB4807.namprd09.prod.outlook.com>, <X7epxqZFFzH75no5@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
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 =3D=3D NULL || !((*ch)->flags & CHN_F_BUSY)) {
> +               if (rdch !=3D NULL || wrch !=3D 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 re=
turn only one channel.  I've confirmed that this eliminates the "non-sleepa=
ble lock" panic in our driver.  Note that I've never seen this with the sou=
nd 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 t=
he sound driver).

-spw



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DM6PR09MB4807A9E98A645420B53F005FEEFF0>