i2c: stm32f7: stop dma transfer in case of NACK
authorAlain Volmat <alain.volmat@foss.st.com>
Mon, 20 Sep 2021 15:21:31 +0000 (17:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 8 Dec 2021 08:04:46 +0000 (09:04 +0100)
commite2d234f96d8ba8c80ccb2e6d856865752f478c15
tree7de344e6e2043b6a453089bd2826b89d95403b5f
parent3dd6c5899695e536161c0866a61751b7a0772987
i2c: stm32f7: stop dma transfer in case of NACK

commit 31b90a95ccbbb4b628578ac17e3b3cc8eeacfe31 upstream.

In case of receiving a NACK, the dma transfer should be stopped
to avoid feeding data into the FIFO.
Also ensure to properly return the proper error code and avoid
waiting for the end of the dma completion in case of
error happening during the transmission.

Fixes: 7ecc8cfde553 ("i2c: i2c-stm32f7: Add DMA support")
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Reviewed-by: Pierre-Yves MORDRET <pierre-yves.mordret@foss.st.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/i2c/busses/i2c-stm32f7.c