>Number:         166382
>Category:       kern
>Synopsis:       [patch] snd_hda(4) is in a bad state after suspend/resume cycle
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Mar 25 02:30:10 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Brandon Gooch
>Release:        10.0-CURRENT
>Organization:
>Environment:
FreeBSD m6500.local 10.0-CURRENT FreeBSD 10.0-CURRENT #0 r233252: Tue Mar 20 
19:36:33 CDT 2012     root@m6500.local:/usr/obj/usr/src/sys/DELL_M6500  amd64
>Description:
After an ACPI suspend/resume cycle, the snd_hda(4) driver may or may not play 
back sound. Adding a callout_stop(9) and callout_drain(9) for the poll callback 
in the suspend path allows the driver to reinit properly on resume.

Also, the (headphone) jack polling callback doesn't fire. The patch 
unconditionally calls callout_reset(9) for the jack poll callback, forcing the 
driver to reinit properly.

I'll bet that mav@ will have a few thoughts about this "patch"...
>How-To-Repeat:
Load snd_hda(4), or compile support for the device into the kernel. ACPI 
suspend, then resume the system. The driver will be in a bad state (fixable by 
reboot or kldunload/kldload-ing the kernel module).
>Fix:
Index: hdac.c
===================================================================
--- hdac.c      (revision 233252)
+++ hdac.c      (working copy)
@@ -1558,9 +1558,11 @@
        HDA_BOOTHVERBOSE(
                device_printf(dev, "Reset controller...\n");
        );
+       callout_stop(&sc->poll_callout);
        hdac_reset(sc, 0);
        hdac_unlock(sc);
        taskqueue_drain(taskqueue_thread, &sc->unsolq_task);
+       callout_drain(&sc->poll_callout);
        HDA_BOOTHVERBOSE(
                device_printf(dev, "Suspend done\n");
        );
Index: hdaa.c
===================================================================
--- hdaa.c      (revision 233252)
+++ hdaa.c      (working copy)
@@ -646,10 +646,8 @@
                        continue;
                hdaa_eld_handler(w);
        }
-       if (poll) {
-               callout_reset(&devinfo->poll_jack, 1,
-                   hdaa_jack_poll_callback, devinfo);
-       }
+       callout_reset(&devinfo->poll_jack, 1,
+           hdaa_jack_poll_callback, devinfo);
 }
 
 static void


>Release-Note:
>Audit-Trail:
>Unformatted:
_______________________________________________
freebsd-bugs@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-bugs
To unsubscribe, send any mail to "freebsd-bugs-unsubscr...@freebsd.org"

Reply via email to