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 9549A139579; Tue, 27 May 2025 17:10:20 +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=1748365821; cv=none; b=dwxo57sCkdag867qwFiN6AjmtkIzgYKo4n+/gG7ZRcV4m3Rj4qs0OOkjLsnTMWSzuEyqIqxXmyfr3gpk7RHTn13tcsnB2BBjfGp87x+j5lXnNV/QuNQ8taN9oN46BIEeEULe3Tj3sSzojMdzzfHiNwxOmKgokKCym9Ag5d+CqCs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748365821; c=relaxed/simple; bh=2QkwzVGv978aGxmZalp4xiT6uGB4vCEGfMlZfspTkvI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Axakp8RsVbSwDOy7qFlMLm5Jso/ufdr0WgR2rOySjOINBg5tKDw9QyPPek2rO79uwJYTcmiSfkebWlv23m4D6oiiMw7WtYF/94F5bYrSloYroHs/AsaZ1kH3e2SPURZDHRZkfzUn3fB0QfhgUx4wPRUbNGMm9RMeiUCnhlXsP8o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yl7p9rUX; 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="yl7p9rUX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 863DDC4CEEB; Tue, 27 May 2025 17:10:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748365819; bh=2QkwzVGv978aGxmZalp4xiT6uGB4vCEGfMlZfspTkvI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yl7p9rUXt54IDLR3fUgHgvF/3oFiW8g+ACm0YIArMk+AVhILaFoAfbxq48ElX5v8V VX5SZ+ElGCRb3st42bxtsZ0CApa27WTbMzQAf6g253hvKEHoM0PwlzhsfRN4cWUBi/ OdubjZN/Zbq2dZFdA3vfbTsyhXPi6WRb16F1PRso= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Michal Wajdeczko , Matthew Brost , Sasha Levin Subject: [PATCH 6.12 499/626] drm/xe/sa: Always call drm_suballoc_manager_fini() Date: Tue, 27 May 2025 18:26:32 +0200 Message-ID: <20250527162505.249456488@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250527162445.028718347@linuxfoundation.org> References: <20250527162445.028718347@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.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Michal Wajdeczko [ Upstream commit 9cd3f4efc870463f17f6c29114c61fb6bfcaa291 ] After successful call to drm_suballoc_manager_init() we should make sure to call drm_suballoc_manager_fini() as it may include some cleanup code even if we didn't start using it for real. As we can abort init() early due to kvzalloc() failure, we should either explicitly call drm_suballoc_manager_fini() or, even better, postpone drm_suballoc_manager_init() once we finish all other preparation steps, so we can rely on fini() that will do cleanup. Signed-off-by: Michal Wajdeczko Cc: Matthew Brost Reviewed-by: Matthew Brost Link: https://patchwork.freedesktop.org/patch/msgid/20241220194205.995-2-michal.wajdeczko@intel.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/xe/xe_sa.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/gpu/drm/xe/xe_sa.c b/drivers/gpu/drm/xe/xe_sa.c index fe2cb2a96f788..1d42547590067 100644 --- a/drivers/gpu/drm/xe/xe_sa.c +++ b/drivers/gpu/drm/xe/xe_sa.c @@ -57,8 +57,6 @@ struct xe_sa_manager *xe_sa_bo_manager_init(struct xe_tile *tile, u32 size, u32 } sa_manager->bo = bo; sa_manager->is_iomem = bo->vmap.is_iomem; - - drm_suballoc_manager_init(&sa_manager->base, managed_size, align); sa_manager->gpu_addr = xe_bo_ggtt_addr(bo); if (bo->vmap.is_iomem) { @@ -72,6 +70,7 @@ struct xe_sa_manager *xe_sa_bo_manager_init(struct xe_tile *tile, u32 size, u32 memset(sa_manager->cpu_ptr, 0, bo->ttm.base.size); } + drm_suballoc_manager_init(&sa_manager->base, managed_size, align); ret = drmm_add_action_or_reset(&xe->drm, xe_sa_bo_manager_fini, sa_manager); if (ret) -- 2.39.5