i2c: aspeed: Handle the coalesced stop conditions with the start conditions.
authorQuan Nguyen <quan@os.amperecomputing.com>
Mon, 11 Dec 2023 10:22:16 +0000 (17:22 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 1 Jan 2024 12:42:35 +0000 (12:42 +0000)
commit8f21b05995b3a8f79b87b6057fe1c254b6bd8879
treef450a8244608b5878c32ca95493d3d9c25203909
parent63835e3f4e0b3046584945ec9723e515f180ee58
i2c: aspeed: Handle the coalesced stop conditions with the start conditions.

[ Upstream commit b4cc1cbba5195a4dd497cf2f8f09e7807977d543 ]

Some masters may drive the transfers with low enough latency between
the nak/stop phase of the current command and the start/address phase
of the following command that the interrupts are coalesced by the
time we process them.
Handle the stop conditions before processing SLAVE_MATCH to fix the
complaints that sometimes occur below.

"aspeed-i2c-bus 1e78a040.i2c-bus: irq handled != irq. Expected
0x00000086, but was 0x00000084"

Fixes: f9eb91350bb2 ("i2c: aspeed: added slave support for Aspeed I2C driver")
Signed-off-by: Quan Nguyen <quan@os.amperecomputing.com>
Reviewed-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-aspeed.c