| From ea90bb0932a3d794b6a0c544bda87ee8758d20f0 Mon Sep 17 00:00:00 2001 |
| From: Wolfram Sang <wsa+renesas@sang-engineering.com> |
| Date: Sat, 4 Nov 2017 21:20:03 +0100 |
| Subject: [PATCH 1796/1808] i2c: dev: mark RDWR buffers as DMA_SAFE |
| |
| Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com> |
| Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> |
| Signed-off-by: Wolfram Sang <wsa@the-dreams.de> |
| (cherry picked from commit 978336d48d887d6deb7793e0d20a4673f357fb8e) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> |
| --- |
| drivers/i2c/i2c-dev.c | 2 ++ |
| 1 file changed, 2 insertions(+) |
| |
| diff --git a/drivers/i2c/i2c-dev.c b/drivers/i2c/i2c-dev.c |
| index 6f638bbc922d..bbc7aadb4c89 100644 |
| --- a/drivers/i2c/i2c-dev.c |
| +++ b/drivers/i2c/i2c-dev.c |
| @@ -280,6 +280,8 @@ static noinline int i2cdev_ioctl_rdwr(struct i2c_client *client, |
| res = PTR_ERR(rdwr_pa[i].buf); |
| break; |
| } |
| + /* memdup_user allocates with GFP_KERNEL, so DMA is ok */ |
| + rdwr_pa[i].flags |= I2C_M_DMA_SAFE; |
| |
| /* |
| * If the message length is received from the slave (similar |
| -- |
| 2.17.1 |
| |