I 2 C is a shared bus with several devices that can be accessed from both multiple processes and threads. Thus, the Linux driver code I 2 C uses the mutex to control access to each I 2 C bus.
For SMBus functions, see the Linux kernel function i2c_smbus_xfer() in i2c-core-smbus.c . It receives a lock for adapter I 2 C before starting the transfer (look at the source code and look at the call to i2c_lock_adapter() ). All SMBus transactions are based on this feature.
For i 2 C functions, see the Linux kernel function i2c_transfer() in i2c-core-base.c . Before starting the transfer, it receives a lock for the adapter I 2 C. All transactions I 2 C are based on this function.
So, there is protection against built-in built-in access.
source share