I have reproduceable hang-ups when I try to address multiple I2C devices on the same I2C bus in parallel. I2C bus is then completely stuck and it needs a power cycle to get it working again. I used the same I2C devices in parallel on other HW and it works fine there. I2C bus is terminated fine. The default i2c_mt7621 kernel driver is used.
I have 2 questions around this:
1) Any idea how to reset the I2C bus to avoid the need to do a power cycle?
2) How can I set the I2C bus speed? Driver tells during boot thatI2C speed is set to 100 kHz: i2c-mt7621 10000900.i2c: clock 100 kHz
I2C hangups (OPENWRT 21.02.3)
- docbee
- Posts: 38
- Joined: Wed Nov 02, 2016 9:15 am
- docbee
- Posts: 38
- Joined: Wed Nov 02, 2016 9:15 am
Re: I2C hangups (OPENWRT 21.02.3)
Update: I hard coded the default bus speed in the i2c-mt7621 kernel driver. That worked, but slower bus speed does not prevent the bus hang-ups 
Question, how to reset the bus without power cycle, remains? I tried unloading/loading the I2C kernel modules, but with no effect.

Question, how to reset the bus without power cycle, remains? I tried unloading/loading the I2C kernel modules, but with no effect.
- docbee
- Posts: 38
- Joined: Wed Nov 02, 2016 9:15 am
Re: I2C hangups (OPENWRT 21.02.3)
Digging more into this it looks like the I2C kernel modules on mt7621 are not able to handle concurrent I2C accesses. It should have semaphores on module level to let requests wait, when there is still one being processed. I2C implementation on atheros chipsets I worked with before (Carambola) did it correctly. Not having this forwards the burden into user land, where you have to fiddle around with techniques to avoid I2C concurrency of your application processes. Hm, not that great...
3 posts
Page 1 of 1
Who is online
Users browsing this forum: No registered users and 4 guests