diff options
author | Harini Katakam <harinik@xilinx.com> | 2014-04-11 08:36:28 +0200 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-04-14 18:07:02 +0200 |
commit | eee668a92bc775030178c8a7f0d0abe9cce441d7 (patch) | |
tree | 78c9c5f3d03b35d716f2051236534ab0ee92c1f2 /drivers/spi/spi.c | |
parent | Linux 3.15-rc1 (diff) | |
download | linux-eee668a92bc775030178c8a7f0d0abe9cce441d7.tar.xz linux-eee668a92bc775030178c8a7f0d0abe9cce441d7.zip |
spi: core: Increase timeout value
The existing timeout value in wait_for_completion_timeout is
calculated from the transfer length and speed with tolerance of 10msec.
This is too low because this is used for error conditions such as
hardware hang etc.
The xfer->speed_hz considered may not be the actual speed set
because the best clock divisor is chosen from a limited set such that
the actual speed <= requested speed. This will lead to timeout being
less than actual transfer time.
Considering acceptable latencies, this timeout can be set to a
value double the expected transfer plus 100 msecs.
This patch adds the same in the core.
Signed-off-by: Harini Katakam <harinik@xilinx.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/spi/spi.c')
-rw-r--r-- | drivers/spi/spi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c index 4eb9bf02996c..f01cbb41e6ca 100644 --- a/drivers/spi/spi.c +++ b/drivers/spi/spi.c @@ -775,7 +775,7 @@ static int spi_transfer_one_message(struct spi_master *master, if (ret > 0) { ret = 0; ms = xfer->len * 8 * 1000 / xfer->speed_hz; - ms += 10; /* some tolerance */ + ms += ms + 100; /* some tolerance */ ms = wait_for_completion_timeout(&master->xfer_completion, msecs_to_jiffies(ms)); |