]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
i2c: cadence: Increase timeout per message if necessary
authorLucas Tanure <tanureal@opensource.cirrus.com>
Wed, 13 Apr 2022 09:14:10 +0000 (10:14 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 14 Jun 2022 14:53:58 +0000 (16:53 +0200)
commitd449c8277bda690b2afbbe008ccf7d4544f39f83
tree2afc37c18888a1e77b0fb44bcf902e1e90995919
parent0816ec55fc0b2a4abe7048f13e6fac652670922a
i2c: cadence: Increase timeout per message if necessary

[ Upstream commit 96789dce043f5bff8b7d62aa28d52a7c59403a84 ]

Timeout as 1 second sets an upper limit on the length
of the transfer executed, but there is no maximum length
of a write or read message set in i2c_adapter_quirks for
this controller.

This upper limit affects devices that require sending
large firmware blobs over I2C.

To remove that limitation, calculate the minimal time
necessary, plus some wiggle room, for every message and
use it instead of the default one second, if more than
one second.

Signed-off-by: Lucas Tanure <tanureal@opensource.cirrus.com>
Acked-by: Michal Simek <michal.simek@xilinx.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-cadence.c