public inbox for linux-i2c@vger.kernel.org
 help / color / mirror / Atom feed
From: David LaPorte <dalaport@amazon.com>
To: <benoit.monin@bootlin.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: Tue, 5 May 2026 16:22:42 -0700	[thread overview]
Message-ID: <20260505232244.71807-1-dalaport@amazon.com> (raw)
In-Reply-To: <20260130-i2c-dw-v6-3-08ca1e9ece07@bootlin.com>

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.

Thanks,
David

  reply	other threads:[~2026-05-05 23:22 UTC|newest]

Thread overview: 7+ 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 [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=20260505232244.71807-1-dalaport@amazon.com \
    --to=dalaport@amazon.com \
    --cc=andi.shyti@kernel.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bala.senthil@intel.com \
    --cc=benoit.monin@bootlin.com \
    --cc=bigeasy@linutronix.de \
    --cc=clrkwllms@kernel.org \
    --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