media: intel/ipu7: psys: register bus before adding the psys device#87
Open
thadeuk wants to merge 1 commit into
Open
media: intel/ipu7: psys: register bus before adding the psys device#87thadeuk wants to merge 1 commit into
thadeuk wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
On kernel 7.1 the IPU7 camera is unusable in every capture application. The
intel-ipu7-psysdriver fails to probe:As a result
/dev/ipu7-psys0is never created and the userspace camera HAL cannot open the psys device.Cause
ipu-psys.cdeclares a custombus_type ipu7_psys_bus, assigns it to the psys device (psys->dev.bus = &ipu7_psys_bus) and callsdevice_register(), but never callsbus_register()for it. Kernels <= 7.0 tolerated adding a device to an unregistered bus; since 7.1bus_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 explicitmodule_init()/module_exit()hooks.Testing
Tested on Panther Lake (IPU7 / ov08x40, Dell XPS), kernel 7.1.3, out-of-tree DKMS build:
/dev/ipu7-psys0is created; kernel log showsIPU psys probe done.Fixes the camera regression reported in #79.