From: sashiko-bot@kernel.org
To: "Andre Eikmeyer" <dev@deq.rocks>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v2 3/3] ALSA: hda: allow direct complete with a powered-off GPU
Date: Wed, 12 Aug 2026 15:36:30 +0000 [thread overview]
Message-ID: <20260812153630.C882F1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812144221.35877-4-dev@deq.rocks>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] Returning 1 early from `azx_prepare()` for direct-complete skips essential system suspend preparation (`chip->pm_prepared = 1`, `snd_power_change_state()`, and `flush_work()`), breaking the fallback path if direct-complete is aborted.
--
--- Patch [3]: [PATCH v2 3/3] ALSA: hda: allow direct complete with a powered-off GPU ---
commit 512712a6e8db78ff16bf65eb2c4538a62401c892
Author: Andre Eikmeyer <dev@deq.rocks>
ALSA: hda: allow direct complete with a powered-off GPU
This commit allows direct complete for the HDA controller when a bound
GPU is powered off and unused. It checks the vga_switcheroo state and
runtime PM status to return 1 from azx_prepare() when appropriate.
> diff --git a/sound/hda/controllers/intel.c b/sound/hda/controllers/intel.c
> index 4b03c64e72ab4..6f1c1d596e2ca 100644
> --- a/sound/hda/controllers/intel.c
> +++ b/sound/hda/controllers/intel.c
[ ... ]
> @@ -1025,6 +1027,10 @@ static int azx_prepare(struct device *dev)
> return 0;
>
> chip = card->private_data;
> + /* A positive return allows the PM core to use direct complete. */
> + if (azx_vga_is_powered_off(chip))
> + return 1;
> +
[Severity: High]
By returning 1 early here in azx_prepare(), does this inadvertently skip
setting chip->pm_prepared = 1, calling snd_power_change_state(), and
flushing the asynchronous work queue?
If the PM core or PCI subsystem subsequently aborts direct-complete (for
instance, if device wakeups are enabled via sysfs or a child codec aborts
it), the fallback path will invoke azx_suspend() and azx_resume() on an
unprepared device.
Could this result in the ALSA card remaining in the D0 state instead of
D3hot, failing to block userspace hardware accesses during system suspend?
Furthermore, since flush_work(&azx_bus(chip)->unsol_work) is skipped, is
there a risk of a race between the asynchronous work queue and hardware
shutdown during azx_suspend()?
Finally, during system resume, if chip->pm_prepared remains 0, won't
__azx_runtime_resume() incorrectly request runtime resumes for codecs while
a system resume is still in progress?
> chip->pm_prepared = 1;
> snd_power_change_state(card, SNDRV_CTL_POWER_D3hot);
>
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260812144221.35877-1-dev@deq.rocks?part=3
next prev parent reply other threads:[~2026-08-12 15:36 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-12 12:22 [PATCH 0/3] Apple GMUX hybrid graphics support for MacBookPro15,1 Andre Eikmeyer
2026-08-12 12:22 ` [PATCH 1/3] platform/x86: apple-gmux: add MacBookPro15, 1 dGPU power sequence Andre Eikmeyer
2026-08-12 12:22 ` [PATCH 1/3] platform/x86: apple-gmux: add MacBookPro15,1 " Andre Eikmeyer
2026-08-12 12:38 ` [PATCH 1/3] platform/x86: apple-gmux: add MacBookPro15, 1 " sashiko-bot
2026-08-12 12:22 ` [PATCH 2/3] drm/amdgpu: add Apple GMUX runtime PM support Andre Eikmeyer
2026-08-12 12:48 ` sashiko-bot
2026-08-12 12:22 ` [PATCH 3/3] ALSA: hda: allow direct complete with a powered-off GPU Andre Eikmeyer
2026-08-12 13:01 ` sashiko-bot
2026-08-12 13:45 ` Takashi Iwai
2026-08-12 13:53 ` Takashi Iwai
2026-08-12 14:03 ` [PATCH v2 " Andre Eikmeyer
2026-08-12 14:23 ` [PATCH v3 " Andre Eikmeyer
2026-08-12 14:30 ` Takashi Iwai
2026-08-12 14:04 ` [PATCH " Christian König
2026-08-12 14:42 ` [PATCH v2 0/3] Apple GMUX hybrid graphics support for MacBookPro15,1 Andre Eikmeyer
2026-08-12 14:42 ` [PATCH v2 1/3] platform/x86: apple-gmux: add MacBookPro15,1 dGPU power sequence Andre Eikmeyer
2026-08-12 14:42 ` [PATCH v2 1/3] platform/x86: apple-gmux: add MacBookPro15, 1 " Andre Eikmeyer
2026-08-12 15:11 ` [PATCH v2 1/3] platform/x86: apple-gmux: add MacBookPro15,1 " sashiko-bot
2026-08-12 14:42 ` [PATCH v2 2/3] drm/amdgpu: add Apple GMUX runtime PM support Andre Eikmeyer
2026-08-12 15:24 ` sashiko-bot
2026-08-12 14:42 ` [PATCH v2 3/3] ALSA: hda: allow direct complete with a powered-off GPU Andre Eikmeyer
2026-08-12 15:36 ` sashiko-bot [this message]
2026-08-12 14:47 ` [PATCH v3 0/3] Apple GMUX hybrid graphics support for MacBookPro15,1 Andre Eikmeyer
2026-08-12 14:47 ` [PATCH v3 1/3] platform/x86: apple-gmux: add MacBookPro15, 1 dGPU power sequence Andre Eikmeyer
2026-08-12 14:47 ` [PATCH v3 1/3] platform/x86: apple-gmux: add MacBookPro15,1 " Andre Eikmeyer
2026-08-12 15:07 ` sashiko-bot
2026-08-12 14:47 ` [PATCH v3 2/3] drm/amdgpu: add Apple GMUX runtime PM support Andre Eikmeyer
2026-08-12 15:30 ` sashiko-bot
2026-08-12 14:47 ` [PATCH v3 3/3] ALSA: hda: allow direct complete with a powered-off GPU Andre Eikmeyer
2026-08-12 15:46 ` sashiko-bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260812153630.C882F1F000E9@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dev@deq.rocks \
--cc=dri-devel@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.