spi_qsd: Fix for SPI Operational State Invalid error
This error is reproted randomly when the SPI core is put into RUN state and occurs when the ACPU clock is low. When the timer expires, we check again to ensure that the STATE_VALID bit is set before returning. CRs-fixed: 304672 Signed-off-by: Harini Jayaraman <harinij@codeaurora.org>
This commit is contained in:
committed by
Bryan Huntsman
parent
b823cd5750
commit
bcef77324e
@@ -837,14 +837,19 @@ static inline int msm_spi_wait_valid(struct msm_spi *dd)
|
|||||||
*/
|
*/
|
||||||
if (delay < SPI_DELAY_THRESHOLD)
|
if (delay < SPI_DELAY_THRESHOLD)
|
||||||
delay = SPI_DELAY_THRESHOLD;
|
delay = SPI_DELAY_THRESHOLD;
|
||||||
timeout = jiffies + msecs_to_jiffies(delay * SPI_DEFAULT_TIMEOUT);
|
|
||||||
|
/* Adding one to round off to the nearest jiffy */
|
||||||
|
timeout = jiffies + msecs_to_jiffies(delay * SPI_DEFAULT_TIMEOUT) + 1;
|
||||||
while (!msm_spi_is_valid_state(dd)) {
|
while (!msm_spi_is_valid_state(dd)) {
|
||||||
if (time_after(jiffies, timeout)) {
|
if (time_after(jiffies, timeout)) {
|
||||||
if (dd->cur_msg)
|
if (!msm_spi_is_valid_state(dd)) {
|
||||||
dd->cur_msg->status = -EIO;
|
if (dd->cur_msg)
|
||||||
dev_err(dd->dev, "%s: SPI operational state not valid"
|
dd->cur_msg->status = -EIO;
|
||||||
"\n", __func__);
|
dev_err(dd->dev, "%s: SPI operational state"
|
||||||
return -1;
|
"not valid\n", __func__);
|
||||||
|
return -ETIMEDOUT;
|
||||||
|
} else
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* For smaller values of delay, context switch time
|
* For smaller values of delay, context switch time
|
||||||
|
|||||||
Reference in New Issue
Block a user