aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorMichael Bunk <[email protected]>2022-01-16 11:22:36 +0000
committerMauro Carvalho Chehab <[email protected]>2024-04-29 09:21:50 +0100
commit0e148a522b8453115038193e19ec7bea71403e4a (patch)
treedd77a45eb230c68a2b00461bc6cb06b64698aef8 /tools/perf/scripts/python
parentc6ad2b9218d6d9538f60040ad12621ecb1274a0f (diff)
media: dw2102: Don't translate i2c read into write
The code ignored the I2C_M_RD flag on I2C messages. Instead it assumed an i2c transaction with a single message must be a write operation and a transaction with two messages would be a read operation. Though this works for the driver code, it leads to problems once the i2c device is exposed to code not knowing this convention. For example, I did "insmod i2c-dev" and issued read requests from userspace, which were translated into write requests and destroyed the EEPROM of my device. So, just check and respect the I2C_M_READ flag, which indicates a read when set on a message. If it is absent, it is a write message. Incidentally, changing from the case statement to a while loop allows the code to lift the limitation to two i2c messages per transaction. There are 4 more *_i2c_transfer functions affected by the same behaviour and limitation that should be fixed in the same way. Link: https://lore.kernel.org/linux-media/[email protected] Signed-off-by: Michael Bunk <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions