From: sashiko-bot@kernel.org
To: "Shahyan Soltani" <shahyan.soltani@amd.com>,
amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] Revert "drm/amdgpu: get rid of amdgpu_drm_ioctl"
Date: Thu, 03 Dec 2026 18:40:25 +0000 [thread overview]
Message-ID: <sashiko-outbox-248408@kernel.org> (raw)
In-Reply-To: <20261203175200.1774878-1-shahyan.soltani@amd.com>
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [High] drm/amdgpu: amdgpu_kms_compat_ioctl() breaks 32-bit x86
DRM_IOCTL_MODE_ADDFB2
- [Low] drm/amdgpu: Fixes tag cites non-ancestor commit 726d9fa92d8b
--
commit 3b9f83db39db8a3806aa0b6d95b926ad913db516
Author: Shahyan Soltani <shahyan.soltani@amd.com>
> Revert "drm/amdgpu: get rid of amdgpu_drm_ioctl"
>
> Commit 726d9fa92d8b ("drm/amdgpu: get rid of amdgpu_drm_ioctl") is
> broken as it forgot to account for non amdgpu IOCTLs that required the
> GPU to be active. Without the wrapper, these IOCTLs can no longer resume
> the device, so they can run while the GPU is suspended.
>
> Revert commit 726d9fa92d8b ("drm/amdgpu: get rid of amdgpu_drm_ioctl")
> to allow the GPU to resume on all IOCTLs.
>
> Fixes: 726d9fa92d8b ("drm/amdgpu: get rid of amdgpu_drm_ioctl")
> Signed-off-by: Shahyan Soltani <shahyan.soltani@amd.com>
> Acked-by: Christian König <christian.koenig@amd.com>
> Acked-by: Alex Deucher <alexander.deucher@amd.com>
[Severity: Low]
Commit 726d9fa92d8b ("drm/amdgpu: get rid of amdgpu_drm_ioctl") is not an
ancestor in this tree. Should the commit message and Fixes tag reference
the merged commit instead?
Fixes: 3d3140b5b0d0 ("drm/amdgpu: get rid of amdgpu_drm_ioctl")
[ ... ]
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ioc32.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ioc32.c
> new file mode 100644
> index 0000000000000..a1cbd7c3deb2c
> --- /dev/null
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ioc32.c
[ ... ]
> +long amdgpu_kms_compat_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
> +{
> + unsigned int nr = DRM_IOCTL_NR(cmd);
> +
> + if (nr < DRM_COMMAND_BASE)
> + return drm_compat_ioctl(filp, cmd, arg);
> +
> + return amdgpu_drm_ioctl(filp, cmd, arg);
> +}
[Severity: High]
Does this break 32-bit x86 DRM_IOCTL_MODE_ADDFB2 by bypassing
drm_compat_ioctl()?
Core DRM KMS ioctls resume at DRM_COMMAND_END (0xa0), including
DRM_IOCTL_MODE_ADDFB2 (0xb8). Since only nr < DRM_COMMAND_BASE (0x40)
goes to drm_compat_ioctl(), DRM_IOCTL_MODE_ADDFB2 goes through
amdgpu_drm_ioctl() -> drm_ioctl(), skipping compat_drm_mode_addfb2().
On x86_64, struct drm_mode_fb_cmd2 has 4 bytes of padding between offsets[4]
and modifier[4] that 32-bit x86 omits. Copying the 32-bit struct directly
shifts all four modifier[] entries by 4 bytes, corrupting framebuffer
modifiers when a 32-bit x86 client uses DRM_MODE_FB_MODIFIERS.
Since amdgpu has no driver-private compat ioctl handlers, wrapping
drm_compat_ioctl() directly with runtime PM handling would avoid bypassing
compat_drm_mode_addfb2().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203175200.1774878-1-shahyan.soltani@amd.com?part=1
prev parent reply other threads:[~2026-12-03 18:40 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-03 17:51 [PATCH 1/2] Revert "drm/amdgpu: get rid of amdgpu_drm_ioctl" Shahyan Soltani
2026-12-03 17:52 ` [PATCH 2/2] drm/amdgpu: implement IOCTL specific skip resume list Shahyan Soltani
2026-12-03 18:09 ` Alex Deucher
2026-12-03 19:05 ` sashiko-bot
2026-12-03 18:40 ` sashiko-bot [this message]
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=sashiko-outbox-248408@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=amd-gfx@lists.freedesktop.org \
--cc=sashiko-reviews@lists.linux.dev \
--cc=shahyan.soltani@amd.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox