[PATCH] mmci: calculate remaining bytes at error correctly

Linus Walleij linus.walleij at linaro.org
Mon Jan 31 05:17:42 EST 2011


2011/1/30 Russell King - ARM Linux <linux at arm.linux.org.uk>:

> 8<----
> Subject: [PATCH 1/2] ARM: mmci: complete the transaction on error
>
> When we encounter an error, make sure we complete the transaction
> otherwise we'll leave the request dangling.
>
> Signed-off-by: Russell King <rmk+kernel at arm.linux.org.uk>
> ---
>  drivers/mmc/host/mmci.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
> index b6fd6dc..175a623 100644
> --- a/drivers/mmc/host/mmci.c
> +++ b/drivers/mmc/host/mmci.c
> @@ -319,7 +319,7 @@ mmci_data_irq(struct mmci_host *host, struct mmc_data *data,
>        if (status & MCI_DATABLOCKEND)
>                dev_err(mmc_dev(host->mmc), "stray MCI_DATABLOCKEND interrupt\n");
>
> -       if (status & MCI_DATAEND) {
> +       if (status & MCI_DATAEND || data->error) {
>                mmci_stop_data(host);

The hardware always sets the MCI_DATAEND bit if there is
some error, so these flags always appear simultaneously, but
it doesn't hurt to take some extra precaution, so
Acked-by: Linus Walleij <linus.walleij at stericsson.com>

Linus Walleij



More information about the linux-arm-kernel mailing list