]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: mlxbf: support lock mechanism
authorAsmaa Mnebhi <asmaa@nvidia.com>
Mon, 26 Sep 2022 19:45:04 +0000 (15:45 -0400)
committerWolfram Sang <wsa@kernel.org>
Tue, 27 Sep 2022 19:42:41 +0000 (21:42 +0200)
commit15ca9f250b2ec4eb5f692c17ecbda8994899cd9a
treefbd17002e4469a1285bd97307a7178e0c2ad039a
parent2069c50d59501c6e8972af95f4e24903a2d93d47
i2c: mlxbf: support lock mechanism

Linux is not the only entity using the BlueField I2C busses so
support a lock mechanism provided by hardware to avoid issues
when multiple entities are trying to access the same bus.

The lock is acquired whenever written explicitely or the lock
register is read. So make sure it is always released at the end
of a successful or failed transaction.

Fixes: 96f60cc0548added (i2c: mlxbf: I2C SMBus driver for Mellanox BlueField SoC)
Reviewed-by: Khalil Blaiech <kblaiech@nvidia.com>
Signed-off-by: Asmaa Mnebhi <asmaa@nvidia.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-mlxbf.c