mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-31 12:10:52 -04:00
mfd: cros_ec: spi: Calculate delay between transfers correctly
To avoid spamming the EC we calculate the time between the previous transfer and the current transfer and force a delay if the time delta is too small. However, a small miscalculation causes the delay period to be far too short. Most noticably this impacts commands with a long turnaround time such as EC firmware reads and writes. Signed-off-by: David Hendricks <[email protected]> Signed-off-by: Doug Anderson <[email protected]> Reviewed-by: Simon Glass <[email protected]> Tested-by: Andrew Bresticker <[email protected]> Tested-by: Stephen Warren <[email protected]> Signed-off-by: Lee Jones <[email protected]>
This commit is contained in:
parent
d1cb4cc905
commit
1fe368665b
1 changed files with 1 additions and 1 deletions
|
|
@ -219,7 +219,7 @@ static int cros_ec_command_spi_xfer(struct cros_ec_device *ec_dev,
|
|||
ktime_get_ts(&ts);
|
||||
delay = timespec_to_ns(&ts) - ec_spi->last_transfer_ns;
|
||||
if (delay < EC_SPI_RECOVERY_TIME_NS)
|
||||
ndelay(delay);
|
||||
ndelay(EC_SPI_RECOVERY_TIME_NS - delay);
|
||||
}
|
||||
|
||||
/* Transmit phase - send our message */
|
||||
|
|
|
|||
Loading…
Reference in a new issue