]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: cadence: Change large transfer count reset logic to be unconditional
authorRobert Hancock <robert.hancock@calian.com>
Tue, 14 Jun 2022 23:29:19 +0000 (17:29 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 29 Jul 2022 15:14:12 +0000 (17:14 +0200)
commit8c01eeccba9bc7aba9acb275fc8a16c296b2577d
tree3a649aa5ffaaec1356b4569343cd6472ee1314d2
parent51de182172ad0e2d2e18e6f24cfba1684c85e86e
i2c: cadence: Change large transfer count reset logic to be unconditional

[ Upstream commit 53f53d03cb3452c626825734521fbd126d30597d ]

Problems were observed on the Xilinx ZynqMP platform with large I2C reads.
When a read of 277 bytes was performed, the controller NAKed the transfer
after only 252 bytes were transferred and returned an ENXIO error on the
transfer.

There is some code in cdns_i2c_master_isr to handle this case by resetting
the transfer count in the controller before it reaches 0, to allow larger
transfers to work, but it was conditional on the CDNS_I2C_BROKEN_HOLD_BIT
quirk being set on the controller, and ZynqMP uses the r1p14 version of
the core where this quirk is not being set. The requirement to do this to
support larger reads seems like an inherently required workaround due to
the core only having an 8-bit transfer size register, so it does not
appear that this should be conditional on the broken HOLD bit quirk which
is used elsewhere in the driver.

Remove the dependency on the CDNS_I2C_BROKEN_HOLD_BIT for this transfer
size reset logic to fix this problem.

Fixes: c0493001eca3 ("i2c: removed work arounds in i2c driver for Zynq Ultrascale+ MPSoC")
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Reviewed-by: Shubhrajyoti Datta <Shubhrajyoti.datta@amd.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-cadence.c