Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1645582

Re: [PATCH] i2c: mxs: dont print error on NAK

From Wolfram Sang <wsa@the-dreams.de>
Newsgroups linux.kernel
Subject Re: [PATCH] i2c: mxs: dont print error on NAK
Date 2017-05-19 14:50 +0200
Message-ID <tIPvZ-2eo-33@gated-at.bofh.it> (permalink)
References <tIuBb-3UN-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

On Thu, May 18, 2017 at 04:14:50PM +0200, Michael Thalmeier wrote:
> When mxs_i2c_pio_wait_xfer_end returns with a return code of -ENXIO, the
> NO_SLAVE_ACK_IRQ bit is set in CTRL1.
> In this case, do not print an error message, because every NAK would
> otherwise generate a new message.

Why not also for the read case?

Also, I think all the error printing for mxs_i2c_pio_wait_xfer_end()
could go. NAK can happen on the bus as well as timeouts, e.g. EEPROMs
currently erasing a page. Upper layers ought to handle that.

Thanks,

   Wolfram

> 
> Signed-off-by: Michael Thalmeier <michael.thalmeier@hale.at>
> ---
>  drivers/i2c/busses/i2c-mxs.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c
> index 5738556..e2dbb9c 100644
> --- a/drivers/i2c/busses/i2c-mxs.c
> +++ b/drivers/i2c/busses/i2c-mxs.c
> @@ -527,7 +527,7 @@ static int mxs_i2c_pio_setup_xfer(struct i2c_adapter *adap,
>  
>  			/* Wait for the end of the transfer. */
>  			ret = mxs_i2c_pio_wait_xfer_end(i2c);
> -			if (ret) {
> +			if (ret && ret != -ENXIO) {
>  				dev_err(i2c->dev,
>  					"PIO: Failed to finish WRITE cmd!\n");
>  				break;
> -- 
> 2.9.2
> 

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH] i2c: mxs: dont print error on NAK Michael Thalmeier <michael.thalmeier@hale.at> - 2017-05-18 16:30 +0200
  Re: [PATCH] i2c: mxs: dont print error on NAK Wolfram Sang <wsa@the-dreams.de> - 2017-05-19 14:50 +0200

csiph-web