mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Aniket RANDIVE <aniket.randive@oss.qualcomm.com>
To: Mukesh Savaliya <mukesh.savaliya@oss.qualcomm.com>,
	Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
	Viken Dadhaniya <viken.dadhaniya@oss.qualcomm.com>,
	Andi Shyti <andi.shyti@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH v1 1/3] dmaengine: qcom: gpi: Add I2C bus recovery opcode support
Date: Fri, 9 Oct 2026 11:05:57 +0530	[thread overview]
Message-ID: <9fc86230-772c-44db-92bd-8ed842969c16@oss.qualcomm.com> (raw)
In-Reply-To: <fa7e7439-6f17-4dad-9c9b-6793ac7cfdf3@oss.qualcomm.com>



On 9/7/2026 10:44 AM, Mukesh Savaliya wrote:
> 
> 
> On 8/26/2026 3:21 PM, Aniket Randive wrote:
>> The I2C_BUS_CLEAR and I2C_STOP_ON_BUS GENI sequencer opcodes release a
>> stuck I2C bus, but the GPI DMA driver has no way to emit these
>> zero-payload control commands, so an I2C controller using GPI DMA
>> cannot recover the bus.
>>
>> Add I2C_BUS_CLEAR and I2C_STOP_ON_BUS to enum i2c_op so I2C drivers can
>> request them through gpi_i2c_config.op. Handle them in
>> gpi_create_i2c_tre() by emitting a CONFIG TRE (when set_config is set)
>> followed by a GO TRE with IEOT set and no DMA TRE, and reserve the
>> matching number of ring entries in gpi_prep_slave_sg().
>>
> 
> start with problem statement which is being fixed by the respective patch.
> 
> Rest of the message can be simplified as below - more you can add.
> 
> Allow GPI DMA clients to issue the GENI I2C_BUS_CLEAR and
> I2C_STOP_ON_BUS commands used for I2C bus recovery.
> 
> Add the new opcodes to the GPI I2C interface and generate the
> corresponding CONFIG/GO TRE sequence without data DMA transfers.
> Adjust TRE reservation logic to account for these commands.
> 

I will update the commit message.

>> Signed-off-by: Aniket Randive <aniket.randive@oss.qualcomm.com>
>> ---
>>   drivers/dma/qcom/gpi.c           | 30 ++++++++++++++++++++++++++++++
>>   include/linux/dma/qcom-gpi-dma.h |  2 ++
>>   2 files changed, 32 insertions(+)
>>
>> diff --git a/drivers/dma/qcom/gpi.c b/drivers/dma/qcom/gpi.c
> 
> [...]
> 
>> @@ -1825,6 +1843,18 @@ gpi_prep_slave_sg(struct dma_chan *chan, struct 
>> scatterlist *sgl,
>>           nr_tre = 2;
>>       if (direction == DMA_DEV_TO_MEM) /* rx */
>>           nr_tre = 1;
>> +    /*
>> +     * Recovery opcodes do not require DMA data TREs, only CONFIG
>> +     * (for set_config) and GO TREs. Since gpi_prep_slave_sg() is
>> +     * shared with SPI, verify the channel is I2C before accessing
> Not only SPI, its for all GENI protocols. Can say common function for 
> all protocols.
> 

sure. I will make it generic instead of single protocol.
> May be once such conditions are rising, we need to think of better way 
> in design to handle such cases.
>> +     * the configuration data.
>> +     */
>> +    if (gchan->protocol == QCOM_GPI_I2C) {
>> +        struct gpi_i2c_config *i2c = gchan->config;
>> +
>> +        if (i2c->op == I2C_BUS_CLEAR || i2c->op == I2C_STOP_ON_BUS)
>> +            nr_tre = set_config ? 2 : 1;
>> +    }
> 
> [...]
> 


  reply	other threads:[~2026-10-09  5:36 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-26  9:51 [PATCH 0/3] i2c: qcom-geni: Add I2C bus recovery support Aniket Randive
2026-08-26  9:51 ` [PATCH v1 1/3] dmaengine: qcom: gpi: Add I2C bus recovery opcode support Aniket Randive
2026-09-07  5:14   ` Mukesh Savaliya
2026-10-09  5:35     ` Aniket RANDIVE [this message]
2026-08-26  9:51 ` [PATCH v1 2/3] i2c: qcom-geni: Add bus recovery support for FIFO mode Aniket Randive
2026-09-03 16:17   ` Jyothi Kumar Seerapu
2026-09-07  6:05     ` Mukesh Savaliya
2026-09-07  6:10       ` Mukesh Savaliya
2026-10-09  6:58     ` Aniket RANDIVE
2026-08-26  9:51 ` [PATCH v1 3/3] i2c: qcom-geni: Add bus recovery support for GPI DMA mode Aniket Randive
2026-09-03 16:14   ` Jyothi Kumar Seerapu
2026-09-07  6:46     ` Mukesh Savaliya
2026-10-09 11:29     ` Aniket RANDIVE

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9fc86230-772c-44db-92bd-8ed842969c16@oss.qualcomm.com \
    --to=aniket.randive@oss.qualcomm.com \
    --cc=Frank.Li@kernel.org \
    --cc=andi.shyti@kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mukesh.savaliya@oss.qualcomm.com \
    --cc=viken.dadhaniya@oss.qualcomm.com \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®