]> git.baikalelectronics.ru Git - kernel.git/commit
i2c: imx: Only DMA messages with I2C_M_DMA_SAFE flag set
authorAndrew Lunn <andrew@lunn.ch>
Wed, 9 Nov 2022 23:59:02 +0000 (00:59 +0100)
committerWolfram Sang <wsa@kernel.org>
Thu, 1 Dec 2022 23:12:25 +0000 (00:12 +0100)
commit464736d104dba1ee274c930cb4ccce5a676b7283
tree6280bbc393d22ebb6ebc2f7d1cb6026669750e89
parent9283644ab7b5e7fc010405a559c85a150e55e34c
i2c: imx: Only DMA messages with I2C_M_DMA_SAFE flag set

Recent changes to the DMA code has resulting in the IMX driver failing
I2C transfers when the buffer has been vmalloc. Only perform DMA
transfers if the message has the I2C_M_DMA_SAFE flag set, indicating
the client is providing a buffer which is DMA safe.

This is a minimal fix for stable. The I2C core provides helpers to
allocate a bounce buffer. For a fuller fix the master should make use
of these helpers.

Fixes: 4ffa8f03cb2a ("dma-mapping: Add vmap checks to dma_map_single()")
Signed-off-by: Andrew Lunn <andrew@lunn.ch>
Acked-by: Oleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
drivers/i2c/busses/i2c-imx.c