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

next in thread | previous in thread | raw e-mail | index | archive | help
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.



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