Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i2c: i801: fix potential race in i801_block_transaction_byte_by_byte
commit f78ca48a8ba9cdec96e8839351e49eec3233b177 upstream. Currently we set SMBHSTCNT_LAST_BYTE only after the host has started receiving the last byte. If we get e.g. preempted before setting SMBHSTCNT_LAST_BYTE, the host may be finished with receiving the byte before SMBHSTCNT_LAST_BYTE is set. Therefore change the code to set SMBHSTCNT_LAST_BYTE before writing SMBHSTSTS_BYTE_DONE for the byte before the last byte. Now the code is also consistent with what we do in i801_isr_byte_done(). Reported-by: Jean Delvare <[email protected]> Closes: https://lore.kernel.org/linux-i2c/[email protected]/ Cc: [email protected] Acked-by: Andi Shyti <[email protected]> Signed-off-by: Heiner Kallweit <[email protected]> Reviewed-by: Jean Delvare <[email protected]> Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
- Loading branch information