Repository navigation
ARM: dts: hi3536dv100: give the hibvt i2c controller its interrupt - #95
Merged
widgetii merged 1 commit intoOct 17, 2026
Merged
Conversation
i2c@120c0000 has no interrupts property, so i2c-hibvt runs in polling mode, and a transfer that never completes spins udelay(50) up to 0x10000 times -- 3.3 s per transfer on the SoC's only core -- before "wait idle timeout". An NVR has nothing on that bus: one ipctool report issued 38 such transfers and the board stopped answering the network for two minutes. The Hi3536DV100 data sheet lists I2C as interrupt bit 42, which is SPI 10. Checked on a lab NVR: setting the controller's INTR_EN made GICD_ISPENDR1 bit 10 (ID 42) pending, and clearing it cleared the bit. The same change on hi3516cv500/hi3516dv300 was run on a Hi3516AV300, where the sensor works over i2c in interrupt mode.
widgetii
marked this pull request as ready for review
October 17, 2026 10:47
PR Summary by QodoARM: hi3536dv100: assign the hibvt I2C controller interrupt
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
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.
Same change as #94 (hisilicon-hi3516cv500), for
hi3536dv100.dtsi. Its one hibvt I2C node,i2c@120c0000, has nointerruptsproperty, soi2c-hibvtpolls.The problem
In polling mode a transfer that never completes spins
udelay(50)up to0x10000times, 3.28 s, on the SoC's only core, beforewait idle timeout. An NVR has nothing on that bus.On a lab Hi3536DV100 NVR, one full
ipctoolreport issued 38 such transfers:(ipctool no longer probes for a sensor on this chip: OpenIPC/ipctool#250. Any other I2C user still pays the polling cost.)
The fix
interrupts = <0 10 4>: the Hi3536DV100 data sheet's interrupt table gives I2C as bit 42, which is SPI 10. Nothing else in this dtsi uses SPI 10.Tested
The interrupt line, on the NVR (stock kernel, read-only to the GIC):
devmem 0x120c00e4 32 0x1fff(the controller'sINTR_EN) makesGICD_ISPENDR1(0x10301204) read0x00000400, i.e. bit 10 = ID 42 pending.0back clears it.Interrupt mode on hardware: the cv500 change in ARM: dts: hi3516cv500/hi3516dv300: give the hibvt i2c controllers their interrupts #94 ran on a Hi3516AV300, where the sensor works over I2C and failed transfers come back by interrupt in 10 ms.
Booted on the NVR: I flashed this branch's DTB onto the NVR's own kernel (its flash zImage with only the appended DTB replaced, which differs by this one line). Then I restored the original kernel afterwards (MD5 verified).
/proc/interruptsshows120c0000.i2cat GIC 42.tx timeout. Before, it was 3.3 s each of busy-waiting.