linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] mmc_spi: add a status check for spi_sync_locked
@ 2019-03-11  5:53 Kangjie Lu
  2019-03-11  8:25 ` Laurent Pinchart
  2019-03-18 10:51 ` Ulf Hansson
  0 siblings, 2 replies; 3+ messages in thread
From: Kangjie Lu @ 2019-03-11  5:53 UTC (permalink / raw)
  To: kjlu
  Cc: pakki001, Ulf Hansson, Linus Walleij, Laurent Pinchart,
	Jonathan Neuschäfer, linux-mmc, linux-kernel

In case spi_sync_locked fails, the fix reports the error and
returns the error code upstream.

Signed-off-by: Kangjie Lu <kjlu@umn.edu>
---
 drivers/mmc/host/mmc_spi.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
index 1b1498805972..a3533935e282 100644
--- a/drivers/mmc/host/mmc_spi.c
+++ b/drivers/mmc/host/mmc_spi.c
@@ -819,6 +819,10 @@ mmc_spi_readblock(struct mmc_spi_host *host, struct spi_transfer *t,
 	}
 
 	status = spi_sync_locked(spi, &host->m);
+	if (status < 0) {
+		dev_dbg(&spi->dev, "read error %d\n", status);
+		return status;
+	}
 
 	if (host->dma_dev) {
 		dma_sync_single_for_cpu(host->dma_dev,
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] mmc_spi: add a status check for spi_sync_locked
  2019-03-11  5:53 [PATCH v2] mmc_spi: add a status check for spi_sync_locked Kangjie Lu
@ 2019-03-11  8:25 ` Laurent Pinchart
  2019-03-18 10:51 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2019-03-11  8:25 UTC (permalink / raw)
  To: Kangjie Lu
  Cc: pakki001, Ulf Hansson, Linus Walleij, Laurent Pinchart,
	Jonathan Neuschäfer, linux-mmc, linux-kernel

Hi Kangjie,

Thank you for the patch.

On Mon, Mar 11, 2019 at 12:53:33AM -0500, Kangjie Lu wrote:
> In case spi_sync_locked fails, the fix reports the error and
> returns the error code upstream.
> 
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/mmc/host/mmc_spi.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
> index 1b1498805972..a3533935e282 100644
> --- a/drivers/mmc/host/mmc_spi.c
> +++ b/drivers/mmc/host/mmc_spi.c
> @@ -819,6 +819,10 @@ mmc_spi_readblock(struct mmc_spi_host *host, struct spi_transfer *t,
>  	}
>  
>  	status = spi_sync_locked(spi, &host->m);
> +	if (status < 0) {
> +		dev_dbg(&spi->dev, "read error %d\n", status);
> +		return status;
> +	}
>  
>  	if (host->dma_dev) {
>  		dma_sync_single_for_cpu(host->dma_dev,

-- 
Regards,

Laurent Pinchart

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v2] mmc_spi: add a status check for spi_sync_locked
  2019-03-11  5:53 [PATCH v2] mmc_spi: add a status check for spi_sync_locked Kangjie Lu
  2019-03-11  8:25 ` Laurent Pinchart
@ 2019-03-18 10:51 ` Ulf Hansson
  1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2019-03-18 10:51 UTC (permalink / raw)
  To: Kangjie Lu
  Cc: pakki001, Linus Walleij, Laurent Pinchart,
	Jonathan Neuschäfer, linux-mmc, Linux Kernel Mailing List

On Mon, 11 Mar 2019 at 06:53, Kangjie Lu <kjlu@umn.edu> wrote:
>
> In case spi_sync_locked fails, the fix reports the error and
> returns the error code upstream.
>
> Signed-off-by: Kangjie Lu <kjlu@umn.edu>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/mmc_spi.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
> index 1b1498805972..a3533935e282 100644
> --- a/drivers/mmc/host/mmc_spi.c
> +++ b/drivers/mmc/host/mmc_spi.c
> @@ -819,6 +819,10 @@ mmc_spi_readblock(struct mmc_spi_host *host, struct spi_transfer *t,
>         }
>
>         status = spi_sync_locked(spi, &host->m);
> +       if (status < 0) {
> +               dev_dbg(&spi->dev, "read error %d\n", status);
> +               return status;
> +       }
>
>         if (host->dma_dev) {
>                 dma_sync_single_for_cpu(host->dma_dev,
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-03-18 10:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-11  5:53 [PATCH v2] mmc_spi: add a status check for spi_sync_locked Kangjie Lu
2019-03-11  8:25 ` Laurent Pinchart
2019-03-18 10:51 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).