]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
i2c: xiic: improve error message when transfer fails to start
authorMarc Ferland <marc.ferland@sonatest.com>
Mon, 13 May 2024 16:03:24 +0000 (12:03 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:11:22 +0000 (15:11 +0200)
commit5ffff2b57d8fdf5e73104bf67c329a3dae124847
tree67a574cd30fa43cb47b828a65e426360c3941d91
parent72cb227a368cf286efb8ce1e741e8c7085747b4d
i2c: xiic: improve error message when transfer fails to start

[ Upstream commit ee1691d0ae103ba7fd9439800ef454674fadad27 ]

xiic_start_xfer can fail for different reasons:

- EBUSY: bus is busy or i2c messages still in tx_msg or rx_msg
- ETIMEDOUT: timed-out trying to clear the RX fifo
- EINVAL: wrong clock settings

Both EINVAL and ETIMEDOUT will currently print a specific error
message followed by a generic one, for example:

    Failed to clear rx fifo
    Error xiic_start_xfer

however EBUSY will simply output the generic message:

    Error xiic_start_xfer

which is not really helpful.

This commit adds a new error message when a busy condition is detected
and also removes the generic message since it does not provide any
relevant information to the user.

Signed-off-by: Marc Ferland <marc.ferland@sonatest.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Signed-off-by: Andi Shyti <andi.shyti@kernel.org>
Stable-dep-of: 1d4a1adbed25 ("i2c: xiic: Try re-initialization on bus busy timeout")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/i2c/busses/i2c-xiic.c