소스 검색

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>
Wolfram Sang 7 년 전
부모
커밋
978336d48d
1개의 변경된 파일2개의 추가작업 그리고 0개의 파일을 삭제
  1. 2 0
      drivers/i2c/i2c-dev.c

+ 2 - 0
drivers/i2c/i2c-dev.c

@@ -264,6 +264,8 @@ static noinline int i2cdev_ioctl_rdwr(struct i2c_client *client,
 			res = PTR_ERR(msgs[i].buf);
 			res = PTR_ERR(msgs[i].buf);
 			break;
 			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
 		 * If the message length is received from the slave (similar