From: sashiko-bot@kernel.org
To: "Andre Eikmeyer" <dev@deq.rocks>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 2/3] drm/amdgpu: add Apple GMUX runtime PM support
Date: Wed, 12 Aug 2026 12:48:34 +0000 [thread overview]
Message-ID: <20260812124836.27E471F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260812122206.193680-3-dev@deq.rocks>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] This problem wasn't introduced by this patch, but switch_power_state remains permanently stuck in DRM_SWITCH_POWER_CHANGING on suspend/resume failure.
--
--- Patch [2]: [PATCH 2/3] drm/amdgpu: add Apple GMUX runtime PM support ---
commit 2067ef2b3a267308c80f88d728f87fe7fad945a3
Author: Andre Eikmeyer <dev@deq.rocks>
drm/amdgpu: add Apple GMUX runtime PM support
The MacBookPro15,1 uses Apple GMUX to control power to the discrete GPU,
but it does not expose the ATPX or ACPI power-resource interfaces currently
recognized by amdgpu. The driver therefore leaves runtime PM disabled even
though vga_switcheroo can switch the GPU reliably.
[ ... ]
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> index 0ab380ca7e645..a231a002831bb 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
[ ... ]
> @@ -2872,7 +2875,8 @@ static int amdgpu_pmops_runtime_suspend(struct device *dev)
> }
>
> adev->in_runpm = true;
> - if (adev->pm.rpm_mode == AMDGPU_RUNPM_PX)
> + if (adev->pm.rpm_mode == AMDGPU_RUNPM_PX ||
> + adev->pm.rpm_mode == AMDGPU_RUNPM_GMUX)
> drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
[Severity: High]
This is a pre-existing issue, but I noticed that switch_power_state can be
left permanently stuck in DRM_SWITCH_POWER_CHANGING if a failure occurs here.
Looking at amdgpu_pmops_runtime_suspend(), if amdgpu_device_suspend() fails,
it returns early:
ret = amdgpu_device_suspend(drm_dev, false);
if (ret) {
adev->in_runpm = false;
if (adev->pm.rpm_mode == AMDGPU_RUNPM_BOCO)
adev->mp1_state = PP_MP1_STATE_NONE;
return ret;
}
Because switch_power_state is never reset on this error path, drm_open()
will explicitly reject new opens by returning -EINVAL. Does this mean a
failed runtime suspend renders the GPU completely unusable for new clients
until reboot?
[ ... ]
> @@ -2947,10 +2952,11 @@ static int amdgpu_pmops_runtime_resume(struct device *dev)
> if (!pci_device_is_present(adev->pdev))
> adev->no_hw_access = true;
>
> - if (adev->pm.rpm_mode == AMDGPU_RUNPM_PX) {
> + if (adev->pm.rpm_mode == AMDGPU_RUNPM_PX ||
> + adev->pm.rpm_mode == AMDGPU_RUNPM_GMUX) {
> drm_dev->switch_power_state = DRM_SWITCH_POWER_CHANGING;
[Severity: High]
This is also a pre-existing issue, but the same state machine corruption can
occur during resume.
If either pci_enable_device() or amdgpu_device_resume() fails, the function
returns without resetting switch_power_state from DRM_SWITCH_POWER_CHANGING:
ret = amdgpu_device_resume(drm_dev, false);
if (ret) {
if (adev->pm.rpm_mode == AMDGPU_RUNPM_PX ||
adev->pm.rpm_mode == AMDGPU_RUNPM_GMUX)
pci_disable_device(pdev);
return ret;
}
Would it be safer to restore switch_power_state on these error paths so
that the state isn't permanently stuck?
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260812122206.193680-1-dev@deq.rocks?part=2
next prev parent reply other threads:[~2026-08-12 12:48 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 [this message]
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
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=20260812124836.27E471F000E9@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.