gpu: fix module_init() usage
Get series with b4
b4 am [email protected]Versions newest first
- v3 Latest3 patches 11 repliesIn review
v1->v2 from the cover letter
- use subsys_initcall instead of relying on (fragile) Makefile ordering
Patches in v3 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/3 | gpu/buddy: fix module_init() usagedrivers/ | +1 | 10 replies | |
| 2/3 | drm/sched: fix module_init() usagedrivers/ | +1 | 1 reply | |
| 3/3 | drm/drv: fix module_init() usagedrivers/ | +1 | 0 replies |
Reviews trailers per patch
1 of 3 patches has a Reviewed-by or Acked-by.
| Patch | Joel Fernandes |
|---|---|
| 1/3 | R-b |
| 2/3 | |
| 3/3 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v3 0/3] gpu: fix module_init() usage
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/[email protected]/
- 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