[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6D29D0765AB5632A+aVHiZ9Wph0hNzqDY@kernel.org>
Date: Mon, 29 Dec 2025 10:07:35 +0800
From: Troy Mitchell <troy.mitchell@...ux.spacemit.com>
To: Alex Elder <elder@...cstar.com>,
Troy Mitchell <troy.mitchell@...ux.spacemit.com>,
Andi Shyti <andi.shyti@...nel.org>, Yixun Lan <dlan@...too.org>,
Aurelien Jarno <aurelien@...el32.net>,
Michael Opdenacker <michael.opdenacker@...tcommit.com>,
Troy Mitchell <troymitchell988@...il.com>
Cc: linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-riscv@...ts.infradead.org, spacemit@...ts.linux.dev
Subject: Re: [PATCH v5 2/2] i2c: spacemit: introduce pio for k1
> > @@ -474,6 +608,11 @@ static void spacemit_i2c_calc_timeout(struct spacemit_i2c_dev *i2c)
> > unsigned long timeout;
> > int idx = 0, cnt = 0;
> > + if (i2c->use_pio) {
> > + i2c->adapt.timeout = msecs_to_jiffies(SPACEMIT_WAIT_TIMEOUT);
>
> Again, why is a rough 1000 millisecond timeout OK for PIO, while a
> fairly precise timeout value based on the number of bytes to be
> transferred and the transfer bit rate computed for interrupt mode?
Sorry I didn't see this.
In interrupt-driven mode we wait for a single completion event, so the
timeout needs to reflect the worst-case transfer duration to avoid
spurious timeouts.
In PIO mode the loop is driven by FIFO/status progress, and the timeout
is only a safeguard against a stalled bus rather than an exact transfer
time.
Therefore a simple conservative value is sufficient there.
- Troy
Powered by blists - more mailing lists