Skip to content

hisilicon-osdrv-hi3516cv300: enable online mode for sc2235p on hi3516ev100 - #3119

Open
thrackl wants to merge 1 commit into
OpenIPC:masterfrom
thrackl:fix-hi3516ev100-sc2235p-online
Open

thrackl wants to merge 1 commit into
OpenIPC:masterfrom
thrackl:fix-hi3516ev100-sc2235p-online

Conversation

@thrackl

@thrackl thrackl commented Dec 5, 2026

Copy link
Copy Markdown

Summary

Sets b_arg_online=1 for sc2310_i2c | sc2235p_i2c | sc2235p_i2c_dc | sc2235_i2c | sc2235_i2c_dc on hi3516ev100 in load_hisilicon.

Problem

With the default b_arg_online=0 (VI-VPSS offline mode), majestic fails to receive frames from the sc2235p_i2c_dc DVP sensor on hi3516ev100 and repeatedly logs Timeout from venc channel 0.

Solution

Enable b_arg_online=1 specifically inside the sc2310_i2c|sc2235p* case branch when chipid = "hi3516ev100", leaving all other sensors and SoCs unaffected.

Testing

Tested on a Xiongmai HI3516EV100_50H20L_S38 (hi3516ev100) board with an SC2235P DVP sensor (sensor=sc2235p_i2c_dc). Video streaming in majestic works reliably without venc timeouts.

@qodo-free-for-open-source-projects

qodo-free-for-open-source-projects Bot commented Dec 5, 2026 •

Copy link
Copy Markdown

PR Summary by Qodo

hisilicon-osdrv-hi3516cv300: enable online mode for sc2235p on hi3516ev100

🐞 Bug fix 🕐 Less than 5 minutes

Grey Divider

AI Description

• Sets b_arg_online=1 for SC2310/SC2235P/SC2235 sensors on hi3516ev100 only.
• Fixes majestic Timeout from venc channel 0 caused by offline VI-VPSS mode with sc2235p_i2c_dc.
• Other sensors and SoCs keep the default offline mode.
Merge Risk 🟢 Low

Blast radius 🟢 Low 💥 1 capability

  • 1 affected end-to-end capability after fault-specific containment; implementation boundaries do not widen its functional scope.
  • The changed branch selects a VI/VPSS startup mode for the sensor-driven camera pipeline, and both affected module parameters are loaded by this script.
  • This is one end-to-end capture and processing behavior rather than separate capabilities for each kernel module.
Sources

general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon[339-339]

				b_arg_online=1;

general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon[67-70]

	insmod sys_config.ko vi_vpss_online=$b_arg_online
	insert_osal
	insmod hi3516cv300_base.ko
	insmod hi3516cv300_sys.ko vi_vpss_online=$b_arg_online sensor=$SNS_TYPE mem_total=$mem_total
Behavioral complexity 🟢 Low 🧩 Straightforward

  • Before, the matched sensor branch left b_arg_online at its default unless -online was explicitly passed.
  • After, it sets the flag for Hi3516EV100 before the existing module-loading calls.
  • The new correctness condition is that this sensor/chip combination must use the intended VI/VPSS mode; no new algorithm, state machine, concurrency protocol, or coordinated persistent write is introduced.
Sources

general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon[339-339]

				b_arg_online=1;

general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon[67-70]

	insmod sys_config.ko vi_vpss_online=$b_arg_online
	insert_osal
	insmod hi3516cv300_base.ko
	insmod hi3516cv300_sys.ko vi_vpss_online=$b_arg_online sensor=$SNS_TYPE mem_total=$mem_total

general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon[491-491]

b_arg_online=0

general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon[548-548]

			b_arg_online=1;
Potential damage 🟡 Medium 🩹 Temporary loss

  • If the selected online mode is incompatible with a board or sensor, camera capture or processing could fail during startup.
  • The affected behavior is runtime initialization; reverting the script and restarting restores the prior mode, with no changed persistent state or external transaction identified.
  • The exact vendor-driver failure mode remains an unresolved assumption.
  • A code revert followed by module reload or reboot should restore the prior startup mode.
  • No automatic repair or persistent-state migration is involved.
Sources

general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon[339-339]

				b_arg_online=1;

general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon[67-70]

	insmod sys_config.ko vi_vpss_online=$b_arg_online
	insert_osal
	insmod hi3516cv300_base.ko
	insmod hi3516cv300_sys.ko vi_vpss_online=$b_arg_online sensor=$SNS_TYPE mem_total=$mem_total
Assessed commit d271707
Diagram

graph TD
  A["insert_sns in load_hisilicon"] --> B{"chipid is hi3516ev100?"} --> C["sc2235p case: b_arg_online=1"] --> D["VI-VPSS online mode"] --> E["majestic venc frames"]
Loading
High-Level Assessment

The PR keeps the flag inside the existing hi3516ev100 branch of the sensor case, so no other SoC or sensor changes behavior. Changing the global default to online would risk regressions on hi3516cv300 and other sensors, which the testing does not cover. Setting the flag per sensor and per chip is the smallest safe change.

Files changed (1) +1 / -0

Bug fix (1) +1 / -0
load_hisiliconEnable online VI-VPSS mode for SC2235P-family sensors on hi3516ev100 +1/-0

Enable online VI-VPSS mode for SC2235P-family sensors on hi3516ev100

• Adds 'b_arg_online=1' inside the existing hi3516ev100 branch of the sc2310_i2c/sc2235p* sensor case in insert_sns. The flag switches the pipeline from offline to online mode, which stops the venc timeouts seen with sc2235p_i2c_dc. Other chips and sensors are untouched.

general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon

@qodo-free-for-open-source-projects

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (1) 📜 Skill insights (0)

Grey Divider


Action required

1. Online mode changes default for every hi3516ev100 board 📘 Rule violation ≡ Correctness
Description
load_hisilicon sets b_arg_online=1 in the shared sc2310_i2c|sc2235p* case arm based only on
chipid = hi3516ev100, rather than limiting it to the tested Xiongmai HI3516EV100_50H20L_S38 board.
On their next boot, other hi3516ev100 boards selecting that arm—including deployed cameras using the
sibling sensors—will also switch from VI-VPSS offline to online mode, although the single-board test
does not cover them.
Code

general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon[R338-339]

			if [ ${chipid} = "hi3516ev100" ]; then
+				b_arg_online=1;
Evidence
The new line is in a shared load-script case arm selected by SoC and sensor, with no board-level
condition or opt-in. Consequently, the setting applies to other hi3516ev100 cameras selecting that
arm, while the provided test evidence covers only the Xiongmai HI3516EV100_50H20L_S38 board with
sc2235p_i2c_dc.

Rule 7: No device-specific values in generic configuration
general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon[338-339]
Best Practice: Repository guidelines

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The shared `sc2310_i2c|sc2235p*` branch sets `b_arg_online=1` for every hi3516ev100 board selecting that arm, although online mode was validated only on the Xiongmai HI3516EV100_50H20L_S38 board. This also changes the default for other deployed cameras without a board-level opt-in.

## Fix Focus Areas
- general/package/hisilicon-osdrv-hi3516cv300/files/script/load_hisilicon[336-345]

## Recommended Fix
Remove `b_arg_online=1` from the shared branch and set online mode in the Xiongmai board’s device-specific builder configuration or a per-device override. If the intended scope is sensor-specific rather than board-specific, narrow the branch to the validated sensor and establish whether other boards using it should receive the change. If online mode is intended for all hi3516ev100 boards selecting the shared arm, document that scope and provide evidence for the affected sibling sensors and boards before retaining the shared default.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
Review mode: Auto: ⚖️ Balanced: Shared SoC-family script changes runtime sensor behavior across deployed cameras.

Grey Divider

Tip of the day
💡 Did you know, you can open the rule or relationship behind a finding in one click

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant