[PATCH] spi: pl022: Remove timeout in polling mode operation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Some tests show, that bulk SPI accesses (255 bytes, maximum PL022 can) may
take seconds, depending on CPU load. In this case vital SPI accesses can
fail because of user-space applications. Some other drivers already do not
have timeouts in polling mode.

Signed-off-by: Alexander Sverdlin <alexander.sverdlin@xxxxxxxxx>
---
 drivers/spi/spi-pl022.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c
index 1af8c96b940e..1816774714a4 100644
--- a/drivers/spi/spi-pl022.c
+++ b/drivers/spi/spi-pl022.c
@@ -294,8 +294,6 @@
 
 #define CLEAR_ALL_INTERRUPTS  0x3
 
-#define SPI_POLLING_TIMEOUT 1000
-
 /*
  * The type of reading going on on this chip
  */
@@ -1491,7 +1489,6 @@ static void do_polling_transfer(struct pl022 *pl022)
 	struct spi_transfer *transfer = NULL;
 	struct spi_transfer *previous = NULL;
 	struct chip_data *chip;
-	unsigned long time, timeout;
 
 	chip = pl022->cur_chip;
 	message = pl022->cur_msg;
@@ -1531,16 +1528,8 @@ static void do_polling_transfer(struct pl022 *pl022)
 
 		dev_dbg(&pl022->adev->dev, "polling transfer ongoing ...\n");
 
-		timeout = jiffies + msecs_to_jiffies(SPI_POLLING_TIMEOUT);
 		while (pl022->tx < pl022->tx_end || pl022->rx < pl022->rx_end) {
-			time = jiffies;
 			readwriter(pl022);
-			if (time_after(time, timeout)) {
-				dev_warn(&pl022->adev->dev,
-				"%s: timeout!\n", __func__);
-				message->state = STATE_ERROR;
-				goto out;
-			}
 			cpu_relax();
 		}
 
@@ -1551,7 +1540,7 @@ static void do_polling_transfer(struct pl022 *pl022)
 		/* Move to next transfer */
 		message->state = next_transfer(pl022);
 	}
-out:
+
 	/* Handle end of message */
 	if (message->state == STATE_DONE)
 		message->status = 0;
@@ -1559,7 +1548,6 @@ static void do_polling_transfer(struct pl022 *pl022)
 		message->status = -EIO;
 
 	giveback(pl022);
-	return;
 }
 
 static int pl022_transfer_one_message(struct spi_master *master,
-- 
2.18.0

--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux