Module Name: src Committed By: martin Date: Tue Dec 7 11:25:12 UTC 2021
Modified Files: src/sys/dev/i2c [netbsd-9]: spdmem_i2c.c Log Message: Pull up the following revisions, requested by msaitoh in ticket #1388: sys/dev/i2c/spdmem_i2c.c 1.23-1.25 via patch - Carefully access to the I2C bus in the match function. - Improve bank reset code for DDR4. To generate a diff of this commit: cvs rdiff -u -r1.17 -r1.17.4.1 src/sys/dev/i2c/spdmem_i2c.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/i2c/spdmem_i2c.c diff -u src/sys/dev/i2c/spdmem_i2c.c:1.17 src/sys/dev/i2c/spdmem_i2c.c:1.17.4.1 --- src/sys/dev/i2c/spdmem_i2c.c:1.17 Sat Oct 20 03:23:05 2018 +++ src/sys/dev/i2c/spdmem_i2c.c Tue Dec 7 11:25:12 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: spdmem_i2c.c,v 1.17 2018/10/20 03:23:05 macallan Exp $ */ +/* $NetBSD: spdmem_i2c.c,v 1.17.4.1 2021/12/07 11:25:12 martin Exp $ */ /* * Copyright (c) 2007 Nicolas Joly @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: spdmem_i2c.c,v 1.17 2018/10/20 03:23:05 macallan Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spdmem_i2c.c,v 1.17.4.1 2021/12/07 11:25:12 martin Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -115,7 +115,11 @@ spdmem_reset_page(struct spdmem_i2c_soft */ rv = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr, ®, 1, &byte0, 1, I2C_F_POLL); - rv |= iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr, ®, 1, + if (rv != 0) + goto error; + + reg = 2; + rv = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr, ®, 1, &byte2, 1, I2C_F_POLL); if (rv != 0) goto error;