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 9C7AD33B6CC for ; Fri, 20 Feb 2026 10:17:12 +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=1771582632; cv=none; b=DuuZOxF2pU7sah0BDv03upvWw7k4/b85Aov6Va/ysN/BUCYDAZeNvVpTJoyGUpy0koY/staZCvnN5RxYwj8YFGC2QMEiMDsSokKYhDOio4qmwbj9U4Z2q+OceggYfExCUJsM9DIWSotgfEmcHo52hWblzVxTAuwntKMq+ToZ0jk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771582632; c=relaxed/simple; bh=p2k6pWtIsWSnFSLP2RBtbJq52aI2gnODo0HD/B9Bb7g=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=Wl4QOc/PpwrjEH+/z+Y6qRPbHVTsPE4ZTo8kxlCAF1BcvEiQ9I/ZmlU05EQVoLKwF1CNpEmBhWTI+aPRg8HfwDwEtLRB1Y6k0ooB3ks146VcPT7mlNAPOiQ8ynQAa4PEGsRlILAP9jDuJLeXoRL8OtTKZvHJQQ/nCZZM7Nx/pdQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=UyXJGIe4; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="UyXJGIe4" Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA55BC116D0; Fri, 20 Feb 2026 10:17:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771582632; bh=p2k6pWtIsWSnFSLP2RBtbJq52aI2gnODo0HD/B9Bb7g=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=UyXJGIe40+t97tpN8dEFOyel8KT9L8bnqZjxeRmLJcZxGelI+4DUEZCCPzHhqU3+Y D5WXu3XzhN9cdfI+fZi9hx5lJP/pT39mneYuG126DBQkFcCdbMDDTPHf4gbHNeI9Wd nY/h4GBHFQmO+lz0NlhqYAuYLOYctlpzcZYdAPJDZs1+BQJQ1SOVtRW5VHXj+T5vLg hpTsnGKtgpQGEwWj2CoXh2SxV04ycrQwyjH21V3nnJjeOV8m+eEegml+j+0P6He0vE /XepDWtQDGkIzRE55lRzIziRavXK75hyzKdXWfVwjdUrjDJI8U3pRQK0Tn8SB7uc0n SI7YDWT4DodVg== Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 20 Feb 2026 11:17:09 +0100 Message-Id: Subject: Re: [PATCH v3 1/3] gpu/buddy: fix module_init() usage Cc: "Koen Koning" , , , "Joel Fernandes" , "Matthew Auld" , "Dave Airlie" , "Peter Senna Tschudin" , To: "Greg KH" From: "Danilo Krummrich" References: <20260216111902.110286-1-koen.koning@linux.intel.com> <20260219213858.370675-1-koen.koning@linux.intel.com> <20260219213858.370675-2-koen.koning@linux.intel.com> <2026022016-creole-limpness-6ae7@gregkh> In-Reply-To: <2026022016-creole-limpness-6ae7@gregkh> On Fri Feb 20, 2026 at 7:06 AM CET, Greg KH wrote: > On Thu, Feb 19, 2026 at 10:38:56PM +0100, Koen Koning wrote: >> 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. > > Same here, Makefile order can always be relied on. I want to point out that Koen's original patch fixed the Makefile order: 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 b= e # taken to initialize them in the correct order. Link order is the only wa= y # to ensure this currently. +# Similarly, buddy must come first since it is used by other drivers. +obj-$(CONFIG_GPU_BUDDY) +=3D buddy.o obj-y +=3D host1x/ drm/ vga/ tests/ obj-$(CONFIG_IMX_IPUV3_CORE) +=3D ipu-v3/ obj-$(CONFIG_TRACE_GPU_MEM) +=3D trace/ obj-$(CONFIG_NOVA_CORE) +=3D nova-core/ -obj-$(CONFIG_GPU_BUDDY) +=3D buddy.o He was then suggested to not rely on this and rather use subsys_initcall(). When I then came across the new patch using subsys_initcall() I made it wor= se; I badly confused this with something else and gave a wrong advise -- sorry Ko= en! (Of course, since this is all within the same subsystem, without any extern= al ordering contraints, Makefile order is sufficient.)