Re: [V3] i2c: i2c-qcom-geni: Correct I2C TRE sequence

From: Andi Shyti
Date: Thu Feb 01 2024 - 09:23:31 EST


Hi Viken,

On Thu, Feb 01, 2024 at 03:43:23PM +0530, Viken Dadhaniya wrote:
> For i2c read operation in GSI mode, we are getting timeout
> due to malformed TRE basically incorrect TRE sequence
> in gpi(drivers/dma/qcom/gpi.c) driver.
>
> TRE stands for Transfer Ring Element - which is basically an element with
> size of 4 words. It contains all information like slave address,
> clk divider, dma address value data size etc).
>
> Mainly we have 3 TREs(Config, GO and DMA tre).
> - CONFIG TRE : consists of internal register configuration which is
> required before start of the transfer.
> - DMA TRE : contains DDR/Memory address, called as DMA descriptor.
> - GO TRE : contains Transfer directions, slave ID, Delay flags, Length
> of the transfer.
>
> Driver calls GPI driver API to config each TRE depending on the protocol.
> If we see GPI driver, for RX operation we are configuring DMA tre and
> for TX operation we are configuring GO tre.
>
> For read operation tre sequence will be as below which is not aligned
> to hardware programming guide.
>
> - CONFIG tre
> - DMA tre
> - GO tre
>
> As per Qualcomm's internal Hardware Programming Guide, we should configure
> TREs in below sequence for any RX only transfer.
>
> - CONFIG tre
> - GO tre
> - DMA tre
>
> In summary, for RX only transfers, we are reordering DMA and GO TREs.
> Tested covering i2c read/write transfer on QCM6490 RB3 board.
>
> Fixes: d8703554f4de ("i2c: qcom-geni: Add support for GPI DMA")
> Signed-off-by: Viken Dadhaniya <quic_vdadhani@xxxxxxxxxxx>

as Dmitry has written, please, next time don't forget the tags:

Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx>
Tested-by: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx> # qrb5165-rb5

You can also add mine:

Reviewed-by: Andi Shyti <andi.shyti@xxxxxxxxxx>

Please make sure to Cc Dmitry who is raising his concerns and
check on his comments.

Andi

PS just as a reminder, if Dmitry's concerns remain related only
to the commit log, I gave you the option to agree with him in the
e-mail thread without necessarily sending a v4. I can then update
the commit log before pushing.