mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@the-dreams.de>
To: Michael Thalmeier <michael.thalmeier@hale.at>
Cc: linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
	Marek Vasut <marex@denx.de>,
	michael@thalmeier.at
Subject: Re: [PATCH] i2c: mxs: dont print error on NAK
Date: Fri, 19 May 2017 14:44:02 +0200	[thread overview]
Message-ID: <20170519124402.4xkaguxjzgyvbwcl@ninjato> (raw)
In-Reply-To: <20170518141450.30938-1-michael.thalmeier@hale.at>

[-- Attachment #1: Type: text/plain, Size: 1257 bytes --]

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
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-05-19 12:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-18 14:14 Michael Thalmeier
2017-05-19 12:44 ` Wolfram Sang [this message]
2017-05-31  9:40   ` [PATCH] i2c: mxs: change error printing to debug for mxs_i2c_pio_wait_xfer_end Michael Thalmeier
2017-06-02 20:58     ` Wolfram Sang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170519124402.4xkaguxjzgyvbwcl@ninjato \
    --to=wsa@the-dreams.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=michael.thalmeier@hale.at \
    --cc=michael@thalmeier.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®