Skip to content

media: intel/ipu7: psys: register bus before adding the psys device - #87

Open
thadeuk wants to merge 1 commit into
intel:mainfrom
thadeuk:psys-register-bus
Open

media: intel/ipu7: psys: register bus before adding the psys device#87
thadeuk wants to merge 1 commit into
intel:mainfrom
thadeuk:psys-register-bus

Conversation

@thadeuk

@thadeuk thadeuk commented Jul 9, 2026

Copy link
Copy Markdown

Problem

On kernel 7.1 the IPU7 camera is unusable in every capture application. The intel-ipu7-psys driver fails to probe:

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

As a result /dev/ipu7-psys0 is never created and the userspace camera HAL cannot open the psys device.

Cause

ipu-psys.c declares a custom bus_type ipu7_psys_bus, assigns it to the psys device (psys->dev.bus = &ipu7_psys_bus) and calls device_register(), but never calls bus_register() for it. Kernels <= 7.0 tolerated adding a device to an unregistered bus; since 7.1 bus_add_device() rejects it.

Fix

Register the bus in module init before registering the auxiliary driver, and unregister it on exit, by replacing module_auxiliary_driver() with explicit module_init() / module_exit() hooks.

Testing

Tested on Panther Lake (IPU7 / ov08x40, Dell XPS), kernel 7.1.3, out-of-tree DKMS build:

  • /dev/ipu7-psys0 is created; kernel log shows IPU psys probe done.
  • Hardware-ISP capture works end to end (v4l2 + browser).
  • 0 psys HAL errors (previously every stream configuration failed).

Fixes the camera regression reported in #79.

The psys driver defines a custom "intel-ipu7-psys" bus_type, assigns it
to the psys device (psys->dev.bus = &ipu7_psys_bus) and then calls
device_register(), but it never calls bus_register() for that bus.

Older kernels tolerated registering a device on an unregistered bus, but
since Linux 7.1 bus_add_device() rejects it, so probe fails:

  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

As a result /dev/ipu7-psys0 is never created and the userspace camera
HAL cannot open the psys device, breaking the camera on IPU7 platforms
(e.g. Panther Lake with ov08x40) for every capture application.

Register the bus in module init before registering the auxiliary driver,
and unregister it on exit, by replacing module_auxiliary_driver() with
explicit module_init()/module_exit() hooks.

Link: intel#52
Link: intel#63
Link: intel#79
Signed-off-by: Thadeu Tucci <thadeutucci@gmail.com>
drzombey added a commit to drzombey/nix-dotfiles that referenced this pull request Aug 7, 2026
Portiert aus dem Omarchy-Paket intel-ipu7-camera. Drei Dinge fehlten,
die alle gleichzeitig stimmen muessen:

1. PSYS, also die Hardware-ISP. Der Kernel bringt in staging nur ISYS
   mit, das rohes Bayer liefert. Der out-of-tree-Treiber hat PSYS, aber
   registriert seinen Bus nicht - seit Linux 7.1 lehnt bus_add_device()
   das ab, das Probe scheitert mit -22 und /dev/ipu7-psys0 entsteht nie.
   Dafuer der Patch (upstream: intel/ipu7-drivers#87, noch offen).

2. Sensor-Stromversorgung. Auf PTL haengt der ov08x40 hinter usbio-i2c
   und wird ueber eine USBIO-GPIO versorgt, die die CVS-Firmware
   schaltet. Intels Default rgbcamera_pwrup_host=1 nimmt das Gegenteil
   an, der Sensor bleibt dunkel und I2C laeuft in -ETIMEDOUT.

3. Sensor-Erkennung. Ueber ipu_bridge traegt der Kernel bei PTL einen
   IVSC-Knoten (ACPI INTC10E1) zwischen Sensor und IPU in den
   fwnode-Graph ein. Ein v4l2-Subdevice dafuer registriert aber kein
   Treiber - intel_cvs macht nur Power und Ownership. Der Async-Notifier
   von ISYS wartet dann ewig und die HAL meldet "No sensors available".
   Deshalb BUILD_INTEL_IPU_ACPI=1: ISYS bekommt statische
   Plattformdaten und instanziiert den Sensor direkt.

Darueber der Userspace-Stack (camera-bins -> camera-hal fuer ipu75xa ->
icamerasrc) und v4l2-relayd, das das fertige Bild auf ein festes
/dev/video50 legt. Die 32 rohen ISYS-Nodes sind per udev und
WirePlumber ausgeblendet, damit Anwendungen nicht 32 tote Kameras
anbieten.

Sobald NixOS/nixpkgs#479283 gemergt ist, sollte hardware.ipu7.enable
das hier ersetzen koennen.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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