[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ivxsr6vvchk4eiih3mkwrmskquywuzit33ibt4hrxwif5k6h3z@rxx4q2jhrrli>
Date: Tue, 17 Jun 2025 23:59:48 +0200
From: Andi Shyti <andi.shyti@...nel.org>
To: Alex Elder <elder@...cstar.com>
Cc: dlan@...too.org, troymitchell988@...il.com, linux-i2c@...r.kernel.org,
spacemit@...ts.linux.dev, linux-riscv@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3] i2c: k1: check for transfer error
Hi Alex,
On Mon, Jun 16, 2025 at 07:51:36AM -0500, Alex Elder wrote:
> If spacemit_i2c_xfer_msg() times out waiting for a message transfer to
> complete, or if the hardware reports an error, it returns a negative
> error code (-ETIMEDOUT, -EAGAIN, -ENXIO. or -EIO).
>
> The sole caller of spacemit_i2c_xfer_msg() is spacemit_i2c_xfer(),
> which is the i2c_algorithm->xfer callback function. It currently
> does not save the value returned by spacemit_i2c_xfer_msg().
>
> The result is that transfer errors go unreported, and a caller
> has no indication anything is wrong.
>
> When this code was out for review, the return value *was* checked
> in early versions. But for some reason, that assignment got dropped
> between versions 5 and 6 of the series, perhaps related to reworking
> the code to merge spacemit_i2c_xfer_core() into spacemit_i2c_xfer().
>
> Simply assigning the value returned to "ret" fixes the problem.
>
> Fixes: 5ea558473fa31 ("i2c: spacemit: add support for SpacemiT K1 SoC")
> Signed-off-by: Alex Elder <elder@...cstar.com>
> Reviewed-by: Troy Mitchell <troymitchell988@...il.com>
merged to i2c/i2c-host-fixes.
Thanks,
Andi
Powered by blists - more mailing lists