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

Configure Feed

Select the types of activity you want to include in your feed.

i3c: mipi-i3c-hci: Use own DMA bounce buffer management for I2C transfers

Stop using I2C DMA-safe API for two reasons:
- Not needed if driver is using PIO mode.
- DMA transfers needs a DWORD align sized receive bounce buffer when the
device DMA is IOMMU mapped, which is causing needless double bounce
buffering in that case.

Cc: Billy Tsai <billy_tsai@aspeedtech.com>
Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20250822105630.2820009-5-jarkko.nikula@linux.intel.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>

authored by

Jarkko Nikula and committed by
Alexandre Belloni
ec011151 9e23897b

+1 -5
+1 -5
drivers/i3c/master/mipi-i3c-hci/core.c
··· 348 348 return -ENOMEM; 349 349 350 350 for (i = 0; i < nxfers; i++) { 351 - xfer[i].data = i2c_get_dma_safe_msg_buf(&i2c_xfers[i], 1); 351 + xfer[i].data = i2c_xfers[i].buf; 352 352 xfer[i].data_len = i2c_xfers[i].len; 353 353 xfer[i].rnw = i2c_xfers[i].flags & I2C_M_RD; 354 354 hci->cmd->prep_i2c_xfer(hci, dev, &xfer[i]); ··· 374 374 } 375 375 376 376 out: 377 - for (i = 0; i < nxfers; i++) 378 - i2c_put_dma_safe_msg_buf(xfer[i].data, &i2c_xfers[i], 379 - ret ? false : true); 380 - 381 377 hci_free_xfer(xfer, nxfers); 382 378 return ret; 383 379 }