From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (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 2FD932C1589 for ; Thu, 19 Feb 2026 21:39:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771537155; cv=none; b=Zla/LsX43eiC0C8NaX6kHQEdUYwDXclIW7eXK+aYcHi9Sm3V7xxC0aYgwUZa18nzMoASMVJ6XKvv60sMccUmK9ttteeZnPRanfFCG7Jxy8mvs3/lJbO8k894EPmo85grHCskL5ulxnwGw1TdLAGwBiAhhWJIohK5lC2U7ub8k9o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771537155; c=relaxed/simple; bh=wK+Scgt8j3rIrrQZOnPqpfwtY7Bs7Ykzl2GsolcF4pE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YD6xSCGJQTlgurFvkAsNtUoPBy6uEDk3+4QU8Nv3KGJY6/9jMC6CFUrNyV3UtLWo4cfnvfh2C/19CgFZj/q8dx07XIxmmfXASPynGGo28DdM1GSR48qrhN1n5AgOBcJwENjt2a0OL0pguX562fMzlPRQVo0eBtex+rBOAQ+PH7o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=KhKZbd6T; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="KhKZbd6T" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1771537154; x=1803073154; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wK+Scgt8j3rIrrQZOnPqpfwtY7Bs7Ykzl2GsolcF4pE=; b=KhKZbd6T28p/prsJK4ngzzKBqco0cctdlqS2q3tiv8wW/63PkYciow2b xsJChUam98zjU9VD0SbzeLPLlxY6i/heILthQ6aXR8TQzBsi18TC2OC2E n4+sWDWscQ43G1BCL2JagU6vYO0oGcJF+UbNYMqF1qxDW5FsBIp+iQ4uC 10685QsS8iRj3RtDHE5IqAgiHtf6kHgzYRV4x8SJAtDWGz3/if4ZE6agy 4XbufDG7gmBwPdewX/Q547lrOa6cJy/cdpvVgqmSB9+FrGjKqzOVVnPL4 xmzF7Z6rpl4vlvrfiOCYbG8ZHvbywaSslKYzkcSjWg6Kdx224ETT0pbb+ Q==; X-CSE-ConnectionGUID: e6FIot1yRR+TIwC0+UeeuQ== X-CSE-MsgGUID: NJX2x4zlQ9+tBfetZGlyzA== X-IronPort-AV: E=McAfee;i="6800,10657,11706"; a="90044686" X-IronPort-AV: E=Sophos;i="6.21,300,1763452800"; d="scan'208";a="90044686" Received: from fmviesa009.fm.intel.com ([10.60.135.149]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Feb 2026 13:39:13 -0800 X-CSE-ConnectionGUID: gtHPjQtoSJa3b1uR+5so7A== X-CSE-MsgGUID: 61cknzkbQLKQNQi5iZHX6Q== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.21,300,1763452800"; d="scan'208";a="212526345" Received: from vpanait-mobl.ger.corp.intel.com (HELO kkoning-desktop.intel.com) ([10.245.244.197]) by fmviesa009-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Feb 2026 13:39:10 -0800 From: Koen Koning To: dri-devel@lists.freedesktop.org Cc: intel-xe@lists.freedesktop.org, Joel Fernandes , Matthew Auld , Danilo Krummrich , Koen Koning , Dave Airlie , Peter Senna Tschudin , stable@vger.kernel.org Subject: [PATCH v3 1/3] gpu/buddy: fix module_init() usage Date: Thu, 19 Feb 2026 22:38:56 +0100 Message-ID: <20260219213858.370675-2-koen.koning@linux.intel.com> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20260219213858.370675-1-koen.koning@linux.intel.com> References: <20260216111902.110286-1-koen.koning@linux.intel.com> <20260219213858.370675-1-koen.koning@linux.intel.com> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use subsys_initcall() instead of module_init() (which compiles to device_initcall() for built-ins) for buddy, so its initialization code always runs before any (built-in) drivers. This happened to work correctly so far due to the order of linking in the Makefiles, but this should not be relied upon. An incorrect initialization order could lead to built-in drivers that use the buddy allocator to run into NULL pointer dereferences due to slab_blocks being uninitialized. Fixes: 6387a3c4b0c4 ("drm: move the buddy allocator from i915 into common drm") Fixes: ba110db8e1bc ("gpu: Move DRM buddy allocator one level up (part two)") Cc: Joel Fernandes Cc: Dave Airlie Cc: Matthew Auld Cc: Peter Senna Tschudin Cc: intel-xe@lists.freedesktop.org Cc: stable@vger.kernel.org Reviewed-by: Joel Fernandes Signed-off-by: Koen Koning --- drivers/gpu/buddy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/buddy.c b/drivers/gpu/buddy.c index 603c59a2013a..81f57fdf913b 100644 --- a/drivers/gpu/buddy.c +++ b/drivers/gpu/buddy.c @@ -1315,7 +1315,7 @@ static int __init gpu_buddy_module_init(void) return 0; } -module_init(gpu_buddy_module_init); +subsys_initcall(gpu_buddy_module_init); module_exit(gpu_buddy_module_exit); MODULE_DESCRIPTION("GPU Buddy Allocator"); -- 2.48.1