i2c: altera: Fix race between xfer_msg and isr thread
[ Upstream commit 5d4c7977499a736f3f80826bdc9744344ad55589 ]
Use a mutex to protect access to idev->msg_len, idev->buf, etc. which
are modified by both altr_i2c_xfer_msg() and altr_i2c_isr().
This is the minimal fix for easy backporting. A cleanup to remove the
spinlock will be added later.
Signed-off-by: Atsushi Nemoto <firstname.lastname@example.org>
Acked-by: Thor Thayer <email@example.com>
[wsa: updated commit message]
Signed-off-by: Wolfram Sang <firstname.lastname@example.org>
Signed-off-by: Sasha Levin <email@example.com>
1 file changed