Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BC33A606A322 for ; Thu, 3 Dec 2026 18:40:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=m4HBzGh9 Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5E4C510E154; Thu, 3 Dec 2026 18:40:32 +0000 (UTC) Received: from tor.source.kernel.org (tor.source.kernel.org [172.105.4.254]) by gabe.freedesktop.org (Postfix) with ESMTPS id BF68510E154 for ; Thu, 3 Dec 2026 18:40:26 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by tor.source.kernel.org (Postfix) with ESMTP id E77DF60D8E; Thu, 3 Dec 2026 18:40:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8D56E1F00893; Thu, 3 Dec 2026 18:40:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796323225; bh=cP1zqhJU1EBBqb14FuYNbY8jqTbn02wYmXboOylgWRU=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=m4HBzGh9fb6C/a0wMr8Ed1Lx4h5GzNej/E8gaYJV1Iv3ewgynbldfhlz2UNJwTZmE SI74JsNDlRlhNQrHFUiwi9W41cWY3Wu2UdWjmtPVmM/UR5ryZjNW+SPIxcKmDk3Nli FzbdV3iZ5AaSSCc/aN0bSQvtItj3CoeP3Csq/LkmggjMW3fk/uAjCteRmigP/9Aju+ Z3jxjlyj76dbCSxK6Lengo1izVyVHba6BUxE8GjmM3gi0sf4tqt7G9s1j/kycYjmEX r3Y+td/0mgvznbkBBmVghLYtyr2vYVbaIHXaeCFs10WbC1QNIsZoX4KlpEAVJ2ult6 CoHfnPiJP2L4Q== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 1/2] Revert "drm/amdgpu: get rid of amdgpu_drm_ioctl" To: "Shahyan Soltani" , amd-gfx@lists.freedesktop.org In-Reply-To: <20261203175200.1774878-1-shahyan.soltani@amd.com> References: <20261203175200.1774878-1-shahyan.soltani@amd.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Thu, 03 Dec 2026 18:40:25 +0000 X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "amd-gfx" X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 X-Archived-By: 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 > 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 > Acked-by: Christian K=C3=B6nig > Acked-by: Alex Deucher [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, unsign= ed long arg) > +{ > + unsigned int nr =3D 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(). --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261203175200.1774= 878-1-shahyan.soltani@amd.com?part=3D1