Hello Alexey, On 03-11-21, 05:13, Alexey Minnekhanov wrote: > 19.10.2021 09:01, Vinod Koul wrote: > > This adds capability to use GSI DMA for I2C transfers > > > > Signed-off-by: Vinod Koul <vkoul@xxxxxxxxxx> > > --- > > Changes since v3: > > - remove separate tx and rx function for gsi dma and make a common one > > - remove global structs and use local variables instead > > > > Hi, I've tried this patch on sm8150 board and I'm seeing weird things: > > [ 0.428829] gpi c00000.dma-controller: Adding to iommu group 0 > [ 0.480453] geni_se_qup cc0000.geniqup: Adding to iommu group 1 > [ 0.484019] geni_i2c c80000.i2c: Bus frequency not specified, default to > 100kHz. > [ 0.487172] geni_i2c c80000.i2c: error 0000000000000000: Failed to get tx > DMA ch > [ 0.495499] geni_i2c c80000.i2c: error 0000000000000000: Failed to get rx > DMA ch > [ 0.499842] geni_i2c c80000.i2c: Grabbed GPI dma channels > [ 0.504784] geni_i2c c80000.i2c: Using GPI DMA mode for I2C > [ 0.510812] geni_i2c c80000.i2c: Geni-I2C adaptor successfully added > > It seems weird to me that it "failed to get DMA channels", but then says > anyway "Grabbed GPI DMA channels" and "Using GPI DMA mode for I2C". > > What I did in dts is basically include sm8150.dtsi and do > > &gpi_dma2 { > status = "okay"; > }; > > &i2c17 { > status = "okay"; > dmas = <&gpi_dma2 0 0 QCOM_GPI_I2C>, > <&gpi_dma2 1 0 QCOM_GPI_I2C>; > dma-names = "tx", "rx"; > /* empty - no clients */ > } > > Another observation, even if I comment out "dmas" and "dma-names" in i2c17 > node, I get > > [ 0.487037] geni_i2c c80000.i2c: error (____ptrval____): Failed to get tx > DMA ch > [ 0.490077] geni_i2c c80000.i2c: error (____ptrval____): Failed to get rx > DMA ch > [ 0.493077] geni_i2c c80000.i2c: Grabbed GPI dma channels > [ 0.496061] geni_i2c c80000.i2c: Using GPI DMA mode for I2C > [ 0.500155] geni_i2c c80000.i2c: Geni-I2C adaptor successfully added This does not look correct. In absence of dmas property, the channel allocation should not have gone ahead and you should not see " Grabbed GPI dma channels" message! Btw what is the output of below when dmas was commented out: cat /sys/kernel/debug/dmaengine/summary This would show the channels allocated to each controller -- ~Vinod