SXThgEd15SVnfByu2f3Tw3hpDnGogxw7tgC0KpRawZ3QpE bfiwnRk2nH3+znL/0uOONzDvtbL2LGhz7uA6RdYiHMmDvkxKwh0EhA2LLRVrjOdtIoAFGY ikAjEkEuouRc9M/muf5j4Q5FrNf8cxwp/z5x5RsP65QusxCjYOnehGl5ZhMNgmzzElapcf DQisSFDXzMIVtRlk3+Lx7XqiiDctlK8A0Hi+mTvab6+uKRf6Mx1iCA3q3R8dwzPq/0kXwY zSjVkoVbw4OB5qQM38ofYyVimS8xAHgIGzcaLiaPpmJ5BCVXHkaKCmIsZfIyaA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747856701; a=rsa-sha256; cv=none; b=tezgBst2Gl+qfIGX3BBCx9iliezvHf+5xmi8PE4AtwOss8hRJ03GvPJ3UlyyH8Ug4zfX+k V96jEp1yrsixPA85Ma8kMGgOV48JoxfSXqpRPRQ1F0lOde2gGm02flhsmGavdDp9KxR4pk 07tmSsYpdRX6+2kd70Tv3MkAp4y9wZGBDxk7QuU6ytlptJIn1yx+odsKHqV79KEjt2kn9v gsJ7u3q1rwnDqh3LF44UVS/odJg2FFpziu/Zh5rrnmCGwd59a/FYX+5KNBMo84vO4/aC23 1RrgCykbqeeQjAM8v5vmT3bbEFKvKLerPGpAbB+21er2i4QnoYvO+9tnAeOjZg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4b2hhs1s78znlX; Wed, 21 May 2025 19:45:01 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 54LJj1gh000611; Wed, 21 May 2025 19:45:01 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54LJj1ZK000608; Wed, 21 May 2025 19:45:01 GMT (envelope-from git) Date: Wed, 21 May 2025 19:45:01 GMT Message-Id: <202505211945.54LJj1ZK000608@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 77521692f4c7 - stable/14 - snd_hda: Add shutdown method List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 77521692f4c71213c5419268657e696532c28325 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=77521692f4c71213c5419268657e696532c28325 commit 77521692f4c71213c5419268657e696532c28325 Author: Tijl Coosemans AuthorDate: 2025-05-18 13:38:02 +0000 Commit: Christos Margiolis CommitDate: 2025-05-21 19:43:52 +0000 snd_hda: Add shutdown method Power down the device on shutdown similar to what is done in the case of suspend. The device may fail to attach on next boot without this. PR: 286385 Reviewed by: christos, adrian Differential Revision: https://reviews.freebsd.org/D50306 (cherry picked from commit d9900b9ea2b27f7a0c2eda97841b9499e02e3ea7) --- sys/dev/sound/pci/hda/hdac.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/sys/dev/sound/pci/hda/hdac.c b/sys/dev/sound/pci/hda/hdac.c index 9a7958449f91..be143ccd54c3 100644 --- a/sys/dev/sound/pci/hda/hdac.c +++ b/sys/dev/sound/pci/hda/hdac.c @@ -1638,6 +1638,35 @@ hdac_attach2(void *arg) sizeof(sc->dev), sysctl_hdac_polling, "I", "Enable polling mode"); } +/**************************************************************************** + * int hdac_shutdown(device_t) + * + * Power down HDA bus and codecs. + ****************************************************************************/ +static int +hdac_shutdown(device_t dev) +{ + struct hdac_softc *sc = device_get_softc(dev); + + HDA_BOOTHVERBOSE( + device_printf(dev, "Shutdown...\n"); + ); + callout_drain(&sc->poll_callout); + taskqueue_drain(taskqueue_thread, &sc->unsolq_task); + bus_generic_shutdown(dev); + + hdac_lock(sc); + HDA_BOOTHVERBOSE( + device_printf(dev, "Reset controller...\n"); + ); + hdac_reset(sc, false); + hdac_unlock(sc); + HDA_BOOTHVERBOSE( + device_printf(dev, "Shutdown done\n"); + ); + return (0); +} + /**************************************************************************** * int hdac_suspend(device_t) * @@ -2157,6 +2186,7 @@ static device_method_t hdac_methods[] = { DEVMETHOD(device_probe, hdac_probe), DEVMETHOD(device_attach, hdac_attach), DEVMETHOD(device_detach, hdac_detach), + DEVMETHOD(device_shutdown, hdac_shutdown), DEVMETHOD(device_suspend, hdac_suspend), DEVMETHOD(device_resume, hdac_resume), /* Bus interface */