From: Sylwester Nawrocki Date: Mon, 16 Apr 2018 15:40:19 +0000 (+0200) Subject: spi: spi-s3c64xx: Do not ignore timeout errors in polling I/O mode X-Git-Tag: v4.18-rc1~184^2~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=4e0b82ee3157218747f87d6fe13a3ee8c29bc509;p=thirdparty%2Fkernel%2Flinux.git spi: spi-s3c64xx: Do not ignore timeout errors in polling I/O mode Currently timeout errors in polling I/O mode transfer are silently ignored. Fix it by returning an error when we time out waiting on the RX FIFO level to reach the transfer length. Signed-off-by: Sylwester Nawrocki Reviewed-by: Andi Shyti Reviewed-by: Krzysztof Kozlowski Signed-off-by: Mark Brown --- diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index b7333a8834421..4c27426bcb407 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -503,6 +503,8 @@ static int wait_for_pio(struct s3c64xx_spi_driver_data *sdd, status = readl(regs + S3C64XX_SPI_STATUS); } while (RX_FIFO_LVL(status, sdd) < xfer->len && --val); + if (!val) + return -EIO; /* If it was only Tx */ if (!xfer->rx_buf) {