]> git.baikalelectronics.ru Git - uboot.git/commit
i2c: stm32: do not set the STOP condition on error
authorAlain Volmat <alain.volmat@foss.st.com>
Mon, 12 Sep 2022 08:42:00 +0000 (10:42 +0200)
committerPatrick Delaunay <patrick.delaunay@foss.st.com>
Thu, 15 Sep 2022 12:59:22 +0000 (14:59 +0200)
commit55dd7ddc5d98041a935be57b1ece01c37b5a5114
treed3058a5554b7ce5e4e52de284186eba5d88da6ce
parent1ca4fb76adc1bddd25a052421cac69cd7bc34b02
i2c: stm32: do not set the STOP condition on error

Current function stm32_i2c_message_xfer is sending a STOP
whatever the result of the transaction is.  This can cause issues
such as making the bus busy since the controller itself is already
sending automatically a STOP when a NACK is generated.

Thanks to Jorge Ramirez-Ortiz for diagnosing and proposing a first
fix for this. [1]

[1] https://lore.kernel.org/u-boot/20220815145211.31342-2-jorge@foundries.io/

Reported-by: Jorge Ramirez-Ortiz, Foundries <jorge@foundries.io>
Signed-off-by: Jorge Ramirez-Ortiz <jorge@foundries.io>
Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
Tested-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
drivers/i2c/stm32f7_i2c.c