From nobody Sun May 18 13:39:58 2025 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4b0hl24THPz5wFMX; Sun, 18 May 2025 13:39:58 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R11" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4b0hl21mb0z3d5j; Sun, 18 May 2025 13:39:58 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747575598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H/dVyd154gSHoOQoS1X0+cEVGI/GsN3ICL0gFp5PToM=; b=vFH1ViedEQRySwoqykeAsgmtUCaWnkNyVFwsI3QQf1UR579OtTF93tNfJqELM1bnWM5lIJ gnf/PtXjlWFfpwj4tuEj2AcredMiSoMSb2KO18rL9TuLDzHEBQVjkdUpHPzdyhgrj5ecd6 jG61xnqqPd4AF6ZjoGUFlCvj1TF1eNHNe3B4oyyfftXOnxT7kqqD/qcCLkHW+vl3mMH4JQ gcD9dphcXx0uSGhiNdQ1jvEtCzWC/eZkJ5QVG6x2UYgn+c28A1yz52GZhjr6wWRGDK6WFM 23iJKFFImkjPRdnKtDwuGjWbWWb8T0gRBLpXj8+Qtt69UADRnqV+MWLu4jDlsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747575598; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=H/dVyd154gSHoOQoS1X0+cEVGI/GsN3ICL0gFp5PToM=; b=RE+DHf5SB6WifD4G0aQ07Jl7ohYmrjvwJuLEYjeK44qTAKC5ay0kHzsLuAW/vPfzTPxfIF r7erDwp65rbJbEI1IB3dhRuELptqhBKToOy3U+RKBaH8UqMuTE/SGgNx4G5IXdNcDlAYGH B6GnZgxtWmjyJ8LoVp0Xj9rxB8cXI/GAwkf+wg2Eqsz9QVnormQ/Ltsu9Th6GjUD9mmX1H PvdpbFO/SKv//98IzgVqg5BK5TeQTgTkxY7Usu8bC3HKy3sCrxCEZfLZvSaYjnkPiyAcVO MJNYwS/WiXtuyNYgqBv9497KtRZWk4Q6M1D+ijY2cI61dUwmFJoBodhq5vv/SA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747575598; a=rsa-sha256; cv=none; b=xVxH3M7Eio8RTRvDc+CnQOu1+1TBqCfPN+C3vS1jz8w+Bw1cw0xbuY2Cli1MiCQ4hHIK56 XYMfyJ13RZEwDZ/8FhT548T+mebeAorLGFHMnIqvtn89HpXG+ko7HyIMht6cjMMycok0Pp +gQei7nnSIAk1dJT8Eae9sod7BFchCy20uv6kWvBnKzTW+yJHKUGs6xb4Ohwv8WPw3guK2 NNalHAx6f8/dWghyihQOkAAcIGALpE3dM4fmeFQRv4E8ySic94AAIweLUUTRVBxscp5CMN +Q8DBQ05WKQGy7sR8yindhhxZnnoIuI3syzV8u8+h1N8d76At8B5dvuLfPzuQg== 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 4b0hl21Ld0z5RS; Sun, 18 May 2025 13:39:58 +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 54IDdwdn081575; Sun, 18 May 2025 13:39:58 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54IDdwQ5081573; Sun, 18 May 2025 13:39:58 GMT (envelope-from git) Date: Sun, 18 May 2025 13:39:58 GMT Message-Id: <202505181339.54IDdwQ5081573@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Tijl Coosemans Subject: git: d9900b9ea2b2 - main - snd_hda: Add shutdown method List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: tijl X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: d9900b9ea2b27f7a0c2eda97841b9499e02e3ea7 Auto-Submitted: auto-generated The branch main has been updated by tijl: URL: https://cgit.FreeBSD.org/src/commit/?id=d9900b9ea2b27f7a0c2eda97841b9499e02e3ea7 commit d9900b9ea2b27f7a0c2eda97841b9499e02e3ea7 Author: Tijl Coosemans AuthorDate: 2025-05-18 13:38:02 +0000 Commit: Tijl Coosemans CommitDate: 2025-05-18 13:38:02 +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 --- 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 602f5df93648..8714f615f846 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) * @@ -2148,6 +2177,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 */