Drivers: QURT I2C do not use a static mutex for all I2C drivers #23523
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.
Solved Problem
This makes the QURT I2C driver use a mutex per I2C bus.
Previously, if one I2C bus crashes or is hung it crashes all the other buses. For example the baro bus can get stalled if another bus gets stalled.
Note: The timeout to recognize an I2C bus is being held for too long is still on the order of 6 seconds at times. Far too long for safety of others devices on the same bus.
Changelog Entry
For release notes: QURT I2C do not use a static mutex for all I2C drivers
Test coverage
Tested by forcefully hanging the I2C bus before and after the change. Before this change the baro and voxl-pm busses on my system would crash when i forcefully hang a different bus.