linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: wsa@the-dreams.de (Wolfram Sang)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] mmc: tmio: simplify the DMA mode test
Date: Mon, 15 Oct 2018 00:36:36 +0200	[thread overview]
Message-ID: <20181014223636.GH3260@kunai> (raw)
In-Reply-To: <1539356588-18191-1-git-send-email-yamada.masahiro@socionext.com>

On Sat, Oct 13, 2018 at 12:03:08AM +0900, Masahiro Yamada wrote:
> host->chan_{rx,tx} represents the DMA capability of the platform.
> Even if DMA is supported, there are cases where we want to use PIO,
> for example, data length is short enough as commit 5f52c3552946
> ("mmc: tmio: use PIO for short transfers") mentioned.
> 
> Regarding the hardware control flow, we are interested in whether DMA
> is currently enabled or not, instead of whether the platform has the
> DMA capability.
> 
> Hence, the several conditionals in tmio_mmc_core.c end up with
> checking host->chan_{rx,tx} and !host->force_pio. This is not nice.
> 
> Let's flip the flag host->force_pio into host->dma_on.
> 
> host->dma_on represents whether the DMA is currently enabled or not.
> This flag is set false in the beginning of each command, then should
> be set true by tmio_mmc_start_dma() when the DMA is turned on.
> 
> Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>

I like it. Much easier to read!

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Also here, I'd like to test this on Monday on some more devices.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20181015/0cda9533/attachment.sig>

  reply	other threads:[~2018-10-14 22:36 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-12 15:03 [PATCH] mmc: tmio: simplify the DMA mode test Masahiro Yamada
2018-10-14 22:36 ` Wolfram Sang [this message]
2018-10-15 11:33   ` Wolfram Sang
2018-10-15 13:15 ` Ulf Hansson

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=20181014223636.GH3260@kunai \
    --to=wsa@the-dreams.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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 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).