From mboxrd@z Thu Jan 1 00:00:00 1970 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 1C9F0606A31A for ; Wed, 2 Dec 2026 09:42:08 +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=Yx4TVEHL Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7FB3310E504; Wed, 2 Dec 2026 09:42:02 +0000 (UTC) Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id DE3E010E49A; Wed, 2 Dec 2026 09:41:55 +0000 (UTC) Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) by sea.source.kernel.org (Postfix) with ESMTP id 85081419D7; Wed, 2 Dec 2026 09:41:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4B97F1F00897; Wed, 2 Dec 2026 09:41:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796204515; bh=1IB00x0WLPwopDQN+n58rHl7mhyq1VwCEosZiYI5Scw=; h=From:Subject:Reply-To:To:Cc:In-Reply-To:References:Date; b=Yx4TVEHLSOJ5EIttH9S7GY/iQIRyyZiuaTtchm/k5qHIFUyQpjfScZeFgFT2QQGyL WFfMWfhLLuYWpy+PdQjZcYwvQXbEQ6Dp3tRyu/UuB/174bxBVr8IvMyD+1KQB3za4k iuTTrTScWzLZjMVaoTyjqfjYLtGVvT/2S4RMS/hGVOR7IRH0wIk10u47SCAt7uoBTl dTlNni4+zRstBQaSzR+EnP+mXYRhJtHRdqR1WNfK4QhqXbfcNA1DoqEADj2EZKLlJO TioxCDfyUTsVLCuNbBTcgCp3DovrJ4RmLaDjvfKTd8yuyWUJpknm9D3ZY2P2+SJZ5M oNMZ7RbQwK1dg== Message-ID: From: sashiko-bot@kernel.org Subject: Re: [PATCH] drm/amdgpu/vpe: don't let the idle work gate VPE during suspend To: "Yu-Hsiang Tseng" , amd-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org In-Reply-To: <20261201090146.24296-1-asas1asas200@gmail.com> References: <20261201090146.24296-1-asas1asas200@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Date: Wed, 02 Dec 2026 09:41:54 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: sashiko-reviews@lists.linux.dev Sender: "dri-devel" 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=unavailable 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: missing reset-domain lock in media IP idle workers [1] -- commit a09c7e7c3fa4da197942c25c5f4fe4c66e24d21f Author: Yu-Hsiang Tseng drm/amdgpu/vpe: don't let the idle work gate VPE during suspend This commit cancels pending VPE idle work when ungating VPE and reschedules the idle work if a suspend is in progress so that VPE stays powered up until vpe_hw_fini() stops the ring. > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c b/drivers/gpu/drm/am= d/amdgpu/amdgpu_vpe.c > index f6adbc1906fde..235ceb62d5d69 100644 > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c > @@ -362,6 +362,10 @@ static void vpe_idle_work_handler(struct work_struct= *work) > if (fences) > goto reschedule; > =20 > + /* Suspend needs VPE to stay ungated until vpe_hw_fini() */ > + if (adev->in_suspend) > + goto reschedule; > + > if (vpe_need_dpm0_at_power_down(adev) && vpe_get_dpm_level(adev) !=3D 0) > goto reschedule; [Severity: High] This problem wasn't introduced by this patch, but can vpe_idle_work_handler= () and other media IP idle workers (such as vcn_v2_5_idle_work_handler()) race with an active GPU reset [1]? Unlike newer IP block idle handlers that serialize against GPU resets with down_read_trylock(&adev->reset_domain->sem), this handler calls amdgpu_device_ip_set_powergating_state() without taking the reset domain read lock: CPU0 CPU1 amdgpu_device_gpu_recover() down_write(&adev->reset_domain->sem) vpe_idle_work_handler() amdgpu_device_ip_set_powergating_state() <-- unsynchronized powergating access up_write(&adev->reset_domain->sem) Altering powergating state while a GPU reset is mid-flight can corrupt hardware register state and cause system lockups or crashes. [1] https://sashiko.dev/#/bug/linux-fa3dff9c-bfd3-4822-8c68-70af026e226f --=20 Sashiko AI review =C2=B7 https://sashiko.dev/#/patchset/20261201090146.2429= 6-1-asas1asas200@gmail.com?part=3D1