Patch "i2c: xiic: improve error message when transfer fails to start" has been added to the 6.10-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    i2c: xiic: improve error message when transfer fails to start

to the 6.10-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     i2c-xiic-improve-error-message-when-transfer-fails-t.patch
and it can be found in the queue-6.10 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 83a82ba1e8968937b9cc3189d485b864ec3b14bb
Author: Marc Ferland <marc.ferland@xxxxxxxxxxxx>
Date:   Mon May 13 12:03:24 2024 -0400

    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@xxxxxxxxxxxx>
    Acked-by: Michal Simek <michal.simek@xxxxxxx>
    Signed-off-by: Andi Shyti <andi.shyti@xxxxxxxxxx>
    Stable-dep-of: 1d4a1adbed25 ("i2c: xiic: Try re-initialization on bus busy timeout")
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/i2c/busses/i2c-xiic.c b/drivers/i2c/busses/i2c-xiic.c
index 71391b590adae..19468565120e1 100644
--- a/drivers/i2c/busses/i2c-xiic.c
+++ b/drivers/i2c/busses/i2c-xiic.c
@@ -1105,8 +1105,11 @@ static int xiic_start_xfer(struct xiic_i2c *i2c, struct i2c_msg *msgs, int num)
 	mutex_lock(&i2c->lock);
 
 	ret = xiic_busy(i2c);
-	if (ret)
+	if (ret) {
+		dev_err(i2c->adap.dev.parent,
+			"cannot start a transfer while busy\n");
 		goto out;
+	}
 
 	i2c->tx_msg = msgs;
 	i2c->rx_msg = NULL;
@@ -1164,10 +1167,8 @@ static int xiic_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
 		return err;
 
 	err = xiic_start_xfer(i2c, msgs, num);
-	if (err < 0) {
-		dev_err(adap->dev.parent, "Error xiic_start_xfer\n");
+	if (err < 0)
 		goto out;
-	}
 
 	err = wait_for_completion_timeout(&i2c->completion, XIIC_XFER_TIMEOUT);
 	mutex_lock(&i2c->lock);




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux