Linux I2C development
 help / color / mirror / Atom feed
From: Praveen Talari <praveen.talari@oss.qualcomm.com>
To: Mukesh Savaliya <mukesh.savaliya@oss.qualcomm.com>,
	Viken Dadhaniya <viken.dadhaniya@oss.qualcomm.com>,
	Andi Shyti <andi.shyti@kernel.org>
Cc: linux-arm-msm@vger.kernel.org, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Naresh Maramaina <naresh.maramaina@oss.qualcomm.com>
Subject: Re: [PATCH 2/3] i2c: qcom-geni: use dedicated completions for abort and reset events
Date: Wed, 8 Jul 2026 14:53:52 +0530	[thread overview]
Message-ID: <5d206010-a35e-460d-9b11-7dbaa8a56add@oss.qualcomm.com> (raw)
In-Reply-To: <6167cdea-50d0-4319-9f4d-1f1b349600df@oss.qualcomm.com>

Hi Mukesh,

On 08-07-2026 13:05, Mukesh Savaliya wrote:
>
>
> On 7/8/2026 11:45 AM, Praveen Talari wrote:
>> The driver uses the shared gi2c->done completion for transfer, abort,
> shared => common completion event for transfer, abort and DMA reset
Sure.
>> and DMA reset operations. This allows unrelated completion events to
>> prematurely wake abort and reset waiters, leading to incorrect
>> synchronization.
> Aren't they in sequence i.e. one after another ?

If the IRQ is triggered late, it can impact the subsequent transfer 
because gi2c->done may be cleared before the delayed interrupt is handled.

>>
>> Introduce dedicated completions for abort, TX reset, and RX reset
>> operations, and signal them only from their respective interrupt
>> events. This removes the dependency on shared completion state and
>> eliminates the abort_done flag-based synchronization.
>>
>> Co-developed-by: Naresh Maramaina <naresh.maramaina@oss.qualcomm.com>
>> Signed-off-by: Naresh Maramaina <naresh.maramaina@oss.qualcomm.com>
>> Signed-off-by: Praveen Talari <praveen.talari@oss.qualcomm.com>
>> ---
>>   drivers/i2c/busses/i2c-qcom-geni.c | 54 
>> +++++++++++++++++++-------------------
>>   1 file changed, 27 insertions(+), 27 deletions(-)
>>
>> diff --git a/drivers/i2c/busses/i2c-qcom-geni.c 
>> b/drivers/i2c/busses/i2c-qcom-geni.c
>> index 15403edb355a..9490aee4928c 100644
>> --- a/drivers/i2c/busses/i2c-qcom-geni.c
>> +++ b/drivers/i2c/busses/i2c-qcom-geni.c
>> @@ -113,7 +113,10 @@ struct geni_i2c_dev {
>>       int err;
>>       struct i2c_adapter adap;
>>       struct completion done;
>> +    struct completion abort_done;
>>       struct completion cancel_done;
>> +    struct completion tx_reset_done;
>> +    struct completion rx_reset_done;
> tx or rx, any one would be running. Not both right ?
> if so, i suggest to keep common dma_reset_done.

As explained above, there is a possibility that a delayed IRQ may occur 
while another reset operation is still in progress, potentially 
affecting the reset sequence.

Thanks,

Praveen Talari

>>       struct i2c_msg *cur;
>>       int cur_wr;
>>       int cur_rd;
>> @@ -127,7 +130,6 @@ struct geni_i2c_dev {
> [..]
>

  reply	other threads:[~2026-07-08  9:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-08  6:15 [PATCH 0/3] i2c: qcom-geni: improve transfer error recovery and synchronization Praveen Talari
2026-07-08  6:15 ` [PATCH 1/3] i2c: qcom-geni: use cancel command before abort on transfer timeout Praveen Talari
2026-07-08  7:35   ` Mukesh Savaliya
2026-07-08  9:17     ` Praveen Talari
2026-07-08  6:15 ` [PATCH 2/3] i2c: qcom-geni: use dedicated completions for abort and reset events Praveen Talari
2026-07-08  7:35   ` Mukesh Savaliya
2026-07-08  9:23     ` Praveen Talari [this message]
2026-07-08  6:15 ` [PATCH 3/3] i2c: qcom-geni: Avoid unnecessary transfer cancel on address NACK Praveen Talari
2026-07-08  9:41   ` Mukesh Savaliya
2026-07-08  7:35 ` [PATCH 0/3] i2c: qcom-geni: improve transfer error recovery and synchronization Mukesh Savaliya

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=5d206010-a35e-460d-9b11-7dbaa8a56add@oss.qualcomm.com \
    --to=praveen.talari@oss.qualcomm.com \
    --cc=andi.shyti@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=naresh.maramaina@oss.qualcomm.com \
    --cc=viken.dadhaniya@oss.qualcomm.com \
    /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