Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fix from Wolfram Sang:
"Here is the revert for the regression of the i2c-octeon driver I
mentioned last time. I wished for a bit more feedback, but all people
working actively on it are in need of this patch, so here it goes"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
Revert "i2c: octeon: thunderx: Limit register access retries"

+12 -19
+1 -3
drivers/i2c/busses/i2c-octeon-core.c
··· 381 381 if (result) 382 382 return result; 383 383 384 - data[i] = octeon_i2c_data_read(i2c, &result); 385 - if (result) 386 - return result; 384 + data[i] = octeon_i2c_data_read(i2c); 387 385 if (recv_len && i == 0) { 388 386 if (data[i] > I2C_SMBUS_BLOCK_MAX + 1) 389 387 return -EPROTO;
+11 -16
drivers/i2c/busses/i2c-octeon-core.h
··· 5 5 #include <linux/i2c.h> 6 6 #include <linux/i2c-smbus.h> 7 7 #include <linux/io.h> 8 - #include <linux/iopoll.h> 9 8 #include <linux/kernel.h> 10 9 #include <linux/pci.h> 11 10 ··· 144 145 u64 tmp; 145 146 146 147 __raw_writeq(SW_TWSI_V | eop_reg | data, i2c->twsi_base + SW_TWSI(i2c)); 147 - 148 - readq_poll_timeout(i2c->twsi_base + SW_TWSI(i2c), tmp, tmp & SW_TWSI_V, 149 - I2C_OCTEON_EVENT_WAIT, i2c->adap.timeout); 148 + do { 149 + tmp = __raw_readq(i2c->twsi_base + SW_TWSI(i2c)); 150 + } while ((tmp & SW_TWSI_V) != 0); 150 151 } 151 152 152 153 #define octeon_i2c_ctl_write(i2c, val) \ ··· 163 164 * 164 165 * The I2C core registers are accessed indirectly via the SW_TWSI CSR. 165 166 */ 166 - static inline int octeon_i2c_reg_read(struct octeon_i2c *i2c, u64 eop_reg, 167 - int *error) 167 + static inline u8 octeon_i2c_reg_read(struct octeon_i2c *i2c, u64 eop_reg) 168 168 { 169 169 u64 tmp; 170 - int ret; 171 170 172 171 __raw_writeq(SW_TWSI_V | eop_reg | SW_TWSI_R, i2c->twsi_base + SW_TWSI(i2c)); 172 + do { 173 + tmp = __raw_readq(i2c->twsi_base + SW_TWSI(i2c)); 174 + } while ((tmp & SW_TWSI_V) != 0); 173 175 174 - ret = readq_poll_timeout(i2c->twsi_base + SW_TWSI(i2c), tmp, 175 - tmp & SW_TWSI_V, I2C_OCTEON_EVENT_WAIT, 176 - i2c->adap.timeout); 177 - if (error) 178 - *error = ret; 179 176 return tmp & 0xFF; 180 177 } 181 178 182 179 #define octeon_i2c_ctl_read(i2c) \ 183 - octeon_i2c_reg_read(i2c, SW_TWSI_EOP_TWSI_CTL, NULL) 184 - #define octeon_i2c_data_read(i2c, error) \ 185 - octeon_i2c_reg_read(i2c, SW_TWSI_EOP_TWSI_DATA, error) 180 + octeon_i2c_reg_read(i2c, SW_TWSI_EOP_TWSI_CTL) 181 + #define octeon_i2c_data_read(i2c) \ 182 + octeon_i2c_reg_read(i2c, SW_TWSI_EOP_TWSI_DATA) 186 183 #define octeon_i2c_stat_read(i2c) \ 187 - octeon_i2c_reg_read(i2c, SW_TWSI_EOP_TWSI_STAT, NULL) 184 + octeon_i2c_reg_read(i2c, SW_TWSI_EOP_TWSI_STAT) 188 185 189 186 /** 190 187 * octeon_i2c_read_int - read the TWSI_INT register