Skip to content

hisilicon-opensdk: bump to 2a38a27, so a CMA gk7205v500 can stream - #2535

Merged
widgetii merged 1 commit into
masterfrom
hisilicon-opensdk/bump-2a38a27
Oct 4, 2026
Merged

widgetii merged 1 commit into
masterfrom
hisilicon-opensdk/bump-2a38a27

Conversation

@widgetii

@widgetii widgetii commented Oct 4, 2026

Copy link
Copy Markdown
Member

Problem

GK7205V510 (Zenointel SD-2N-4G, MIS2008) on mmz_allocator=cma, the gk7205v500 default since #2526: majestic logged Timeout from venc channel 0, and once the sensor delivered frames the board rebooted with nothing on the console.

It was a kernel panic, hidden by the image's console loglevel of 0 and followed by a reboot panic= seconds later. With printk raised:

Alignment trap: not handling instruction f8d31045 at VENC_VpssSend+0x10f [open_venc]
Unhandled fault: alignment exception (0x001) at 0xc99b6045   *ppte=42008012

The closed venc object reads its VPSS-bind descriptors with an unaligned load. osal's CMA allocator mapped non-cached MMBs strongly-ordered, where that load faults. The carve-out allocator (ioremap_wc, Normal non-cacheable) never hit it. OpenIPC/openhisilicon#238 maps them write-combined, and also passes __dma_clear_buffer() the coherent flag the 4.9 kernel expects. dfc3a81..2a38a27 is exactly that one commit.

Hardware tested on

GK7205V510, Zenointel SD-2N-4G, MIS2008: gk7205v500_ultimate NAND image built from this branch (master 77c0d82 + this commit), flashed with sysupgrade --archive. Bootargs at the image default, mem=128M mmz_allocator=cma mmz=anonymous,0,0x42000000,96M.

Video on this board also needs its sensor bring-up: lanes 0|1 in the MIS2008 ini, and GPIO50 low, which stock does from init.sh. Both were applied by hand for the test; neither is part of this PR.

Evidence

Before (image at dfc3a81): kernel panic within 1 s of the first bound frame, from majestic and from the vendor SPC020 sample_vio:

Alignment trap: not handling instruction f8d31045 at [<bfa025d8>]
Unhandled fault: alignment exception (0x001) at 0xc99b6045
PC is at VENC_VpssSend+0x10f/0x164 [open_venc]
(VENC_VpssSend [open_venc]) from (VpssFakeSend+0x1aa/0x294 [open_vpss])

After (this branch's image, xm_osal.ko md5 8805f719 from the image, no overlay):

mmz_allocator=cma mmz=anonymous,0,0x42000000,96M osal=8805f719
up=40.84 VI=387 jpg:200:101796
...
up=76.46 VI=2167 jpg:200:102361
alignment_traps=0
stream|codec_name=hevc|width=1920|height=1080|avg_frame_rate=20/1

Image sizes: uImage: [1909KB/2048KB], fitImage: [1911KB/4096KB], rootfs.ubi: [15104KB/16384KB].

Scope

  • No kernel patches under general/package/all-patches/linux/ (those go to OpenIPC/linux)
  • No files specific to a single retail camera model (those go to OpenIPC/builder)
  • No probing or bring-up tooling (that goes to OpenIPC/ipctool)
  • Nothing under general/overlay/ or in a shared load_<vendor> script hardcodes a value specific to my board
  • Package sources come from an OpenIPC repository, and any version bump keeps at least the specificity of the pin it replaces (a new package should pin a full 40-character SHA)
  • No LD_PRELOAD, and no binaries that cannot be rebuilt from source
  • New code is selected by a defconfig, so CI actually builds it

OpenIPC/openhisilicon#238. dfc3a81..2a38a27 is exactly one commit.

With mmz_allocator=cma, the gk7205v500 default since #2526, a GK7205V510
panicked the kernel as soon as a bound VPSS channel delivered its first frame
to VENC. Nothing was printed, because the image keeps the console loglevel at
0, and the board rebooted panic= seconds later, so it looked like a hardware
reset. The closed venc object reads its bind descriptors with an unaligned
ldr.w (VENC_VpssSend+0x10f). osal's CMA allocator mapped non-cached MMBs
strongly-ordered, where that load faults in the VPSS interrupt. The carve-out
allocator's ioremap_wc() mapping is Normal non-cacheable, where it is legal.
osal now maps them write-combined, and also passes __dma_clear_buffer() the
coherent flag the kernel expects.
@qodo-free-for-open-source-projects

Copy link
Copy Markdown

PR Summary by Qodo

Bump openhisilicon to fix CMA streaming on GK7205V500

🐞 Bug fix ⚙️ Configuration changes 🕐 10-20 Minutes

Grey Divider

AI Description

• Pin openhisilicon to the upstream CMA mapping fix for GK7205V500 devices.
• Prevent an alignment fault that panicked the kernel when VPSS first delivered a frame to VENC.
Diagram

graph TD
  Pin["Package pin"] --> Source["Openhisilicon source"] --> OSAL["XM OSAL"] --> MMB["CMA memory"] --> VENC["VENC"] --> Video["Video stream"]
  VPSS["VPSS frames"] --> VENC
Loading
High-Level Assessment

Pinning the focused upstream fix keeps the allocator correction in its source repository and preserves the existing full-SHA dependency pin. A local kernel or package patch would duplicate that fix without a clear benefit.

Files changed (1) +1 / -1

Other (1) +1 / -1
hisilicon-opensdk.mkPin openhisilicon to the CMA mapping fix +1/-1

Pin openhisilicon to the CMA mapping fix

• Replaces the full openhisilicon commit SHA with 2a38a27ba4764d4e2265a6f1753ecca0ef8a773f. According to the PR evidence, the upstream commit fixes the CMA mapping that caused an alignment fault during GK7205V500 streaming; no local source or build logic changes.

general/package/hisilicon-opensdk/hisilicon-opensdk.mk

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

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider

Great, no issues found!

Qodo reviewed your code and found no material issues that require review

Grey Divider

Tip of the day
💡 Did you know, you can tweak Display settings with a live preview to see your comment before it ships

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

@widgetii
widgetii merged commit a71fc5d into master Oct 4, 2026
73 of 74 checks passed
@widgetii
widgetii deleted the hisilicon-opensdk/bump-2a38a27 branch October 4, 2026 10:32
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