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 307BAC27C6E for ; Fri, 14 Jun 2024 19:40:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CC29610E28F; Fri, 14 Jun 2024 19:40:45 +0000 (UTC) Received: from a6498e030952 (emeril.freedesktop.org [131.252.210.167]) by gabe.freedesktop.org (Postfix) with ESMTPS id 88ACC10EE1B; Fri, 14 Jun 2024 19:40:43 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: =?utf-8?q?=E2=9C=93_CI=2Echeckpatch=3A_success_for_drm/xe=3A_Fix_missing_run?= =?utf-8?q?time_outer_protection_for_ggtt=5Fremove=5Fnode_=28rev7=29?= From: Patchwork To: "Rodrigo Vivi" Cc: intel-xe@lists.freedesktop.org Date: Fri, 14 Jun 2024 19:40:43 -0000 Message-ID: <171839404355.80883.7401801130894631374@a6498e030952> X-Patchwork-Hint: ignore References: <20240614183758.77736-1-rodrigo.vivi@intel.com> In-Reply-To: <20240614183758.77736-1-rodrigo.vivi@intel.com> X-BeenThere: intel-xe@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel Xe graphics driver List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: intel-xe@lists.freedesktop.org Errors-To: intel-xe-bounces@lists.freedesktop.org Sender: "Intel-xe" == Series Details == Series: drm/xe: Fix missing runtime outer protection for ggtt_remove_node (rev7) URL : https://patchwork.freedesktop.org/series/134308/ State : success == Summary == + KERNEL=/kernel + git clone https://gitlab.freedesktop.org/drm/maintainer-tools mt Cloning into 'mt'... warning: redirecting to https://gitlab.freedesktop.org/drm/maintainer-tools.git/ + git -C mt rev-list -n1 origin/master 51ce9f6cd981d42d7467409d7dbc559a450abc1e + cd /kernel + git config --global --add safe.directory /kernel + git log -n1 commit f41a27cddfca189a9fa203df1fe0133e5d95ef6a Author: Rodrigo Vivi Date: Fri Jun 14 14:37:58 2024 -0400 drm/xe: Fix missing runtime outer protection for ggtt_remove_node Defer the ggtt node removal to a thread if runtime_pm is not active. The ggtt node removal can be called from multiple places, including places where we cannot protect with outer callers and places we are within other locks. So, try to grab the runtime reference if the device is already active, otherwise defer the removal to a separate thread from where we are sure we can wake the device up. v2: - use xe wq instead of system wq (Matt and CI) - Avoid GFP_KERNEL to be future proof since this removal can be called from outside our drivers and we don't want to block if atomic is needed. (Brost) v3: amend forgot chunk declaring xe_device. v4: Use a xe_ggtt_region to encapsulate the node and remova info, wihtout the need for any memory allocation at runtime. v5: Actually fill the delayed_removal.invalidate (Brost) v6: - Ensure that ggtt_region is not freed before work finishes (Auld) - Own wq to ensures that the queued works are flushed before ggtt_fini (Brost) v7: also free ggtt_region on early !bound return (Auld) Cc: Matthew Auld Cc: Paulo Zanoni Cc: Francois Dugast Cc: Thomas Hellström Cc: Matthew Brost Reviewed-by: Matthew Brost Signed-off-by: Rodrigo Vivi + /mt/dim checkpatch 5c623c9712af3170cc9782a10ed7360ddf8f8bb4 drm-intel f41a27cddfca drm/xe: Fix missing runtime outer protection for ggtt_remove_node