Linux I2C development
 help / color / mirror / Atom feed
From: Mukesh Savaliya <mukesh.savaliya@oss.qualcomm.com>
To: Praveen Talari <praveen.talari@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 v2 3/3] i2c: qcom-geni: distinguish address-phase and data-phase NACK
Date: Fri, 10 Jul 2026 17:06:55 +0530	[thread overview]
Message-ID: <1ff522f6-88cb-428a-91c2-5f7f9fc9929d@oss.qualcomm.com> (raw)
In-Reply-To: <20260709-fix_cancel_sequence_on_failure_for_i2c-v2-3-1db178c695bb@oss.qualcomm.com>



On 7/9/2026 9:50 AM, Praveen Talari wrote:
> The M_GP_IRQ_1 interrupt signals a NACK condition, but does not
> distinguish whether it occurred during the address phase or the data
> phase.  The driver always attempted cancel and DMA FSM reset on any
> NACK, which is incorrect for an address NACK since the DMA engine was
> never armed and the hardware requires no recovery.
> 
> Add geni_i2c_check_addr_data_nack() to distinguish the two cases by
> reading SE_GENI_M_GP_LENGTH after the NACK event.  A zero value means
> the address phase was NACKed (ADDR_NACK) and no DMA recovery is needed.
> A non-zero value on a write transfer means a data byte was NACKed
> (DATA_NACK) and the normal cancel and DMA FSM reset path must run.
> 
> 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 | 29 ++++++++++++++++++++---------
>   1 file changed, 20 insertions(+), 9 deletions(-)

[...]

>   #define I2C_AUTO_SUSPEND_DELAY	250
> @@ -143,7 +144,8 @@ struct geni_i2c_err_log {
>   
>   static const struct geni_i2c_err_log gi2c_log[] = {
>   	[GP_IRQ0] = {-EIO, "Unknown I2C err GP_IRQ0"},
> -	[NACK] = {-ENXIO, "NACK: slv unresponsive, check its power/reset-ln"},
> +	[ADDR_NACK] = {-ENXIO, "NACK: slv unresponsive, check its power/reset-ln"},
Now slv could be target device, follow latest convention.
> +	[DATA_NACK] = {-EIO, "Data NACK: device NACK before end of TX"},
Minor: Instead of before end of TX, could be simply TX transfer NACK ?
>   	[GP_IRQ2] = {-EIO, "Unknown I2C err GP IRQ2"},
>   	[BUS_PROTO] = {-EPROTO, "Bus proto err, noisy/unexpected start/stop"},
>   	[ARB_LOST] = {-EAGAIN, "Bus arbitration lost, clock line undriveable"},
> @@ -258,7 +260,8 @@ static void geni_i2c_err(struct geni_i2c_dev *gi2c, int err)
>   

[...]

      reply	other threads:[~2026-07-10 11:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-09  4:20 [PATCH v2 0/3] i2c: qcom-geni: improve transfer error recovery and synchronization Praveen Talari
2026-07-09  4:20 ` [PATCH v2 1/3] i2c: qcom-geni: use cancel command before abort on transfer timeout Praveen Talari
2026-07-09  4:20 ` [PATCH v2 2/3] i2c: qcom-geni: use dedicated completions for abort and reset events Praveen Talari
2026-07-10  6:28   ` Mukesh Savaliya
2026-07-09  4:20 ` [PATCH v2 3/3] i2c: qcom-geni: distinguish address-phase and data-phase NACK Praveen Talari
2026-07-10 11:36   ` Mukesh Savaliya [this message]

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=1ff522f6-88cb-428a-91c2-5f7f9fc9929d@oss.qualcomm.com \
    --to=mukesh.savaliya@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=naresh.maramaina@oss.qualcomm.com \
    --cc=praveen.talari@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