Skip to content

media: ipu7: register the psys bus before adding devices#89

Open
atisDu wants to merge 1 commit into
intel:mainfrom
atisDu:fix/psys-bus-register
Open

media: ipu7: register the psys bus before adding devices#89
atisDu wants to merge 1 commit into
intel:mainfrom
atisDu:fix/psys-bus-register

Conversation

@atisDu

@atisDu atisDu commented Jul 16, 2026

Copy link
Copy Markdown

Summary

ipu7_psys_bus (drivers/media/pci/intel/ipu7/psys/ipu-psys.c) is defined and assigned to psys->dev.bus in ipu7_psys_probe(), but is never passed to bus_register(). Calling device_register() on a device whose bus was never registered relies on kernel tolerance for that condition; newer kernels reject it outright:

bus_add_device: cannot add device 'ipu7-psys0' to unregistered bus 'intel-ipu7-psys'
intel-ipu7-psys ipu7-psys0: psys device_register failed
intel_ipu7_psys.psys intel_ipu7.psys.40: probe with driver intel_ipu7_psys.psys failed with error -22

This makes PSys probe fail entirely, so /dev/ipu7-psys0 is never created and any hardware-ISP pipeline (e.g. icamerasrc) fails with not-negotiated.

Reproduced on a ThinkPad X9-14 (Lunar Lake, IPU7) running CachyOS. PSys probed and streamed correctly on kernel 7.0.11 but started failing after upgrading to kernel 7.1.3 — no other driver, firmware, or config changes involved, so this looks like a kernel-side tightening of bus_add_device() behavior that exposed a pre-existing bug in this driver.

Fix

Replace the module_auxiliary_driver() convenience macro with explicit module_init/module_exit functions that bus_register(&ipu7_psys_bus) before registering the auxiliary driver, and unregister both in reverse order on exit.

Test plan

  • make LLVM=1 KERNELRELEASE=7.1.3-2-cachyos KERNEL_SRC=/lib/modules/7.1.3-2-cachyos/build builds cleanly
  • Installed via DKMS, reloaded intel_ipu7_psys/dev/ipu7-psys0 now appears
  • gst-launch-1.0 icamerasrc ! video/x-raw,format=NV12,width=1920,height=1080 ! fakesink negotiates caps and streams without error (previously failed with not-negotiated (-4))

ipu7_psys_bus is defined and assigned to psys->dev.bus, but is never
passed to bus_register(). device_register() on a device whose bus was
never registered depends on the kernel's tolerance for that condition;
newer kernels reject it outright with -EINVAL:

  bus_add_device: cannot add device 'ipu7-psys0' to unregistered bus 'intel-ipu7-psys'
  intel-ipu7-psys ipu7-psys0: psys device_register failed
  intel_ipu7_psys.psys intel_ipu7.psys.40: probe with driver intel_ipu7_psys.psys failed with error -22

which breaks PSys probe entirely and /dev/ipu7-psys0 is never created.
Reproduced on CachyOS kernel 7.1.3 (IPU7, ThinkPad X9-14/Lunar Lake);
the same tree still probed successfully on kernel 7.0.11.

Register ipu7_psys_bus in module init before registering the auxiliary
driver, and unregister both in reverse order on exit.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant