Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1714076

[RFC PATCH v4 6/6] i2c: dev: mark RDWR buffers as DMA_SAFE

From Wolfram Sang <wsa+renesas@sang-engineering.com>
Newsgroups linux.kernel
Subject [RFC PATCH v4 6/6] i2c: dev: mark RDWR buffers as DMA_SAFE
Date 2017-08-17 16:20 +0200
Message-ID <uftOq-5ZJ-27@gated-at.bofh.it> (permalink)
References <uftOp-5ZJ-7@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---
 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 6f638bbc922db4..bbc7aadb4c899d 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.11.0

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

[RFC PATCH v4 6/6] i2c: dev: mark RDWR buffers as DMA_SAFE Wolfram Sang <wsa+renesas@sang-engineering.com> - 2017-08-17 16:20 +0200

csiph-web