Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1416937 > unrolled thread
| Started by | Jan Glauber <jglauber@cavium.com> |
|---|---|
| First post | 2016-06-08 09:00 +0200 |
| Last post | 2016-06-09 22:10 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 0/3] Bug fixes for octeon driver Jan Glauber <jglauber@cavium.com> - 2016-06-08 09:00 +0200
[PATCH 1/3] i2c: octeon: Missing AAK flag in case of I2C_M_RECV_LEN Jan Glauber <jglauber@cavium.com> - 2016-06-08 09:00 +0200
Re: [PATCH 1/3] i2c: octeon: Missing AAK flag in case of I2C_M_RECV_LEN Wolfram Sang <wsa@the-dreams.de> - 2016-06-09 22:10 +0200
| From | Jan Glauber <jglauber@cavium.com> |
|---|---|
| Date | 2016-06-08 09:00 +0200 |
| Subject | [PATCH 0/3] Bug fixes for octeon driver |
| Message-ID | <rHFD3-58f-3@gated-at.bofh.it> |
Testing ipmi_ssif on ThunderX several bugs were found that also apply to the Octeon i2c driver changes coming with 4.7. I'll need to rebase the pending ThunderX driver series after this fixes which I'll do shortly. Please consider for 4.7. thanks, Jan Jan Glauber (3): i2c: octeon: Missing AAK flag in case of I2C_M_RECV_LEN i2c: octeon: Add retry logic after receiving STAT_RXADDR_NAK i2c: octeon: Avoid printk after too long SMBUS message drivers/i2c/busses/i2c-octeon.c | 45 ++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 14 deletions(-) -- 2.9.0.rc0.21.g7777322
[toc] | [next] | [standalone]
| From | Jan Glauber <jglauber@cavium.com> |
|---|---|
| Date | 2016-06-08 09:00 +0200 |
| Subject | [PATCH 1/3] i2c: octeon: Missing AAK flag in case of I2C_M_RECV_LEN |
| Message-ID | <rHFD4-58f-17@gated-at.bofh.it> |
| In reply to | #1416937 |
During receive the controller requires the AAK flag for all
bytes but the final one. This was wrong in case of I2C_M_RECV_LEN,
where the decision if the final byte is to be transmitted
happened before adding the additional received length byte.
Set the AAK flag if additional bytes are to be received.
Signed-off-by: Jan Glauber <jglauber@cavium.com>
---
drivers/i2c/busses/i2c-octeon.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/i2c/busses/i2c-octeon.c b/drivers/i2c/busses/i2c-octeon.c
index aa5f01e..1922e4a 100644
--- a/drivers/i2c/busses/i2c-octeon.c
+++ b/drivers/i2c/busses/i2c-octeon.c
@@ -934,8 +934,15 @@ static int octeon_i2c_read(struct octeon_i2c *i2c, int target,
return result;
for (i = 0; i < length; i++) {
- /* for the last byte TWSI_CTL_AAK must not be set */
- if (i + 1 == length)
+ /*
+ * For the last byte to receive TWSI_CTL_AAK must not be set.
+ *
+ * A special case is I2C_M_RECV_LEN where we don't know the
+ * additional length yet. If recv_len is set we assume we're
+ * not reading the final byte and therefore need to set
+ * TWSI_CTL_AAK.
+ */
+ if ((i + 1 == length) && !(recv_len && i == 0))
final_read = true;
/* clear iflg to allow next event */
--
2.9.0.rc0.21.g7777322
[toc] | [prev] | [next] | [standalone]
| From | Wolfram Sang <wsa@the-dreams.de> |
|---|---|
| Date | 2016-06-09 22:10 +0200 |
| Subject | Re: [PATCH 1/3] i2c: octeon: Missing AAK flag in case of I2C_M_RECV_LEN |
| Message-ID | <rIer7-2Lw-11@gated-at.bofh.it> |
| In reply to | #1416940 |
[Multipart message — attachments visible in raw view] — view raw
On Wed, Jun 08, 2016 at 08:51:17AM +0200, Jan Glauber wrote: > During receive the controller requires the AAK flag for all > bytes but the final one. This was wrong in case of I2C_M_RECV_LEN, > where the decision if the final byte is to be transmitted > happened before adding the additional received length byte. > > Set the AAK flag if additional bytes are to be received. > > Signed-off-by: Jan Glauber <jglauber@cavium.com> Applied to for-current, thanks!
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web