Commit a0aef249 authored by Andrew Lunn's avatar Andrew Lunn Committed by sanglipeng
Browse files

i2c: imx: Only DMA messages with I2C_M_DMA_SAFE flag set

stable inclusion
from stable-v5.10.158
commit 63e72417a1ad00ab1eaa2e550529c6c043f40515
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7NTXH

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=63e72417a1ad00ab1eaa2e550529c6c043f40515



--------------------------------

[ Upstream commit d36678f7 ]

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: 4544b9f2 ("dma-mapping: Add vmap checks to dma_map_single()")
Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Acked-by: default avatarOleksij Rempel <o.rempel@pengutronix.de>
Signed-off-by: default avatarWolfram Sang <wsa@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent 6da57ed7
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment