]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: qcom-geni: Fix GPI DMA buffer sync-back
authorRobin Reckmann <robin.reckmann@googlemail.com>
Sun, 7 Aug 2022 14:04:54 +0000 (23:04 +0900)
committerWolfram Sang <wsa@kernel.org>
Thu, 11 Aug 2022 12:13:51 +0000 (14:13 +0200)
commitf5758ce1711a9d22a2cdaaff4fb8fef4f26a0d6e
tree6b15552697e09f845124b65585c403d19f6016f9
parentbaf9500b22d5c76a85f0177afe453b2d40e689d9
i2c: qcom-geni: Fix GPI DMA buffer sync-back

Fix i2c transfers using GPI DMA mode for all message types that do not set
the I2C_M_DMA_SAFE flag (e.g. SMBus "read byte").

In this case a bounce buffer is returned by i2c_get_dma_safe_msg_buf(),
and it has to synced back to the message after the transfer is done.

Add missing assignment of dma buffer in geni_i2c_gpi().

Set xferred in i2c_put_dma_safe_msg_buf() to true in case of no error to
ensure the sync-back of this dma buffer to the message.

Fixes: 4434964831df ("i2c: qcom-geni: Add support for GPI DMA")
Signed-off-by: Robin Reckmann <robin.reckmann@gmail.com>
Tested-by: Luca Weiss <luca.weiss@fairphone.com>
Tested-by: Caleb Connolly <caleb@connolly.tech>
Reviewed-by: Konrad Dybcio <konrad.dybcio@somainline.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-qcom-geni.c