NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/55301: rare audio panic on resume, assertion "sc->sc_pbusy == false" failed



The following reply was made to PR kern/55301; it has been noted by GNATS.

From: nia <nia%NetBSD.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: nia%pkgsrc.org@localhost
Subject: Re: kern/55301: rare audio panic on resume, assertion "sc->sc_pbusy
 == false" failed
Date: Tue, 26 May 2020 09:52:31 +0000

 The logic in audio_resume is busted.
 
 It's calling audio_pmixer_start when sc->sc_pbusy which is totally
 wrong.
 
 This inverts the logic, which fixes the panic. Programs using
 audio still hang on resume, but it's an improvement.
 
 Index: sys/dev/audio/audio.c
 ===================================================================
 RCS file: /cvsroot/src/sys/dev/audio/audio.c,v
 retrieving revision 1.69
 diff -u -r1.69 audio.c
 --- sys/dev/audio/audio.c	1 May 2020 08:21:27 -0000	1.69
 +++ sys/dev/audio/audio.c	26 May 2020 09:50:39 -0000
 @@ -7755,11 +7755,9 @@
  	/* Halts mixers but don't clear busy flag for resume */
  	if (sc->sc_pbusy) {
  		audio_pmixer_halt(sc);
 -		sc->sc_pbusy = true;
  	}
  	if (sc->sc_rbusy) {
  		audio_rmixer_halt(sc);
 -		sc->sc_rbusy = true;
  	}
  
  #ifdef AUDIO_PM_IDLE
 @@ -7786,9 +7784,9 @@
  	AUDIO_INITINFO(&ai);
  	audio_hw_setinfo(sc, &ai, NULL);
  
 -	if (sc->sc_pbusy)
 +	if (!sc->sc_pbusy)
  		audio_pmixer_start(sc, true);
 -	if (sc->sc_rbusy)
 +	if (!sc->sc_rbusy)
  		audio_rmixer_start(sc);
  
  	audio_exlock_mutex_exit(sc);
 


Home | Main Index | Thread Index | Old Index