public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Benoît Monin" <benoit.monin@bootlin.com>
To: David LaPorte <dalaport@amazon.com>
Cc: andi.shyti@kernel.org, andriy.shevchenko@linux.intel.com,
	bala.senthil@intel.com, bigeasy@linutronix.de,
	clrkwllms@kernel.org, dmitry.guzman@mobileye.com,
	gregory.clement@bootlin.com, jarkko.nikula@linux.intel.com,
	jsd@semihalf.com, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-rt-devel@lists.linux.dev,
	mika.westerberg@linux.intel.com, rostedt@goodmis.org,
	tamal.saha@intel.com, tawfik.bayouk@mobileye.com,
	theo.lebrun@bootlin.com, thomas.petazzoni@bootlin.com,
	vladimir.kondratiev@mobileye.com, wsa@kernel.org, dgj@amazon.com,
	gunnarku@amazon.com
Subject: Re: [PATCH v6 3/3] i2c: designware: Support of controller with IC_EMPTYFIFO_HOLD_MASTER disabled
Date: Wed, 06 May 2026 10:57:19 +0200	[thread overview]
Message-ID: <4KD0mYZGRSm8xhs1ywPcFA@bootlin.com> (raw)
In-Reply-To: <20260505232244.71807-1-dalaport@amazon.com>

Hi David,

On Wednesday, 6 May 2026 at 01:22:42 CEST, David LaPorte wrote:
> Hi all,
> 
> I don't have Keem Bay hardware, but reviewing this against the existing driver I think this hunk may regress the multi-master support added by commit f4e0ba52a89f ("i2c: designware: Do not complete i2c read without RX_FULL interrupt"):
> 
> /* Abort if we detect a STOP in the middle of a read or a write */
> if ((stat & DW_IC_INTR_STOP_DET) &&
>     (dev->status & (STATUS_READ_IN_PROGRESS | STATUS_WRITE_IN_PROGRESS))) {
>     dev_err(dev->dev, "spurious STOP detected\n");
>     dev->rx_outstanding = 0;
>     dev->msg_err = -EIO;
> }
> 
> That commit handles the case where STOP_DET is observed before the final RX_FULL. The new check aborts on that intermediate state.
> 
> The sibling TX-side underrun check in i2c_dw_xfer_msg() is gated on !emptyfifo_hold_master; this one isn't. I couldn't find discussion of the interaction in the v1–v6 review history so flagging in case it was an oversight.
> 
> A minimal fix matching the TX-side gating:
> 
> - /* Abort if we detect a STOP in the middle of a read or a write */
> - if ((stat & DW_IC_INTR_STOP_DET) &&
> + /*
> +  * Abort if we detect a STOP in the middle of a read or a write on
> +  * controllers that do not hold SCL on FIFO underrun.
> +  */
> + if (!dev->emptyfifo_hold_master &&
> +     (stat & DW_IC_INTR_STOP_DET) &&
>       (dev->status & (STATUS_READ_IN_PROGRESS | STATUS_WRITE_IN_PROGRESS))) {
>     dev_err(dev->dev, "spurious STOP detected\n");
>     dev->rx_outstanding = 0;
> 
> Happy to send as a proper patch if that's the right direction, or to be corrected.
> 
So Keem Bay hardware can get a STOP_DET interrupt while a read is in
progress? If that's the case then yes it is not a spurious STOP and
limiting the check to controllers that don't hold SCL on Tx FIFO underrun
should fix that.

Best regards,
-- 
Benoît Monin, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com




  reply	other threads:[~2026-05-06  8:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-30 15:52 [PATCH v6 0/3] i2c: designware: Improve support of multi-messages transfer Benoît Monin
2026-01-30 15:52 ` [PATCH v6 1/3] i2c: designware: Implement I2C_M_STOP support Benoît Monin
2026-01-30 15:52 ` [PATCH v6 2/3] i2c: designware: Use runtime PM macro for auto-cleanup Benoît Monin
2026-01-30 15:52 ` [PATCH v6 3/3] i2c: designware: Support of controller with IC_EMPTYFIFO_HOLD_MASTER disabled Benoît Monin
2026-05-05 23:22   ` David LaPorte
2026-05-06  8:57     ` Benoît Monin [this message]
2026-02-03 12:01 ` [PATCH v6 0/3] i2c: designware: Improve support of multi-messages transfer Andy Shevchenko
2026-02-04  1:24 ` Andi Shyti

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=4KD0mYZGRSm8xhs1ywPcFA@bootlin.com \
    --to=benoit.monin@bootlin.com \
    --cc=andi.shyti@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bala.senthil@intel.com \
    --cc=bigeasy@linutronix.de \
    --cc=clrkwllms@kernel.org \
    --cc=dalaport@amazon.com \
    --cc=dgj@amazon.com \
    --cc=dmitry.guzman@mobileye.com \
    --cc=gregory.clement@bootlin.com \
    --cc=gunnarku@amazon.com \
    --cc=jarkko.nikula@linux.intel.com \
    --cc=jsd@semihalf.com \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=mika.westerberg@linux.intel.com \
    --cc=rostedt@goodmis.org \
    --cc=tamal.saha@intel.com \
    --cc=tawfik.bayouk@mobileye.com \
    --cc=theo.lebrun@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=vladimir.kondratiev@mobileye.com \
    --cc=wsa@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