diff mbox series

[Bionic,SRU,Artful,SRU,Xenial] i2c: octeon: Prevent error message on bus error

Message ID 20180307161132.GA14885@xps13.dannf
State New
Headers show
Series [Bionic,SRU,Artful,SRU,Xenial] i2c: octeon: Prevent error message on bus error | expand

Commit Message

dann frazier March 7, 2018, 4:11 p.m. UTC
From: Jan Glauber <jglauber@cavium.com>

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>
---
 drivers/i2c/busses/i2c-octeon-core.c | 1 +
 drivers/i2c/busses/i2c-octeon-core.h | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

Comments

Stefan Bader March 12, 2018, 10:17 a.m. UTC | #1
On 07.03.2018 17:11, dann frazier wrote:
> From: Jan Glauber <jglauber@cavium.com>
> 
> 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>

> ---
>  drivers/i2c/busses/i2c-octeon-core.c | 1 +
>  drivers/i2c/busses/i2c-octeon-core.h | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-octeon-core.c b/drivers/i2c/busses/i2c-octeon-core.c
> index 1d8775799056..d9607905dc2f 100644
> --- a/drivers/i2c/busses/i2c-octeon-core.c
> +++ b/drivers/i2c/busses/i2c-octeon-core.c
> @@ -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:
> diff --git a/drivers/i2c/busses/i2c-octeon-core.h b/drivers/i2c/busses/i2c-octeon-core.h
> index a7ef19855bb8..9bb9f64fdda0 100644
> --- a/drivers/i2c/busses/i2c-octeon-core.h
> +++ b/drivers/i2c/busses/i2c-octeon-core.h
> @@ -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
>
Kleber Sacilotto de Souza March 12, 2018, 3:58 p.m. UTC | #2
On 03/07/18 17:11, dann frazier wrote:
> From: Jan Glauber <jglauber@cavium.com>
> 
> 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: Kleber Sacilotto de Souza <kleber.souza@canonical.com>

> ---
>  drivers/i2c/busses/i2c-octeon-core.c | 1 +
>  drivers/i2c/busses/i2c-octeon-core.h | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-octeon-core.c b/drivers/i2c/busses/i2c-octeon-core.c
> index 1d8775799056..d9607905dc2f 100644
> --- a/drivers/i2c/busses/i2c-octeon-core.c
> +++ b/drivers/i2c/busses/i2c-octeon-core.c
> @@ -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:
> diff --git a/drivers/i2c/busses/i2c-octeon-core.h b/drivers/i2c/busses/i2c-octeon-core.h
> index a7ef19855bb8..9bb9f64fdda0 100644
> --- a/drivers/i2c/busses/i2c-octeon-core.h
> +++ b/drivers/i2c/busses/i2c-octeon-core.h
> @@ -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
>
Kleber Sacilotto de Souza March 12, 2018, 4:03 p.m. UTC | #3
On 03/07/18 17:11, dann frazier wrote:
> From: Jan Glauber <jglauber@cavium.com>
> 
> 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>
> ---
>  drivers/i2c/busses/i2c-octeon-core.c | 1 +
>  drivers/i2c/busses/i2c-octeon-core.h | 2 +-
>  2 files changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-octeon-core.c b/drivers/i2c/busses/i2c-octeon-core.c
> index 1d8775799056..d9607905dc2f 100644
> --- a/drivers/i2c/busses/i2c-octeon-core.c
> +++ b/drivers/i2c/busses/i2c-octeon-core.c
> @@ -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:
> diff --git a/drivers/i2c/busses/i2c-octeon-core.h b/drivers/i2c/busses/i2c-octeon-core.h
> index a7ef19855bb8..9bb9f64fdda0 100644
> --- a/drivers/i2c/busses/i2c-octeon-core.h
> +++ b/drivers/i2c/busses/i2c-octeon-core.h
> @@ -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
> 

Applied to xenial/master-next and artful/master-next-backlog branches.

Thanks,
Kleber
Seth Forshee March 15, 2018, 1:10 p.m. UTC | #4
On Wed, Mar 07, 2018 at 05:11:33PM +0100, dann frazier wrote:
> From: Jan Glauber <jglauber@cavium.com>
> 
> 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>

Applied to bionic/master-next, thanks!
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-octeon-core.c b/drivers/i2c/busses/i2c-octeon-core.c
index 1d8775799056..d9607905dc2f 100644
--- a/drivers/i2c/busses/i2c-octeon-core.c
+++ b/drivers/i2c/busses/i2c-octeon-core.c
@@ -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:
diff --git a/drivers/i2c/busses/i2c-octeon-core.h b/drivers/i2c/busses/i2c-octeon-core.h
index a7ef19855bb8..9bb9f64fdda0 100644
--- a/drivers/i2c/busses/i2c-octeon-core.h
+++ b/drivers/i2c/busses/i2c-octeon-core.h
@@ -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