]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.4.181/mmc_spi-add-a-status-check-for-spi_sync_locked.patch
Linux 4.9.181
[thirdparty/kernel/stable-queue.git] / releases / 4.4.181 / mmc_spi-add-a-status-check-for-spi_sync_locked.patch
1 From 87f53b63c6b4583dee395a93836663746697e19b Mon Sep 17 00:00:00 2001
2 From: Kangjie Lu <kjlu@umn.edu>
3 Date: Mon, 11 Mar 2019 00:53:33 -0500
4 Subject: mmc_spi: add a status check for spi_sync_locked
5
6 [ Upstream commit 611025983b7976df0183390a63a2166411d177f1 ]
7
8 In case spi_sync_locked fails, the fix reports the error and
9 returns the error code upstream.
10
11 Signed-off-by: Kangjie Lu <kjlu@umn.edu>
12 Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
13 Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
14 Signed-off-by: Sasha Levin <sashal@kernel.org>
15 ---
16 drivers/mmc/host/mmc_spi.c | 4 ++++
17 1 file changed, 4 insertions(+)
18
19 diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
20 index e03ec74f3fb08..40a369c7005a8 100644
21 --- a/drivers/mmc/host/mmc_spi.c
22 +++ b/drivers/mmc/host/mmc_spi.c
23 @@ -819,6 +819,10 @@ mmc_spi_readblock(struct mmc_spi_host *host, struct spi_transfer *t,
24 }
25
26 status = spi_sync_locked(spi, &host->m);
27 + if (status < 0) {
28 + dev_dbg(&spi->dev, "read error %d\n", status);
29 + return status;
30 + }
31
32 if (host->dma_dev) {
33 dma_sync_single_for_cpu(host->dma_dev,
34 --
35 2.20.1
36