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 DF437606A31A for ; Tue, 1 Dec 2026 14:28:54 +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=hyfC023u Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8340D10F99A; Tue, 1 Dec 2026 14:28:49 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id DB11110F993 for ; Tue, 1 Dec 2026 14:28:42 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 956F943996; Tue, 1 Dec 2026 14:28:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 596AB1F00893; Tue, 1 Dec 2026 14:28:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796135322; bh=0GIGxwEHJ9+zawyYAlrw0M89vTIMrXFRCSHddkcR13E=; h=From:Subject:Reply-To:To:In-Reply-To:References:Date; b=hyfC023u/r1iPT/JwSUEZTPrapVTidfWuiQpbRmkd17Aiavc/+PozuXCOlZimPM+9 zquSzZLr55qkQXo46vRnboNLKlbzSlsG3p+DW8px1rGKjYzvDBhVNopcNPVqPUZO3z io+8bi07LiK9UzgN7Z5ruzN2+0qObxAlAC6t7O6ZFscC1VIYHihNJIfCtllGB6qTXs YJfsypjHwtdk6Oc1kKuu3A1tQk9Av5UyJU2bhcXD/+IL975+01FMM/MtpEzkw2sKXI I/XDAXV1uZwQK81XvqegyhxEu15LsVj1vEQK71WyDDuFT5F2r0I/cH7V8YPsESuAUS J1yZ2T5giLtDw== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH 1/3] drm/amdgpu: clear in_runpm when runtime suspend fails in prepare To: "James Zhu" , amd-gfx@lists.freedesktop.org In-Reply-To: <20261201141500.3346608-1-James.Zhu@amd.com> References: <20261201141500.3346608-1-James.Zhu@amd.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Tue, 01 Dec 2026 14:28:41 +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=-10.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, 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 no new issues in this patch, but noticed 1 related pre-existing issue it does not introduce: - [High] drm/amdgpu: uncleaned runpm state in amdgpu_pmops_runtime_suspend() [1] -- commit 3c42fe64301c37b90df126008a21b7d19c71b9fc Author: James Zhu drm/amdgpu: clear in_runpm when runtime suspend fails in prepare This commit routes amdgpu_device_prepare() failures in amdgpu_pmops_runtime_suspend() through the error cleanup block so that adev->in_runpm and adev->mp1_state are reset on failure. > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/am= d/amdgpu/amdgpu_drv.c > index d2db20c172c69..7bd53054ef6e7 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c > @@ -2907,9 +2907,8 @@ static int amdgpu_pmops_runtime_suspend(struct devi= ce *dev) > adev->mp1_state =3D PP_MP1_STATE_UNLOAD; > =20 > ret =3D amdgpu_device_prepare(drm_dev); > - if (ret) > - return ret; > - ret =3D amdgpu_device_suspend(drm_dev, false); > + if (!ret) > + ret =3D amdgpu_device_suspend(drm_dev, false); > if (ret) { > adev->in_runpm =3D false; > if (adev->pm.rpm_mode =3D=3D AMDGPU_RUNPM_BOCO) [Severity: High] This problem wasn't introduced by this patch, but on AMDGPU_RUNPM_PX systems does this error path [1] leave drm_dev->switch_power_state stuck at DRM_SWITCH_POWER_CHANGING when amdgpu_device_prepare() or amdgpu_device_suspend() fails? Earlier in amdgpu_pmops_runtime_suspend(): drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c:amdgpu_pmops_runtime_suspend() { ... adev->in_runpm =3D true; if (adev->pm.rpm_mode =3D=3D AMDGPU_RUNPM_PX) drm_dev->switch_power_state =3D DRM_SWITCH_POWER_CHANGING; ... } Because the failure cleanup does not restore drm_dev->switch_power_state to DRM_SWITCH_POWER_ON, drm_open_helper() will reject all subsequent DRM device opens with -EINVAL while the device remains active. [1] https://sashiko.dev/#/bug/linux-c9ddb109-ab18-4c50-8882-a9a764aa1bd4 --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201141500.3346= 608-1-James.Zhu@amd.com?part=3D1