From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 75F331F942 for ; Fri, 21 Jul 2023 16:21:27 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9B86C433C8; Fri, 21 Jul 2023 16:21:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1689956487; bh=e1Nd0MH6X738mCMr+jNFX9QCY51BwVRm2DayMYa6M4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=abGVu+T0TbikJLcheNNezaujBeNWCm5I2lt4kyafSl2ldYYBJLhu0yCDzcxrbCcCr hbLzkGlrA9jGrDGZw805sNpZvlQ8ecmRELCU3nBFaIFwTykfQUfE4qqxYaeOiMSOVz qAm0JUlndO5TB6VT53MY7sDJyaCTMzsa9aTnXnNk= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, gaba , Felix Kuehling , Alex Deucher Subject: [PATCH 6.4 209/292] drm/amdgpu: avoid restore process run into dead loop. Date: Fri, 21 Jul 2023 18:05:18 +0200 Message-ID: <20230721160537.858521946@linuxfoundation.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230721160528.800311148@linuxfoundation.org> References: <20230721160528.800311148@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: gaba commit 8a774fe912ff09e39c2d3a3589c729330113f388 upstream. In restore process worker, pinned BO cause update PTE fail, then the function re-schedule the restore_work. This will generate dead loop. Signed-off-by: gaba Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c | 3 +++ 1 file changed, 3 insertions(+) --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd_gpuvm.c @@ -2792,6 +2792,9 @@ int amdgpu_amdkfd_gpuvm_restore_process_ if (!attachment->is_mapped) continue; + if (attachment->bo_va->base.bo->tbo.pin_count) + continue; + kfd_mem_dmaunmap_attachment(mem, attachment); ret = update_gpuvm_pte(mem, attachment, &sync_obj); if (ret) {