]> www.infradead.org Git - users/jedix/linux-maple.git/commit
i2c-axxia: check for error conditions first
authorAdamski, Krzysztof (Nokia - PL/Wroclaw) <krzysztof.adamski@nokia.com>
Mon, 10 Dec 2018 15:01:27 +0000 (15:01 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 12 Feb 2019 18:46:03 +0000 (19:46 +0100)
commit8e6df638f192fb96a9130a4c6fe34efd2b69fd88
treeb9807a5e31475397c4d59e9d7fcbb226ae21a471
parent0d3194a346c586655c9b1d91c60e720eb81b6af7
i2c-axxia: check for error conditions first

[ Upstream commit 4f5c85fe3a60ace555d09898166af372547f97fc ]

It was observed that when using seqentional mode contrary to the
documentation, the SS bit (which is supposed to only be set if
automatic/sequence command completed normally), is sometimes set
together with NA (NAK in address phase) causing transfer to falsely be
considered successful.

My assumption is that this does not happen during manual mode since the
controller is stopping its work the moment it sets NA/ND bit in status
register. This is not the case in Automatic/Sequentional mode where it
is still working to send STOP condition and the actual status we get
depends on the time when the ISR is run.

This patch changes the order of checking status bits in ISR - error
conditions are checked first and only if none of them occurred, the
transfer may be considered successful. This is required to introduce
using of sequentional mode in next patch.

Signed-off-by: Krzysztof Adamski <krzysztof.adamski@nokia.com>
Reviewed-by: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-axxia.c