Skip to content
Commit 5190417b authored by Matthias Schiffer's avatar Matthias Schiffer Committed by Wolfram Sang
Browse files

i2c: mxs: ensure that DMA buffers are safe for DMA

We found that after commit 9c46929e
("ARM: implement THREAD_INFO_IN_TASK for uniprocessor systems"), the
PCF85063 RTC driver stopped working on i.MX28 due to regmap_bulk_read()
reading bogus data into a stack buffer. This is caused by the i2c-mxs
driver using DMA transfers even for messages without the I2C_M_DMA_SAFE
flag, and the aforementioned commit enabling vmapped stacks.

As the MXS I2C controller requires DMA for reads of >4 bytes, DMA can't be
disabled, so the issue is fixed by using i2c_get_dma_safe_msg_buf() to
create a bounce buffer when needed.

Fixes: 9c46929e

 ("ARM: implement THREAD_INFO_IN_TASK for uniprocessor systems")
Signed-off-by: default avatarMatthias Schiffer <matthias.schiffer@ew.tq-group.com>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
parent 1c788500
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment