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 A02F5E7BD89 for ; Mon, 16 Feb 2026 10:28:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D00610E220; Mon, 16 Feb 2026 10:28:09 +0000 (UTC) Authentication-Results: gabe.freedesktop.org; dkim=pass (2048-bit key; unprotected) header.d=intel.com header.i=@intel.com header.b="BOjZpmUs"; dkim-atps=neutral Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) by gabe.freedesktop.org (Postfix) with ESMTPS id 25F3D10E220; Mon, 16 Feb 2026 10:28:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1771237688; x=1802773688; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=7BPZZX1a0vWZQpA3GDvT9q2vm3Wj7jWqIzohjFPB8GY=; b=BOjZpmUsWFq2HL2IOdeOl/aRezH0DprAsHFC8G7LLne0rT/4MfIsx8IZ JSmvgRv78doDy/1UwUWjMXRCgPdPRsJcwZYLKmcn0SABGlH86X0usdJ8h R9otNgOpxSlKQFEqBCxPmQhyvaMDqBgpU7O1Jh5kiJ6tRnMzCPKUtc2Gg TsiaofkDHjuHWvOU9Sf5ZAIAXAiYAoQHmWBGhem3EVbUAdXIClnTcLZyX JmsxtWYEHzXAdJ9lHJwZo6a72ismUV7WW0qPuRiaF0455hZ0M2QcAj3tb arvuz40M63FVkEUrJsZORiSEAA8zwXG5sEOBqs7h1mLj4Jh7yTrptHKtO A==; X-CSE-ConnectionGUID: kipuUDbhSY6jtH00INxGIg== X-CSE-MsgGUID: h+YmnerLRnuSWRa70n/2yA== X-IronPort-AV: E=McAfee;i="6800,10657,11702"; a="83753504" X-IronPort-AV: E=Sophos;i="6.21,294,1763452800"; d="scan'208";a="83753504" Received: from fmviesa010.fm.intel.com ([10.60.135.150]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2026 02:28:07 -0800 X-CSE-ConnectionGUID: fM0UaXf0T4iYKZv/TL1rfg== X-CSE-MsgGUID: lsR9qRCRSA6AMIDWmfVNtg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,294,1763452800"; d="scan'208";a="212563946" Received: from ijarvine-mobl1.ger.corp.intel.com (HELO [10.245.244.239]) ([10.245.244.239]) by fmviesa010-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2026 02:28:06 -0800 Message-ID: <9ed1ed4f-5942-4e59-ad68-c038cb83c755@intel.com> Date: Mon, 16 Feb 2026 10:28:03 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gpu: Fix uninitialized buddy for built-in drivers To: Joel Fernandes , Koen Koning , dri-devel@lists.freedesktop.org Cc: Dave Airlie , intel-xe@lists.freedesktop.org, Peter Senna Tschudin References: <20260213152047.179628-1-koen.koning@linux.intel.com> <77fc0550-cbb4-4796-85ea-c552e12125c1@nvidia.com> Content-Language: en-GB From: Matthew Auld In-Reply-To: <77fc0550-cbb4-4796-85ea-c552e12125c1@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 13/02/2026 17:27, Joel Fernandes wrote: > On 2/13/2026 10:20 AM, Koen Koning wrote: >> Move buddy to the start of the link order, so its __init runs before any >> other built-in drivers that may depend on it. Otherwise, a built-in >> driver that tries to use the buddy allocator will run into a kernel NULL >> pointer dereference because slab_blocks is uninitialized. >> >> Specifically, this fixes drm/xe (as built-in) running into a kernel >> panic during boot, because it uses buddy during device probe. >> >> Fixes: ba110db8e1bc ("gpu: Move DRM buddy allocator one level up (part two)") >> Cc: Joel Fernandes >> Cc: Dave Airlie >> Cc: intel-xe@lists.freedesktop.org >> Tested-by: Peter Senna Tschudin >> Signed-off-by: Koen Koning >> --- >> drivers/gpu/Makefile | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/Makefile b/drivers/gpu/Makefile >> index 5cd54d06e262..b4e5e338efa2 100644 >> --- a/drivers/gpu/Makefile >> +++ b/drivers/gpu/Makefile >> @@ -2,8 +2,9 @@ >> # drm/tegra depends on host1x, so if both drivers are built-in care must be >> # taken to initialize them in the correct order. Link order is the only way >> # to ensure this currently. >> +# Similarly, buddy must come first since it is used by other drivers. >> +obj-$(CONFIG_GPU_BUDDY) += buddy.o > > Rather than relying on fragile link ordering, would it be better to use an > earlier initcall level for the buddy allocator? Ok, makes sense. Should we go with something like subsys_initcall(gpu_buddy_module_init) here? > > Thanks, >