]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
i2c: dev: mark RDWR buffers as DMA_SAFE
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Sat, 4 Nov 2017 20:20:03 +0000 (21:20 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Sun, 3 Dec 2017 20:19:32 +0000 (21:19 +0100)
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>
drivers/i2c/i2c-dev.c

index 2cab27a6847980e5249a9f953cba6e2ce2a5bff7..036a03f0d0a6866001d0badd11cb9b30516ca5de 100644 (file)
@@ -264,6 +264,8 @@ static noinline int i2cdev_ioctl_rdwr(struct i2c_client *client,
                        res = PTR_ERR(msgs[i].buf);
                        break;
                }
+               /* memdup_user allocates with GFP_KERNEL, so DMA is ok */
+               msgs[i].flags |= I2C_M_DMA_SAFE;
 
                /*
                 * If the message length is received from the slave (similar