Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

i2c: rcar: skip DMA if buffer is not safe

This HW is prone to races, so it needs to setup new messages in irq
context. That means we can't alloc bounce buffers if a message buffer is
not DMA safe. So, in that case, simply fall back to PIO.

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>

authored by

Wolfram Sang and committed by
Wolfram Sang
adbd77b5 fe23aa9a

+1 -1
+1 -1
drivers/i2c/busses/i2c-rcar.c
··· 359 359 int len; 360 360 361 361 /* Do not use DMA if it's not available or for messages < 8 bytes */ 362 - if (IS_ERR(chan) || msg->len < 8) 362 + if (IS_ERR(chan) || msg->len < 8 || !(msg->flags & I2C_M_DMA_SAFE)) 363 363 return; 364 364 365 365 if (read) {