Repository navigation
ARM: dts: hi3516cv500/hi3516dv300: give the hibvt i2c controllers their interrupts - #94
Merged
widgetii merged 1 commit intoOct 17, 2026
Conversation
…ir interrupts None of the i2c nodes has an interrupts property, so i2c-hibvt falls back to polling, and a transfer to an address that never completes spins in udelay(50) up to 0x10000 times -- 3.3 s per transfer with the CPU held -- before "wait idle timeout". Wire each controller to its GIC line from the interrupt table of the Hi3516AV300 and Hi3516DV300 data sheets: I2C0-4 are interrupt bits 43-47 (SPI 11-15) and I2C5-7 are 109-111 (SPI 77-79). On a Hi3516AV300 with an IMX415 on i2c0, all eight controllers register their interrupts; the sensor initialises over i2c0 and the ISP's register traffic keeps raising its interrupt count; a combined write/read transfer returns in 10 ms; and a transfer to an empty bus fails in 10 ms with "irq handle abort" instead of after the polling timeout.
PR Summary by QodoARM: Wire Hi3516CV500 and Hi3516DV300 I2C controller interrupts
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
Code Review by Qodo🐞 Bugs (0) 📘 Rule violations (0) 📎 Requirement gaps (0)
Great, no issues found!Qodo reviewed your code and found no material issues that require reviewTip of the day💡 Did you know, you can see how risky a PR is at a glance with blast radius labels |
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.
None of the hibvt I2C nodes in
hi3516cv500.dtsiorhi3516dv300.dtsihas aninterruptsproperty (HiSilicon's SDK dtsi doesn't either), soi2c-hibvtalways runs in polling mode.The problem
In polling mode, a transfer that never completes spins
udelay(50)up to0x10000times, 3.28 s with the CPU held, beforewait idle timeout. That cost lands on anything that probes an empty address or an absent bus.The fix
Wire every controller to its GIC line. The numbers come from the "Mapping between the interrupt bits and interrupt sources" table in the Hi3516AV300 data sheet (en) and the Hi3516DV300 user guide (zh), which agree:
hi3516av300_litebuildsARCH_HI3516DV300and appendshi3516dv300-demb.dtb, so both dtsi files need the change.Tested on a Hi3516AV300 with an IMX415 on i2c0
I booted the camera's own flash kernel from RAM, with only its appended DTB replaced. The new DTB differs from the stock one by exactly these eight
interruptslines.Interrupts registered: all eight controllers appear in
/proc/interrupts, at GIC 43–47 and 109–111.Sensor traffic: the IMX415 initialised over i2c0 in interrupt mode (
IMX415 4K2K_10BIT_30FPS init succuss!), and the ISP's register traffic kept raising i2c0's interrupt count (226, then 292).Reads: a combined
I2C_RDWRread of the sensor (i2ctransfer -y 0 w2@0x1a 0x30 0x00 r1) returns in 10 ms.Empty bus: a transfer on i2c1 fails in 10 ms with
irq handle abort, RIS: 0x800, instead of after the polling timeout.End to end, video0 on: a snapshot came back on the first try (HTTP 200, 444 KB), and RTSP gave 200 frames of 3840x2160 HEVC in 10 s, the configured 20 fps.
The only I2C errors were 16
irq handle abort, RIS: 0x1on i2c0, all right after majestic's own shutdown during the restart. That's the sensor being parked, and polling mode reports the same NACKs aswait idle abort!.