From: Paul Cercueil <paul.cercueil@bootlin.com>
To: Robert Richter <rric@kernel.org>, Andi Shyti <andi.shyti@kernel.org>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
Sunil Kovvuri Goutham <sgoutham@marvell.com>,
Umesh Kumar <ukumar@marvell.com>,
Shashank Gupta <shashankg@marvell.com>,
Tanmay Jagdale <tanmay@marvell.com>,
Paul Cercueil <paul.cercueil@bootlin.com>
Subject: [PATCH 3/3] i2c: thunderx: Use polling with delay in HS mode
Date: Wed, 4 Nov 2026 11:49:12 +0100 [thread overview]
Message-ID: <20261104104912.166301-4-paul.cercueil@bootlin.com> (raw)
In-Reply-To: <20261104104912.166301-1-paul.cercueil@bootlin.com>
From: Tanmay Jagdale <tanmay@marvell.com>
High I2C transaction latencies exceeding 1 second were intermittently
observed while operating in HS mode. These delays caused DTLS handshakes
between the main processor and firmware processors to time out,
resulting in increased startup time.
Replace the existing wait mechanism with delayed polling in HS mode to
improve transfer responsiveness and avoid prolonged latency spikes.
Signed-off-by: Tanmay Jagdale <tanmay@marvell.com>
Co-developed-by: Paul Cercueil <paul.cercueil@bootlin.com>
Signed-off-by: Paul Cercueil <paul.cercueil@bootlin.com>
---
drivers/i2c/busses/i2c-octeon-core.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/i2c/busses/i2c-octeon-core.c b/drivers/i2c/busses/i2c-octeon-core.c
index 9f72ec1feaa0..4c05d2d00cbe 100644
--- a/drivers/i2c/busses/i2c-octeon-core.c
+++ b/drivers/i2c/busses/i2c-octeon-core.c
@@ -15,6 +15,7 @@
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
+#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/pci.h>
@@ -65,6 +66,9 @@ static int octeon_i2c_wait(struct octeon_i2c *i2c)
return octeon_i2c_test_iflg(i2c) ? 0 : -ETIMEDOUT;
}
+ if (!IS_LS_FREQ(i2c->twsi_freq))
+ return poll_timeout_us_atomic(, octeon_i2c_test_iflg(i2c), 1, 1000, false);
+
i2c->int_enable(i2c);
time_left = wait_event_timeout(i2c->queue, octeon_i2c_test_iflg(i2c),
i2c->adap.timeout);
--
2.47.3
prev parent reply other threads:[~2026-11-04 10:49 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-04 10:49 [PATCH 0/3] i2c: octeon/thunderx: Fix DMA mask + improvements Paul Cercueil
2026-11-04 10:49 ` [PATCH 1/3] i2c: octeon: Add error state recovery Paul Cercueil
2026-11-04 10:49 ` [PATCH 2/3] i2c: thunderx: Set DMA mask Paul Cercueil
2026-11-04 10:49 ` Paul Cercueil [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=20261104104912.166301-4-paul.cercueil@bootlin.com \
--to=paul.cercueil@bootlin.com \
--cc=andi.shyti@kernel.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=rric@kernel.org \
--cc=sgoutham@marvell.com \
--cc=shashankg@marvell.com \
--cc=tanmay@marvell.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=ukumar@marvell.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
all inboxes | Powered by JetHome®