From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: ludovic.desroches@atmel.com,
linux-arm-kernel@lists.infradead.org, linux-mmc@vger.kernel.org,
cjb@laptop.org
Subject: Re: [PATCH] mmc: atmel-mci: fix timeout errors in SDIO mode when using DMA
Date: Thu, 21 Nov 2013 16:42:08 +0100 [thread overview]
Message-ID: <528E29D0.9080507@atmel.com> (raw)
In-Reply-To: <1384959671-5646-1-git-send-email-ludovic.desroches@atmel.com>
On 20/11/2013 16:01, ludovic.desroches@atmel.com :
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
>
> With some SDIO devices, timeout errors can happen when reading data. To solve
> this issue the DMA transfer has to be activated before sending the command to
> the device. This order is incorrect in PDC mode. So we have to take care if we
> are using DMA or PDC to know when to send the MMC command.
>
> Cc: <stable@vger.kernel.org> #3.2+
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Thanks, bye,
> ---
> drivers/mmc/host/atmel-mci.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index b8dfe0d..289da71 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -1193,11 +1193,22 @@ static void atmci_start_request(struct atmel_mci *host,
> iflags |= ATMCI_CMDRDY;
> cmd = mrq->cmd;
> cmdflags = atmci_prepare_command(slot->mmc, cmd);
> - atmci_send_command(host, cmd, cmdflags);
> +
> + /*
> + * DMA transfer should be started before sending the command to avoid
> + * unexpected errors especially for read operations in SDIO mode.
> + * Unfortunately, in PDC mode, command has to be sent before starting
> + * the transfer.
> + */
> + if (host->submit_data != &atmci_submit_data_dma)
> + atmci_send_command(host, cmd, cmdflags);
>
> if (data)
> host->submit_data(host, data);
>
> + if (host->submit_data == &atmci_submit_data_dma)
> + atmci_send_command(host, cmd, cmdflags);
> +
> if (mrq->stop) {
> host->stop_cmdr = atmci_prepare_command(slot->mmc, mrq->stop);
> host->stop_cmdr |= ATMCI_CMDR_STOP_XFER;
>
--
Nicolas Ferre
WARNING: multiple messages have this Message-ID (diff)
From: nicolas.ferre@atmel.com (Nicolas Ferre)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mmc: atmel-mci: fix timeout errors in SDIO mode when using DMA
Date: Thu, 21 Nov 2013 16:42:08 +0100 [thread overview]
Message-ID: <528E29D0.9080507@atmel.com> (raw)
In-Reply-To: <1384959671-5646-1-git-send-email-ludovic.desroches@atmel.com>
On 20/11/2013 16:01, ludovic.desroches at atmel.com :
> From: Ludovic Desroches <ludovic.desroches@atmel.com>
>
> With some SDIO devices, timeout errors can happen when reading data. To solve
> this issue the DMA transfer has to be activated before sending the command to
> the device. This order is incorrect in PDC mode. So we have to take care if we
> are using DMA or PDC to know when to send the MMC command.
>
> Cc: <stable@vger.kernel.org> #3.2+
> Signed-off-by: Ludovic Desroches <ludovic.desroches@atmel.com>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Thanks, bye,
> ---
> drivers/mmc/host/atmel-mci.c | 13 ++++++++++++-
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index b8dfe0d..289da71 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -1193,11 +1193,22 @@ static void atmci_start_request(struct atmel_mci *host,
> iflags |= ATMCI_CMDRDY;
> cmd = mrq->cmd;
> cmdflags = atmci_prepare_command(slot->mmc, cmd);
> - atmci_send_command(host, cmd, cmdflags);
> +
> + /*
> + * DMA transfer should be started before sending the command to avoid
> + * unexpected errors especially for read operations in SDIO mode.
> + * Unfortunately, in PDC mode, command has to be sent before starting
> + * the transfer.
> + */
> + if (host->submit_data != &atmci_submit_data_dma)
> + atmci_send_command(host, cmd, cmdflags);
>
> if (data)
> host->submit_data(host, data);
>
> + if (host->submit_data == &atmci_submit_data_dma)
> + atmci_send_command(host, cmd, cmdflags);
> +
> if (mrq->stop) {
> host->stop_cmdr = atmci_prepare_command(slot->mmc, mrq->stop);
> host->stop_cmdr |= ATMCI_CMDR_STOP_XFER;
>
--
Nicolas Ferre
next prev parent reply other threads:[~2013-11-21 15:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-20 15:01 [PATCH] mmc: atmel-mci: fix timeout errors in SDIO mode when using DMA ludovic.desroches
2013-11-20 15:01 ` ludovic.desroches at atmel.com
2013-11-21 15:42 ` Nicolas Ferre [this message]
2013-11-21 15:42 ` Nicolas Ferre
2013-11-26 22:24 ` Chris Ball
2013-11-26 22:24 ` Chris Ball
2013-11-27 9:41 ` Nicolas Ferre
2013-11-27 9:41 ` Nicolas Ferre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=528E29D0.9080507@atmel.com \
--to=nicolas.ferre@atmel.com \
--cc=cjb@laptop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mmc@vger.kernel.org \
--cc=ludovic.desroches@atmel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.