aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2018-08-14 16:44:59 +1000
committerStewart Smith <stewart@linux.ibm.com>2018-08-15 22:41:30 -0500
commitf737777b34382d5293901c4a5040b1fad05294a0 (patch)
treefad321bd1b38abcb503af472b0319ea44960db0a /core
parent3b9bc869a4fee22c99a4d24ba87ce938d46b11f4 (diff)
downloadskiboot-f737777b34382d5293901c4a5040b1fad05294a0.zip
skiboot-f737777b34382d5293901c4a5040b1fad05294a0.tar.gz
skiboot-f737777b34382d5293901c4a5040b1fad05294a0.tar.bz2
i2c: Fix multiple-enqueue of the same request on NACK
i2c_request_send() will retry the request if the error is a NAK, however it forgets to clear the "ud.done" flag. It will thus loop again and try to re-enqueue the same request causing internal request list corruption. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
Diffstat (limited to 'core')
-rw-r--r--core/i2c.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/core/i2c.c b/core/i2c.c
index d4311c2..070a0f6 100644
--- a/core/i2c.c
+++ b/core/i2c.c
@@ -224,11 +224,10 @@ int i2c_request_send(int bus_id, int dev_addr, int read_write,
rc = ud.rc;
- if (rc == OPAL_I2C_NACK_RCVD)
- continue;
- else
- /* error or success */
+ /* error or success */
+ if (rc != OPAL_I2C_NACK_RCVD)
break;
+ ud.done = false;
}
prlog(PR_DEBUG, "I2C: %s req op=%x offset=%x buf=%016llx buflen=%d "