mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 15:10:38 +00:00
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"
This commit is contained in:
commit
7c32442ff8
@ -103,8 +103,14 @@ static int sclhi(struct i2c_algo_bit_data *adap)
|
|||||||
* chips may hold it low ("clock stretching") while they
|
* chips may hold it low ("clock stretching") while they
|
||||||
* are processing data internally.
|
* are processing data internally.
|
||||||
*/
|
*/
|
||||||
if (time_after(jiffies, start + adap->timeout))
|
if (time_after(jiffies, start + adap->timeout)) {
|
||||||
|
/* Test one last time, as we may have been preempted
|
||||||
|
* between last check and timeout test.
|
||||||
|
*/
|
||||||
|
if (getscl(adap))
|
||||||
|
break;
|
||||||
return -ETIMEDOUT;
|
return -ETIMEDOUT;
|
||||||
|
}
|
||||||
cond_resched();
|
cond_resched();
|
||||||
}
|
}
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
@ -1386,8 +1386,10 @@ int i2c_master_send(const struct i2c_client *client, const char *buf, int count)
|
|||||||
|
|
||||||
ret = i2c_transfer(adap, &msg, 1);
|
ret = i2c_transfer(adap, &msg, 1);
|
||||||
|
|
||||||
/* If everything went ok (i.e. 1 msg transmitted), return #bytes
|
/*
|
||||||
transmitted, else error code. */
|
* If everything went ok (i.e. 1 msg transmitted), return #bytes
|
||||||
|
* transmitted, else error code.
|
||||||
|
*/
|
||||||
return (ret == 1) ? count : ret;
|
return (ret == 1) ? count : ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(i2c_master_send);
|
EXPORT_SYMBOL(i2c_master_send);
|
||||||
@ -1414,8 +1416,10 @@ int i2c_master_recv(const struct i2c_client *client, char *buf, int count)
|
|||||||
|
|
||||||
ret = i2c_transfer(adap, &msg, 1);
|
ret = i2c_transfer(adap, &msg, 1);
|
||||||
|
|
||||||
/* If everything went ok (i.e. 1 msg transmitted), return #bytes
|
/*
|
||||||
transmitted, else error code. */
|
* If everything went ok (i.e. 1 msg received), return #bytes received,
|
||||||
|
* else error code.
|
||||||
|
*/
|
||||||
return (ret == 1) ? count : ret;
|
return (ret == 1) ? count : ret;
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(i2c_master_recv);
|
EXPORT_SYMBOL(i2c_master_recv);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user