Closed z3ntu closed 1 year ago
Seems to work, sent an adjusted version upstream: https://lore.kernel.org/linux-arm-msm/20230422-msm8953-blsp-dma-v1-1-0024801bb587@z3ntu.xyz/T/ & pull request in #87
For testing I've also used this to force short transfers to go via DMA too since my peripherals don't have long messages:
diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c
index 2e153f2f71b6..2665acf059bd 100644
--- a/drivers/i2c/busses/i2c-qup.c
+++ b/drivers/i2c/busses/i2c-qup.c
@@ -1522,8 +1522,9 @@ qup_i2c_determine_mode_v2(struct qup_i2c_dev *qup,
total_len += msgs[idx].len;
}
- if (!no_dma && qup->is_dma &&
- (total_len > qup->out_fifo_sz || total_len > qup->in_fifo_sz)) {
+ printk(KERN_ERR "%s:%d DBG no_dma=%d is_dma=%d total_len=%u out_fifo_sz=%d in_fifo_sz=%d\n", __func__, __LINE__, no_dma, qup->is_dma, total_len, qup->out_fifo_sz, qup->in_fifo_sz);
+ if (!no_dma && qup->is_dma /*&&
+ (total_len > qup->out_fifo_sz || total_len > qup->in_fifo_sz)*/) {
qup->use_dma = true;
} else {
qup->blk.is_tx_blk_mode = max_tx_len > qup->out_fifo_sz -
@@ -1567,6 +1568,7 @@ static int qup_i2c_xfer_v2(struct i2c_adapter *adap,
goto out;
}
+ printk(KERN_ERR "%s:%d DBG use_dma=%d\n", __func__, __LINE__, qup->use_dma);
if (qup->use_dma) {
reinit_completion(&qup->xfer);
ret = qup_i2c_bam_xfer(adap, &msgs[0], num);
The patch has been in mainline since v6.5-rc1, closing.
Need to check if blsp dma works with something like the following diff:
edit: doesn't seem relevant for now but spi uses
qcom,bam-consumer-pipe-index
&qcom,bam-producer-pipe-index
; and for uartqcom,bam-tx-ep-pipe-index
&qcom,bam-rx-ep-pipe-index
for the indexes, notdmas
property like i2c downstream