mirror of
https://github.com/openwrt/openwrt.git
synced 2026-10-14 21:47:41 +04:00
Some LED state changes are silently missed on mt7622 boards such as the SDG-841. The MCU ACKs but silently discards register writes that arrive while it is still processing a previous one. i2c from shell reproduced drops at write gaps below ~3ms, while 5ms spacing was reliable across hundreds of writes. Paced writes latch correctly regardless of channel state and write order, ruling out register write ordering as the cause. The SmartRG vendor driver paced its control writes with msleep(1), which is why this never showed there. Boards based on mt7987/mt7988 tolerate the unpaced bursts with identical MCU firmware (2.4). Since a discarded write is ACKed, the return code cannot detect it. After each write, wait out the measured consumption time, read the register back, and rewrite until the value actually latched, warning and returning -EIO after five attempts. The msleep(5) between channel inits in srg_led_probe() paced the same writes by hand. Drop it, so that srg_led_i2c_write() is the only place that owns the MCU timing. Signed-off-by: Chad Monroe <chad@monroe.io> Link: https://github.com/openwrt/openwrt/pull/24354 Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>