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-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging

Pull i2c subsystem fixes from Jean Delvare.

* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
i2c-algo-bit: Fix spurious SCL timeouts under heavy load
i2c-core: Comment says "transmitted" but means "received"

+15 -5
+7 -1
drivers/i2c/algos/i2c-algo-bit.c
··· 103 103 * chips may hold it low ("clock stretching") while they 104 104 * are processing data internally. 105 105 */ 106 - if (time_after(jiffies, start + adap->timeout)) 106 + if (time_after(jiffies, start + adap->timeout)) { 107 + /* Test one last time, as we may have been preempted 108 + * between last check and timeout test. 109 + */ 110 + if (getscl(adap)) 111 + break; 107 112 return -ETIMEDOUT; 113 + } 108 114 cond_resched(); 109 115 } 110 116 #ifdef DEBUG
+8 -4
drivers/i2c/i2c-core.c
··· 1386 1386 1387 1387 ret = i2c_transfer(adap, &msg, 1); 1388 1388 1389 - /* If everything went ok (i.e. 1 msg transmitted), return #bytes 1390 - transmitted, else error code. */ 1389 + /* 1390 + * If everything went ok (i.e. 1 msg transmitted), return #bytes 1391 + * transmitted, else error code. 1392 + */ 1391 1393 return (ret == 1) ? count : ret; 1392 1394 } 1393 1395 EXPORT_SYMBOL(i2c_master_send); ··· 1416 1414 1417 1415 ret = i2c_transfer(adap, &msg, 1); 1418 1416 1419 - /* If everything went ok (i.e. 1 msg transmitted), return #bytes 1420 - transmitted, else error code. */ 1417 + /* 1418 + * If everything went ok (i.e. 1 msg received), return #bytes received, 1419 + * else error code. 1420 + */ 1421 1421 return (ret == 1) ? count : ret; 1422 1422 } 1423 1423 EXPORT_SYMBOL(i2c_master_recv);