Repository navigation
i2cdetect: stop wedging a GC4653 on Hi3516CV610 - #271
Conversation
Scanning a CV610 board with a GC4653 killed the sensor bus at once. On stock firmware the streamer then tripped the watchdog; on OpenIPC every later transfer on i2c-0 failed until the sensor was reset. i2cdetect read register 0 with a one-byte address, and the GC4653 takes two. Single transfers on the board isolated it: i2cget 0x52 0x00 kills the bus and a pulse of the sensor reset in 0x11018440 recovers it, while a NACK at an empty address, 0x78 and the general call at 0x00 do nothing. On HISI_OT the scan now writes one byte and a stop. A read alone also found the sensor, but it took about 500 ms per table line: without an interrupt, bsp-i2c waits for data on every address that does not answer, where a write fails on the NACK. A zero-length write is out too, as the driver loads len - 1 into its loop counter. Tested on a Hi3516CV610 QFN board with a GC4653 on OpenIPC: the scan is immediate, finds the sensor, and the sensor still answers afterwards. Other CV610 sensors and a scan during a live stream are untested. Other chips keep the old probe. Sensor detection still wedges this sensor: detect_galaxycore_sensor reads 0xf0 with a one-byte address first, since #238. That needs its own fix.
PR Summary by QodoPrevent i2cdetect from wedging GC4653 on Hi3516CV610
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1. Failed address changes mislabel devices
|
Scanning a CV610 board with a GC4653 killed the sensor bus at once. On stock firmware the streamer then tripped the watchdog; on OpenIPC every later transfer on i2c-0 failed until the sensor was reset.
i2cdetect read register 0 with a one-byte address, and the GC4653 takes two. Single transfers on the board isolated it: i2cget 0x52 0x00 kills the bus and a pulse of the sensor reset in 0x11018440 recovers it, while a NACK at an empty address, 0x78 and the general call at 0x00 do nothing.
On HISI_OT the scan now writes one byte and a stop. A read alone also found the sensor, but it took about 500 ms per table line: without an interrupt, bsp-i2c waits for data on every address that does not answer, where a write fails on the NACK. A zero-length write is out too, as the driver loads len - 1 into its loop counter.
Tested on a Hi3516CV610 QFN board with a GC4653 on OpenIPC: the scan is immediate, finds the sensor, and the sensor still answers afterwards. Other CV610 sensors and a scan during a live stream are untested. Other chips keep the old probe.
Sensor detection still wedges this sensor: detect_galaxycore_sensor reads 0xf0 with a one-byte address first, since #238. That needs its own fix.