From: Koen Koning <koen.koning@linux.intel.com>
To: dri-devel@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org,
Joel Fernandes <joelagnelf@nvidia.com>,
Matthew Auld <matthew.auld@intel.com>,
Danilo Krummrich <dakr@kernel.org>,
Koen Koning <koen.koning@linux.intel.com>
Subject: [PATCH v3 0/3] gpu: fix module_init() usage
Date: Thu, 19 Feb 2026 22:38:55 +0100 [thread overview]
Message-ID: <20260219213858.370675-1-koen.koning@linux.intel.com> (raw)
In-Reply-To: <20260216111902.110286-1-koen.koning@linux.intel.com>
This series fixes several uses of module_init() for subsystem-level code
that can be used by other drivers, and thus must be initialized first.
While this is not a problem for modules, for built-in drivers
module_init() compiles down to a device_initcall(). Between these, the
initialization order depends on the linking order in the Makefiles, but
this behavior should not be depended on.
This series is the result of recent regressions, where moving buddy from
drm to gpu accidentally changed the Makefile linking order, causing NULL
pointer dereferences in drm drivers.
Replacing module_init() with subsys_initcall() resolves these potential
issues for built-ins, while keeping the behavior the same for modules.
While the fixes can be backported, there have never been reports of
issues besides regressions due to refactoring of code. In particular,
the drm_drv module_init() usage predates the git history.
v2->v3: https://lore.kernel.org/dri-devel/20260216111902.110286-1-koen.koning@linux.intel.com/
- add patches for other uses of module_init() (drm_dev and drm/sched)
- reword gpu/buddy commit message
v1->v2:
- use subsys_initcall instead of relying on (fragile) Makefile ordering
Koen Koning (3):
gpu/buddy: fix module_init() usage
drm/sched: fix module_init() usage
drm/drv: fix module_init() usage
drivers/gpu/buddy.c | 2 +-
drivers/gpu/drm/drm_drv.c | 2 +-
drivers/gpu/drm/scheduler/sched_fence.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)
--
2.48.1
next prev parent reply other threads:[~2026-02-19 21:39 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-13 15:20 [PATCH] gpu: Fix uninitialized buddy for built-in drivers Koen Koning
2026-02-13 17:27 ` Joel Fernandes
2026-02-16 10:28 ` Matthew Auld
2026-02-22 20:25 ` Claude review: " Claude Code Review Bot
2026-02-22 20:25 ` Claude Code Review Bot
2026-02-16 11:19 ` [PATCH v2] " Koen Koning
2026-02-16 21:31 ` Joel Fernandes
2026-02-19 10:16 ` Danilo Krummrich
2026-02-19 10:38 ` Matthew Auld
2026-02-19 11:14 ` Danilo Krummrich
2026-02-19 12:44 ` Matthew Auld
2026-02-19 12:56 ` Danilo Krummrich
2026-02-19 15:32 ` Matthew Auld
2026-02-19 16:08 ` Danilo Krummrich
2026-02-19 18:28 ` Koen Koning
2026-02-19 18:34 ` Danilo Krummrich
2026-02-19 21:38 ` Koen Koning [this message]
2026-02-19 21:38 ` [PATCH v3 1/3] gpu/buddy: fix module_init() usage Koen Koning
2026-02-20 6:06 ` Greg KH
2026-02-20 10:17 ` Danilo Krummrich
2026-02-20 13:55 ` Joel Fernandes
2026-02-21 5:44 ` Greg KH
2026-02-19 21:38 ` [PATCH v3 2/3] drm/sched: " Koen Koning
2026-02-20 6:06 ` Greg KH
2026-02-19 21:38 ` [PATCH v3 3/3] drm/drv: " Koen Koning
2026-02-22 20:25 ` Claude review: gpu: " Claude Code Review Bot
2026-02-22 20:25 ` Claude review: gpu: Fix uninitialized buddy for built-in drivers Claude Code Review Bot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260219213858.370675-1-koen.koning@linux.intel.com \
--to=koen.koning@linux.intel.com \
--cc=dakr@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=joelagnelf@nvidia.com \
--cc=matthew.auld@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox