From nobody Wed May 21 23:22:47 2025 X-Original-To: dev-commits-src-all@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 4b2nX72xPpz5wgxb; Wed, 21 May 2025 23:22:47 +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 4b2nX72H3cz3Jf7; Wed, 21 May 2025 23:22:47 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747869767; 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=hmWpS6BRn/8mOiAmb//ixeis/88z/boIMJ3ULS/XrEs=; b=jEY2t2NB+6XTsXt2B18a2a9jT47SVtLlWw/k+Jws87DxK4bqF7LMgzEU5xm6MI8ugHzpjd dP8YChUlefSKYd6WRT6FrkZsKJnD7GolCjJvRahNr/ble+06ejqAvKCxwZUxTW9Qt8bgeo 4uvPHmZHst9IG8kaOxW3zGQs0xEaShLXn/4nPW4hdspwgAUq+AqzwTWMsh1cRArRYkvvf7 EPuSG4k+m3qBjPBR1SUbrFJMYE8ExWJrur4w7JxLuX1t8GJCWdKbRsW8qsebbIpmH3aC4U Lstmb35ou2G6pPQiOE5VniLsLcIsKoFWhtxPDwk3Mfl3xGNHrBKB/qnvx1Xoyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1747869767; 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=hmWpS6BRn/8mOiAmb//ixeis/88z/boIMJ3ULS/XrEs=; b=id+KWxFxiQ9WHHP+PKJma9UDuFJaKAlNlNh/dK+KXY+K1cxbW57Upmq6Ps61rSuU7Xn3+3 Ef3Ou9eEsyo1DoldrF1wdzC6oGbm8lzQvh8++KzOSMsOYOipaTE8B4A+QRybjLyV5yolQY z5D9t7LCF8cT+C1ZsunHbGsblWPDddN9fBDxLWOvWcMpyILAm6yiST/e3ic5Pmn4Zw0Vlz ZikoL3cM9nVp1JITP6yf4Es6F6D7+j+h4VOV5haUhEVUrH7r69SL6KktOA3o1xKoV43lLM lU/7TekV8Tx2j9Xr9GBgbuQnkZmFrncBAh041DDS5phBaSyhU/wBwyckQCTEAA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1747869767; a=rsa-sha256; cv=none; b=CRJakEhyR179I+WEXyHQ+riBSllECI7PbOEOInvr8al+KM1EpX7VUrmhdXdhmc9x5WDChG YKZcp8OQDEkf6R7Er5sGf0aGhBnx63bviofatbzD15lndRM26YYeeWZeemCxhdSyYH7TmG j7rfmO3VTs87YjePhcO2Q97oD6mPuwmqp9gzXEqJ7j2o6Mbyxzz4L5GPG6yWaaOjZ7msPX 0Xx+rToEelxgnAGdc9sa5Ca3aO1oAPLD54cLi2N8zUJRFVsO0BeglJoqokzIQhqdEM3LU8 6kf8bTjSIgmRYB6C4I0kBQj/p+gQU4ytb3fg4a+KmiDORyS7ZJ+FTs/2L+WCQg== 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 4b2nX71Msrzvbx; Wed, 21 May 2025 23:22:47 +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 54LNMlnF013612; Wed, 21 May 2025 23:22:47 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 54LNMlMH013609; Wed, 21 May 2025 23:22:47 GMT (envelope-from git) Date: Wed, 21 May 2025 23:22:47 GMT Message-Id: <202505212322.54LNMlMH013609@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: adf77cb48e4c - releng/14.3 - snd_hda: Add shutdown method List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@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/releng/14.3 X-Git-Reftype: branch X-Git-Commit: adf77cb48e4c265f366fb0f290b597fdd0dfdc68 Auto-Submitted: auto-generated The branch releng/14.3 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=adf77cb48e4c265f366fb0f290b597fdd0dfdc68 commit adf77cb48e4c265f366fb0f290b597fdd0dfdc68 Author: Tijl Coosemans AuthorDate: 2025-05-18 13:38:02 +0000 Commit: Christos Margiolis CommitDate: 2025-05-21 23:21:42 +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) (cherry picked from commit 77521692f4c71213c5419268657e696532c28325) Approved by: re (cperciva) --- 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 904e3b2001c7..25e320aae3dc 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) * @@ -2155,6 +2184,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 */