diff mbox series

[2/2] mmc: alcor: enable DMA for writes

Message ID 20190326070415.11492-2-drake@endlessm.com (mailing list archive)
State New, archived
Headers show
Series [1/2] mmc: alcor: don't write data before command has completed | expand

Commit Message

Daniel Drake March 26, 2019, 7:04 a.m. UTC
Enable the DMA codepath for writes as well as reads.
This improves write speed from 1mb/sec to 2mb/sec (tested with dd).

The original ampe_stor vendor driver also uses DMA for writes.

Signed-off-by: Daniel Drake <drake@endlessm.com>
---
 drivers/mmc/host/alcor.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Ulf Hansson March 28, 2019, 12:52 p.m. UTC | #1
On Tue, 26 Mar 2019 at 08:04, Daniel Drake <drake@endlessm.com> wrote:
>
> Enable the DMA codepath for writes as well as reads.
> This improves write speed from 1mb/sec to 2mb/sec (tested with dd).
>
> The original ampe_stor vendor driver also uses DMA for writes.
>
> Signed-off-by: Daniel Drake <drake@endlessm.com>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/host/alcor.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mmc/host/alcor.c b/drivers/mmc/host/alcor.c
> index 7c8f203f9a24d..3e2efbf3cf8cd 100644
> --- a/drivers/mmc/host/alcor.c
> +++ b/drivers/mmc/host/alcor.c
> @@ -771,7 +771,8 @@ static void alcor_pre_req(struct mmc_host *mmc,
>         data->host_cookie = COOKIE_UNMAPPED;
>
>         /* FIXME: looks like the DMA engine works only with CMD18 */
> -       if (cmd->opcode != 18)
> +       if (cmd->opcode != MMC_READ_MULTIPLE_BLOCK
> +                       && cmd->opcode != MMC_WRITE_MULTIPLE_BLOCK)
>                 return;
>         /*
>          * We don't do DMA on "complex" transfers, i.e. with
> --
> 2.19.1
>
diff mbox series

Patch

diff --git a/drivers/mmc/host/alcor.c b/drivers/mmc/host/alcor.c
index 7c8f203f9a24d..3e2efbf3cf8cd 100644
--- a/drivers/mmc/host/alcor.c
+++ b/drivers/mmc/host/alcor.c
@@ -771,7 +771,8 @@  static void alcor_pre_req(struct mmc_host *mmc,
 	data->host_cookie = COOKIE_UNMAPPED;
 
 	/* FIXME: looks like the DMA engine works only with CMD18 */
-	if (cmd->opcode != 18)
+	if (cmd->opcode != MMC_READ_MULTIPLE_BLOCK
+			&& cmd->opcode != MMC_WRITE_MULTIPLE_BLOCK)
 		return;
 	/*
 	 * We don't do DMA on "complex" transfers, i.e. with