From: Jan Glauber <jan.glauber@caviumnetworks.com>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org,
David Daney <ddaney@caviumnetworks.com>
Subject: Re: [PATCH v6 06/19] i2c: octeon: Improve error status checking
Date: Thu, 14 Apr 2016 10:10:05 +0200 [thread overview]
Message-ID: <20160414081005.GC2532@hardcore> (raw)
In-Reply-To: <20160413085519.GF1563@katana>
On Wed, Apr 13, 2016 at 10:55:20AM +0200, Wolfram Sang wrote:
>
> Please have a look at Documentation/i2c/fault-codes. -EAGAIN is only for
> arbitration loss.
>
> > + /* ACK allowed on pre-terminal bytes only */
> > + case STAT_RXDATA_ACK:
> > + if (!final_read)
> > + return 0;
> > + return -EAGAIN;
> > +
> > + /* NAK allowed on terminal byte only */
> > + case STAT_RXDATA_NAK:
> > + if (final_read)
> > + return 0;
> > + return -EAGAIN;
>
> -EIO? Can this happen? It is the master who sends the NAK, so we are in
> control of that.
If it happens not in the final_read part then it is an error, so -EIO
would be better suited. Also for the other error codes I will follow your
suggestion.
Should I resend the whole series or will you review the other patches
before?
Thanks,
Jan
> > +
> > + /* Arbitration lost */
> > + case STAT_LOST_ARB_38:
> > + case STAT_LOST_ARB_68:
> > + case STAT_LOST_ARB_78:
> > + case STAT_LOST_ARB_B0:
> > + return -EAGAIN;
>
> OK.
>
> > +
> > + /* Being addressed as slave, should back off & listen */
> > + case STAT_SLAVE_60:
> > + case STAT_SLAVE_70:
> > + case STAT_GENDATA_ACK:
> > + case STAT_GENDATA_NAK:
> > + return -EIO;
>
> -EOPNOTSUPP?
>
> > +
> > + /* Core busy as slave */
> > + case STAT_SLAVE_80:
> > + case STAT_SLAVE_88:
> > + case STAT_SLAVE_A0:
> > + case STAT_SLAVE_A8:
> > + case STAT_SLAVE_LOST:
> > + case STAT_SLAVE_NAK:
> > + case STAT_SLAVE_ACK:
> > + return -EIO;
>
> -EOPNOTSUPP?
>
> > + case STAT_TXDATA_NAK:
>
> -EIO?
>
> > + case STAT_TXADDR_NAK:
> > + case STAT_RXADDR_NAK:
> > + case STAT_AD2W_NAK:
>
> -ENXIO?
>
> > + return -EAGAIN;
> > + default:
> > + dev_err(i2c->dev, "unhandled state: %d\n", stat);
> > + return -EIO;
>
> OK.
>
WARNING: multiple messages have this Message-ID (diff)
From: Jan Glauber <jan.glauber@caviumnetworks.com>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: <linux-kernel@vger.kernel.org>, <linux-i2c@vger.kernel.org>,
David Daney <ddaney@caviumnetworks.com>
Subject: Re: [PATCH v6 06/19] i2c: octeon: Improve error status checking
Date: Thu, 14 Apr 2016 10:10:05 +0200 [thread overview]
Message-ID: <20160414081005.GC2532@hardcore> (raw)
In-Reply-To: <20160413085519.GF1563@katana>
On Wed, Apr 13, 2016 at 10:55:20AM +0200, Wolfram Sang wrote:
>
> Please have a look at Documentation/i2c/fault-codes. -EAGAIN is only for
> arbitration loss.
>
> > + /* ACK allowed on pre-terminal bytes only */
> > + case STAT_RXDATA_ACK:
> > + if (!final_read)
> > + return 0;
> > + return -EAGAIN;
> > +
> > + /* NAK allowed on terminal byte only */
> > + case STAT_RXDATA_NAK:
> > + if (final_read)
> > + return 0;
> > + return -EAGAIN;
>
> -EIO? Can this happen? It is the master who sends the NAK, so we are in
> control of that.
If it happens not in the final_read part then it is an error, so -EIO
would be better suited. Also for the other error codes I will follow your
suggestion.
Should I resend the whole series or will you review the other patches
before?
Thanks,
Jan
> > +
> > + /* Arbitration lost */
> > + case STAT_LOST_ARB_38:
> > + case STAT_LOST_ARB_68:
> > + case STAT_LOST_ARB_78:
> > + case STAT_LOST_ARB_B0:
> > + return -EAGAIN;
>
> OK.
>
> > +
> > + /* Being addressed as slave, should back off & listen */
> > + case STAT_SLAVE_60:
> > + case STAT_SLAVE_70:
> > + case STAT_GENDATA_ACK:
> > + case STAT_GENDATA_NAK:
> > + return -EIO;
>
> -EOPNOTSUPP?
>
> > +
> > + /* Core busy as slave */
> > + case STAT_SLAVE_80:
> > + case STAT_SLAVE_88:
> > + case STAT_SLAVE_A0:
> > + case STAT_SLAVE_A8:
> > + case STAT_SLAVE_LOST:
> > + case STAT_SLAVE_NAK:
> > + case STAT_SLAVE_ACK:
> > + return -EIO;
>
> -EOPNOTSUPP?
>
> > + case STAT_TXDATA_NAK:
>
> -EIO?
>
> > + case STAT_TXADDR_NAK:
> > + case STAT_RXADDR_NAK:
> > + case STAT_AD2W_NAK:
>
> -ENXIO?
>
> > + return -EAGAIN;
> > + default:
> > + dev_err(i2c->dev, "unhandled state: %d\n", stat);
> > + return -EIO;
>
> OK.
>
next prev parent reply other threads:[~2016-04-14 8:10 UTC|newest]
Thread overview: 54+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-11 15:28 [PATCH v6 00/19] i2c-octeon and i2c-thunderx drivers Jan Glauber
2016-04-11 15:28 ` [PATCH v6 01/19] i2c: octeon: Increase retry default and use fixed timeout value Jan Glauber
2016-04-13 8:39 ` Wolfram Sang
2016-04-11 15:28 ` [PATCH v6 02/19] i2c: octeon: Move set-clock and init-lowlevel upward Jan Glauber
2016-04-13 8:39 ` Wolfram Sang
2016-04-11 15:28 ` [PATCH v6 03/19] i2c: octeon: Rename [read|write]_sw to reg_[read|write] Jan Glauber
2016-04-13 8:44 ` Wolfram Sang
2016-04-14 7:58 ` Jan Glauber
2016-04-14 7:58 ` Jan Glauber
2016-04-14 8:58 ` Wolfram Sang
2016-04-11 15:28 ` [PATCH v6 04/19] i2c: octeon: Introduce helper functions for register access Jan Glauber
2016-04-13 8:45 ` Wolfram Sang
2016-04-14 8:05 ` Jan Glauber
2016-04-14 8:05 ` Jan Glauber
2016-04-14 8:58 ` Wolfram Sang
2016-04-11 15:28 ` [PATCH v6 05/19] i2c: octeon: Remove superfluous check in octeon_i2c_test_iflg Jan Glauber
2016-04-14 8:59 ` Wolfram Sang
2016-04-11 15:28 ` [PATCH v6 06/19] i2c: octeon: Improve error status checking Jan Glauber
2016-04-13 8:55 ` Wolfram Sang
2016-04-14 8:10 ` Jan Glauber [this message]
2016-04-14 8:10 ` Jan Glauber
2016-04-14 9:01 ` Wolfram Sang
2016-04-11 15:28 ` [PATCH v6 07/19] i2c: octeon: Use i2c recovery framework Jan Glauber
2016-04-20 21:31 ` Wolfram Sang
2016-04-21 13:08 ` Jan Glauber
2016-04-21 13:08 ` Jan Glauber
2016-04-21 13:54 ` Wolfram Sang
2016-04-21 17:51 ` Jan Glauber
2016-04-21 17:51 ` Jan Glauber
2016-04-21 21:33 ` Wolfram Sang
2016-04-11 15:28 ` [PATCH v6 08/19] i2c: octeon: Enable High-Level Controller Jan Glauber
2016-04-20 21:43 ` Wolfram Sang
2016-04-20 21:55 ` David Daney
2016-04-20 21:55 ` David Daney
2016-04-21 13:40 ` Jan Glauber
2016-04-21 13:40 ` Jan Glauber
2016-04-21 13:55 ` Wolfram Sang
2016-04-21 14:10 ` Jan Glauber
2016-04-21 14:10 ` Jan Glauber
2016-04-11 15:28 ` [PATCH v6 09/19] dt-bindings: i2c: Add Octeon cn78xx TWSI Jan Glauber
2016-04-11 15:28 ` [PATCH v6 10/19] i2c: octeon: Add support for cn78xx chips Jan Glauber
2016-04-20 21:52 ` Wolfram Sang
2016-04-20 22:28 ` David Daney
2016-04-20 22:28 ` David Daney
2016-04-25 21:45 ` Wolfram Sang
2016-04-11 15:28 ` [PATCH v6 11/19] i2c: octeon: Flush TWSI writes with readback Jan Glauber
2016-04-11 15:28 ` [PATCH v6 12/19] i2c: octeon: Faster operation when IFLG signals late Jan Glauber
2016-04-11 15:28 ` [PATCH v6 13/19] i2c: octeon: Add workaround for broken irqs on CN3860 Jan Glauber
2016-04-11 15:28 ` [PATCH v6 14/19] i2c: octeon: Move read function before write Jan Glauber
2016-04-11 15:28 ` [PATCH v6 15/19] i2c: octeon: Rename driver to prepare for split Jan Glauber
2016-04-11 15:28 ` [PATCH v6 16/19] i2c: octeon: Split the driver into two parts Jan Glauber
2016-04-11 15:28 ` [PATCH v6 17/19] i2c: thunderx: Add i2c driver for ThunderX SOC Jan Glauber
2016-04-11 15:28 ` [PATCH v6 18/19] i2c: octeon,thunderx: Move register offsets to struct Jan Glauber
2016-04-11 15:28 ` [PATCH v6 19/19] i2c: thunderx: Add smbus alert support Jan Glauber
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=20160414081005.GC2532@hardcore \
--to=jan.glauber@caviumnetworks.com \
--cc=ddaney@caviumnetworks.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=wsa@the-dreams.de \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.