Date: Sun, 25 Mar 2012 02:28:05 GMT From: Brandon Gooch <jamesbrandongooch@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: kern/166382: [patch] snd_hda(4) is in a bad state after suspend/resume cycle Message-ID: <201203250228.q2P2S5Jp023299@red.freebsd.org> Resent-Message-ID: <201203250230.q2P2UA2s035182@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>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:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203250228.q2P2S5Jp023299>