Ipu7 psys register psys node before add device and debugfs - #90
Conversation
| struct dentry *file; | ||
| struct dentry *dir; | ||
|
|
||
| #if LINUX_VERSION_CODE < KERNEL_VERSION(6,17,0) |
There was a problem hiding this comment.
23: ERROR: space required after that ',' (ctx:VxV).
Space always after a comma. Space never before comma.
#if LINUX_VERSION_CODE < KERNEL_VERSION(6,17,0)
#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 17, 0)
| #if LINUX_VERSION_CODE < KERNEL_VERSION(6,17,0) | ||
| dir = debugfs_create_dir("psys", psys->adev->isp->ipu7_dir); | ||
| #else | ||
| dir = debugfs_create_dir("ipu7-psys",NULL); |
There was a problem hiding this comment.
26: ERROR: space required after that ',' (ctx:VxV)
Space always after a comma. Space never before comma.
dir = debugfs_create_dir("ipu7-psys",NULL);
dir = debugfs_create_dir("ipu7-psys", NULL);
manikx
left a comment
There was a problem hiding this comment.
Suggestion: Consider adding some description about the commit or add an empty line.
media:ipu7: register psys node before add device
Reordering bus and auxiliary driver registration as required by v7.1 code logic
Signed-off-by: Arun T <arun.t@intel.com>
Reordering bus and auxiliary driver registration as required by v7.1 code logic Signed-off-by: Arun T <arun.t@intel.com>
Signed-off-by: Arun T <arun.t@intel.com>
| int ret; | ||
|
|
||
| if (!adev->isp->ipu7_bus_ready_to_probe) | ||
| if (adev->isp->ipu7_bus_ready_to_probe) |
There was a problem hiding this comment.
I noticed that the ISYS driver handles ipu7_bus_ready_to_probe differently. Could you please explain the rationale behind inverting the condition here? I'm trying to understand the expected probe flow.
There was a problem hiding this comment.
@tripathidm , ipu7_bus_ready_to_probe flag is set by isys driver but in psys ipu7_bus_ready_to_probe =0 .
Core:
size=304
off=299
PSYS:
size=312
off=307
That means the external PSYS module is reading adev->isp->ipu7_bus_ready_to_probe at a different offset than the core driver writes it.
PSYS always sees always ready=0
Core writes one byte at offset 299
External PSYS reads one byte at offset 307
core says isp=... ready=0/1 based on its own layout
psys says isp=... ready=0 repeatedly from the same pointer
Error Logs
[ 6.145361] intel-ipu7 0000:00:05.0: Connected 1 cameras
[ 6.147989] intel-ipu7 0000:00:05.0: Sending BOOT_LOAD to CSE
[ 6.193508] intel-ipu7 0000:00:05.0: Sending AUTHENTICATE_RUN to CSE
[ 6.223534] intel-ipu7 0000:00:05.0: CSE authenticate_run done
[ 6.271545] intel_ipu7_isys: module is from the staging directory, the quality is unknown, you have been warned.
[ 6.284829] intel_ipu7_isys.isys intel_ipu7.isys.40: bind Intel CVS nlanes is 2 port is 0
[ 6.306327] intel_ipu7_psys: loading out-of-tree module taints kernel.
[ 6.384934] intel_ipu7_isys.isys intel_ipu7.isys.40: All sensor registration completed.
[ 18.069995] auxiliary intel_ipu7.psys.40: deferred probe pending: (reason unknown)
|
@tripathidm The external IPU7 PSYS module reads adev->isp->ipu7_bus_ready_to_probe struct ipu7_device currently places ipu7_dir under #ifdef CONFIG_DEBUG_FS Move the debugfs-only member ipu7_dir to the end of struct ipu7_device This fixes false PSYS defer where core reports bus ready while PSYS still |
The external IPU7 PSYS module reads adev->isp->ipu7_bus_ready_to_probe from struct ipu7_device shared with the core IPU7 driver. struct ipu7_device currently places ipu7_dir under #ifdef CONFIG_DEBUG_FS before hw_ver / ipc_reinit / secure_mode / ipu7_bus_ready_to_probe. When core and PSYS builds differ in CONFIG_DEBUG_FS, field offsets diverge, which can make PSYS observe an incorrect ipu7_bus_ready_to_probe value and remain in deferred probe. Move the debugfs-only member ipu7_dir to the end of struct ipu7_device so offsets of functional fields stay stable regardless of CONFIG_DEBUG_FS. This fixes false PSYS defer where core reports bus ready while PSYS still reads not-ready from the same isp object. Signed-off-by: Arun T <arun.t@intel.com>
|
This will probably need debugfs patch file to be changed (e.g. https://github.com/intel/ipu7-drivers/blob/main/patch/v7.0.0/0002-staging-ipu7-Add-IPU7-debugfs.patch) .. If not, isys will use different structure (since code is usually taken from upstream + patches) vs psys will take new structure... |
|
@saragsapre as you mentioned, the debugfs patch will not be submitted to kernel.org. Therefore, this patch is required for the current codebase to keep the structure layout consistent and avoid offset mismatches. |
Error 1:
[ 4.352252] bus_add_device: cannot add device 'ipu7-psys0' to unregistered bus 'intel-ipu7-psys'
[ 4.362394] intel-ipu7-psys ipu7-psys0: psys device_register failed
[ 4.370175] intel_ipu7_psys.psys intel_ipu7.psys.40: probe with driver intel_ipu7_psys.psys failed with error -22
Fix Patch:
psys_probe is not passed when calling only module_auxiliary_driver(), from 7.1 code logic get changed we need to call first bus register so that auxiliary_driver_register register bus driver (psys) properly
Error2:
A kernel panic was observed when creating the PSYS DebugFS directory. The crash occurs because psys->adev->isp->ipu7_dir is NULL or invalid at that point. The fix uses a safe, standalone directory:
Fix:
added proper ipu7-psys node name in debugfs_create()