diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2018-08-14 16:44:59 +1000 |
---|---|---|
committer | Stewart Smith <stewart@linux.ibm.com> | 2018-08-15 22:41:30 -0500 |
commit | f737777b34382d5293901c4a5040b1fad05294a0 (patch) | |
tree | fad321bd1b38abcb503af472b0319ea44960db0a /core | |
parent | 3b9bc869a4fee22c99a4d24ba87ce938d46b11f4 (diff) | |
download | skiboot-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.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -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 " |