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 7891FFBF0; Tue, 26 Aug 2025 13:07:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756213628; cv=none; b=Ako9a7LLEkGb6P6y+eldPLSJ4U98cl3edBWqAKbKpa2rIrVmY6X2DfIB2O8gMrxpNksiRwSh8ExCd0M75MxcXzJXOCb/Y2fhCjKnOsnvIItlO14raQ1duzzPviGxn2Zt8QJnG7LMViYHKQCtKu7r5pIA7t2gfagATi2BI5Vos3g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1756213628; c=relaxed/simple; bh=td6JmsAdU37t+dui/Vq8yn6Sfdy0pFpfm/qc1G3zyDA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=gQSK3N7G+I0h99H+sTxicNSUPOb98n89ITSChcobpUiNDNW9/o8Xoh8W9dpFACOI1xh2Rej0K8KOQ1RwEsIslw/fzQzPZHkO1mMfCR64U75iKMkRbTJR0kTw3s99Oze6DJsvM1+r7nxY71dm6h1h1X6ULJm+mJWY9zLkAPDgLzw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=JPDXAB+H; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="JPDXAB+H" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 07DCAC4CEF1; Tue, 26 Aug 2025 13:07:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1756213628; bh=td6JmsAdU37t+dui/Vq8yn6Sfdy0pFpfm/qc1G3zyDA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JPDXAB+HrPPlTloZoKYiBLbMxoyaSIOQOqYuca0GvdMCZ3dhWwqW8PucyYajWTIjD rCYiwBTFjHbB5RVUHL8xaaqGUguuIP0YaqCq79HBfXXZQLZcYgYgbiMVMvxQ3y3u07 6ZVNnAj910Wtw9DZlk2sUjMXvsKdrMUPrBCrTt28= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Amber Lin , Eric Huang , Alex Deucher Subject: [PATCH 6.6 420/587] drm/amdkfd: Destroy KFD debugfs after destroy KFD wq Date: Tue, 26 Aug 2025 13:09:29 +0200 Message-ID: <20250826111003.622861475@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250826110952.942403671@linuxfoundation.org> References: <20250826110952.942403671@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Amber Lin commit 2e58401a24e7b2d4ec619104e1a76590c1284a4c upstream. Since KFD proc content was moved to kernel debugfs, we can't destroy KFD debugfs before kfd_process_destroy_wq. Move kfd_process_destroy_wq prior to kfd_debugfs_fini to fix a kernel NULL pointer problem. It happens when /sys/kernel/debug/kfd was already destroyed in kfd_debugfs_fini but kfd_process_destroy_wq calls kfd_debugfs_remove_process. This line debugfs_remove_recursive(entry->proc_dentry); tries to remove /sys/kernel/debug/kfd/proc/ while /sys/kernel/debug/kfd is already gone. It hangs the kernel by kernel NULL pointer. Signed-off-by: Amber Lin Reviewed-by: Eric Huang Signed-off-by: Alex Deucher (cherry picked from commit 0333052d90683d88531558dcfdbf2525cc37c233) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/amd/amdkfd/kfd_module.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/gpu/drm/amd/amdkfd/kfd_module.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_module.c @@ -78,8 +78,8 @@ err_ioctl: static void kfd_exit(void) { kfd_cleanup_processes(); - kfd_debugfs_fini(); kfd_process_destroy_wq(); + kfd_debugfs_fini(); kfd_procfs_shutdown(); kfd_topology_shutdown(); kfd_chardev_exit();