From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 14580C3601B for ; Thu, 3 Apr 2025 19:16:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7BE5310EAC5; Thu, 3 Apr 2025 19:16:18 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="u3dI9BFL"; dkim-atps=neutral Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by gabe.freedesktop.org (Postfix) with ESMTPS id C10C410EAC2; Thu, 3 Apr 2025 19:16:16 +0000 (UTC) Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 425015C026D; Thu, 3 Apr 2025 19:13:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AB1C3C4CEE3; Thu, 3 Apr 2025 19:16:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1743707776; bh=i6DETD1Avhc2RRSPj7UiOVAKtd4jihLU5CxouD+O6y8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u3dI9BFLZFFT84Yq63pJpLyLKw3tp6oaiGfF+dkQWvdQWt8zpD/1EhVc9AQzbKWeV yrq31bOrNCP7LBs+5PzhJzqmCXDE6PjEyV8/6hqZAHio1oheR+Q9Ley3Zy11pv6PVk 3YspXGYNy1WSPbxDKs3rK58vWNiAzWQuVSYEd0Y+E4FNpHHeCD2mdC67UxHMA0nzF2 TCJQ92yrGIEDl+053JByc7Re0C+UnRA6+4M7KxM3IdVv83GSOSxZId+F5Yq7/Jb0qT AVlfQ6M53Xf4N5ORkS+fh/ObmM6Vo7KAlTsiiBigcnGGD/QE6MQAipOA+9ySWLJWCG KV9mUiIo67RAg== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Philip Yang , Felix Kuehling , Alex Deucher , Sasha Levin , Felix.Kuehling@amd.com, christian.koenig@amd.com, airlied@gmail.com, simona@ffwll.ch, amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 6.13 20/37] drm/amdkfd: Fix pqm_destroy_queue race with GPU reset Date: Thu, 3 Apr 2025 15:14:56 -0400 Message-Id: <20250403191513.2680235-20-sashal@kernel.org> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250403191513.2680235-1-sashal@kernel.org> References: <20250403191513.2680235-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.13.9 Content-Transfer-Encoding: 8bit X-BeenThere: amd-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces@lists.freedesktop.org Sender: "amd-gfx" From: Philip Yang [ Upstream commit 7919b4cad5545ed93778f11881ceee72e4dbed66 ] If GPU in reset, destroy_queue return -EIO, pqm_destroy_queue should delete the queue from process_queue_list and free the resource. Signed-off-by: Philip Yang Reviewed-by: Felix Kuehling Signed-off-by: Alex Deucher Signed-off-by: Sasha Levin --- drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c index 1d538e874140c..6ca0efa2c3c97 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c @@ -529,7 +529,7 @@ int pqm_destroy_queue(struct process_queue_manager *pqm, unsigned int qid) pr_err("Pasid 0x%x destroy queue %d failed, ret %d\n", pqm->process->pasid, pqn->q->properties.queue_id, retval); - if (retval != -ETIME) + if (retval != -ETIME && retval != -EIO) goto err_destroy_queue; } kfd_procfs_del_queue(pqn->q); -- 2.39.5