]> 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:59:34 +0000 (16:59 +0200)
commit460dc21d2b91b3a54fb3bfc77840458d1708041f
tree301fca836ccc81e829d41923ea74ced025e96ec6
parent8258fb4ef288e0467d1964653c1d1250e0a3ac81
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