]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
i2c: octeon: Prevent error message on bus error
authorJan Glauber <jglauber@cavium.com>
Wed, 7 Mar 2018 16:11:33 +0000 (17:11 +0100)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 15 Mar 2018 13:29:07 +0000 (08:29 -0500)
BugLink: https://bugs.launchpad.net/bugs/1754076
The error message:

[Fri Feb 16 13:42:13 2018] i2c-thunderx 0000:01:09.4: unhandled state: 0

is mis-leading as state 0 (bus error) is not an unknown state.

Return -EIO as before but avoid printing the message. Also rename
STAT_ERROR to STATE_BUS_ERROR.

Signed-off-by: Jan Glauber <jglauber@cavium.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
(cherry picked from commit 7c4246797b84e55e2dfaaf8a18033de9df7c18c1)
Signed-off-by: dann frazier <dann.frazier@canonical.com>
Acked-by: Stefan Bader <stefan.bader@canonical.com>
Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/i2c/busses/i2c-octeon-core.c
drivers/i2c/busses/i2c-octeon-core.h

index 1d87757990568c40b9cebe4df7dda54fe21918f7..d9607905dc2f1dd0db15c6ca457ebc445921d829 100644 (file)
@@ -233,6 +233,7 @@ static int octeon_i2c_check_status(struct octeon_i2c *i2c, int final_read)
                return -EOPNOTSUPP;
 
        case STAT_TXDATA_NAK:
+       case STAT_BUS_ERROR:
                return -EIO;
        case STAT_TXADDR_NAK:
        case STAT_RXADDR_NAK:
index a7ef19855bb8fa9b0670d7406652e1aa214e76c6..9bb9f64fdda0392364638ecbaafe3fab5612baf6 100644 (file)
@@ -43,7 +43,7 @@
 #define TWSI_CTL_AAK           0x04    /* Assert ACK */
 
 /* Status values */
-#define STAT_ERROR             0x00
+#define STAT_BUS_ERROR         0x00
 #define STAT_START             0x08
 #define STAT_REP_START         0x10
 #define STAT_TXADDR_ACK                0x18