Concurrent I2C Access From User Space

I have 2 I2C devices on two different channels of an I2C switch, TI TCA9546A. The TCA9546A is setup as a kernel module but the 2 I2C devices are accessed in user space in separate apps current. Currently the system polls the devices when a reading is needed one after the other but I would like to refactor the apps to periodically poll the devices and then send the new data to an apps that have subscribed.

My questions are:

  1. Will the kernel manage access to the I2C device if the 2 different apps happen to try and access the I2C bus the same time?
  2. We have had some issues previously with stuck I2C busses. How can I ensure that I2C access is closed correctly if an app faults are the systems resets?


you can use one application specifically for reading/writing the I2C.
Another application can communicate with this application by IPC.
In this case, you can set up semaphore.