kern/166382: [patch] snd_hda(4) is in a bad state after suspend/resume cycle

Alexander Motin mav at FreeBSD.org
Thu Mar 29 07:35:52 UTC 2012


On 03/29/12 03:26, Brandon Gooch wrote:
> On Sat, Mar 24, 2012 at 11:22 PM,<eadler at freebsd.org>  wrote:
>> Synopsis: [patch] snd_hda(4) is in a bad state after suspend/resume cycle
>>
>> Responsible-Changed-From-To: freebsd-bugs->mav
>> Responsible-Changed-By: eadler
>> Responsible-Changed-When: Sun Mar 25 04:22:54 UTC 2012
>> Responsible-Changed-Why:
>> over to maintainer
>>
>> http://www.freebsd.org/cgi/query-pr.cgi?pr=166382
>
> Hey mav, thanks for taking a look and providing a patch!
> Unfortunately, it doesn't fix the suspend/resume issue  The headphone
> jack sense polling doesn't work after resume unless the callback is
> reinitialized.
>
> Does it hurt to reinit the callback in the case of both polling and
> non-polling configuartions?

Polling is always bad. It is needed only if CODEC can't send unsolicited 
responses for jack events. I think I see the real problem: unsolicited 
responses are not reconfigured on resume. Please try attached patch.

-- 
Alexander Motin
-------------- next part --------------
Index: hdaa.c
===================================================================
--- hdaa.c	(revision 233600)
+++ hdaa.c	(working copy)
@@ -612,10 +612,11 @@
 		if (w == NULL || w->enable == 0 || w->type !=
 		    HDA_PARAM_AUDIO_WIDGET_CAP_TYPE_PIN_COMPLEX)
 			continue;
-		if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap) &&
-		    w->unsol < 0) {
-			w->unsol = HDAC_UNSOL_ALLOC(
-			    device_get_parent(devinfo->dev), devinfo->dev, w->nid);
+		if (HDA_PARAM_AUDIO_WIDGET_CAP_UNSOL_CAP(w->param.widget_cap)) {
+			if (w->unsol < 0)
+				w->unsol = HDAC_UNSOL_ALLOC(
+				    device_get_parent(devinfo->dev),
+				    devinfo->dev, w->nid);
 			hda_command(devinfo->dev,
 			    HDA_CMD_SET_UNSOLICITED_RESPONSE(0, w->nid,
 			    HDA_CMD_SET_UNSOLICITED_RESPONSE_ENABLE | w->unsol));


More information about the freebsd-bugs mailing list