]> git.ipfire.org Git - thirdparty/linux.git/commit
i2c: altera: Fix race between xfer_msg and isr thread
authorAtsushi Nemoto <atsushi.nemoto@sord.co.jp>
Fri, 8 May 2020 13:12:48 +0000 (22:12 +0900)
committerWolfram Sang <wsa@kernel.org>
Fri, 15 May 2020 09:23:49 +0000 (11:23 +0200)
commit5d4c7977499a736f3f80826bdc9744344ad55589
tree4524c52e9cb2888ab5568013795cb54a9b9252d9
parentab7cf7e53ccf1fecec6b72d1a3a13ff88193b490
i2c: altera: Fix race between xfer_msg and isr thread

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 <atsushi.nemoto@sord.co.jp>
Acked-by: Thor Thayer <thor.thayer@linux.intel.com>
[wsa: updated commit message]
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-altera.c