Skip to content

Ipu7 psys register psys node before add device and debugfs - #90

Open
arunt1 wants to merge 3 commits into
intel:mainfrom
arunt1:ipu7_psys
Open

Ipu7 psys register psys node before add device and debugfs#90
arunt1 wants to merge 3 commits into
intel:mainfrom
arunt1:ipu7_psys

Conversation

@arunt1

@arunt1 arunt1 commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

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()

@arunt1 arunt1 changed the title Ipu7 psys Ipu7 psys register psys node before add device and debugfs Jul 17, 2026
struct dentry *file;
struct dentry *dir;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6,17,0)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 manikx left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

@tripathidm tripathidm left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please address review comments.

arunt1 added 2 commits July 21, 2026 23:14
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)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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)

@arunt1

arunt1 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor Author

@tripathidm 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.

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>
@saragsapre

Copy link
Copy Markdown
Contributor

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...

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.

4 participants