All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
To: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Cc: ulf.hansson@linaro.org, linux-mmc@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH] mmc: host: renesas_internal_dmac: add pre_req and post_req support
Date: Mon, 14 Dec 2020 16:50:01 +0100	[thread overview]
Message-ID: <20201214155001.GA950@ninjato> (raw)
In-Reply-To: <1607087853-6570-1-git-send-email-yoshihiro.shimoda.uh@renesas.com>

[-- Attachment #1: Type: text/plain, Size: 1537 bytes --]

Hi Shimoda-san,

On Fri, Dec 04, 2020 at 10:17:33PM +0900, Yoshihiro Shimoda wrote:
> Add pre_req and post_req support to improve performance.
> 
> Inspired by a patch in the BSP by Masaharu Hayakawa.

Thank you for upporting this!

>  /*
>   * Specification of this driver:
>   * - host->chan_{rx,tx} will be used as a flag of enabling/disabling the dma
> @@ -172,6 +178,47 @@ renesas_sdhi_internal_dmac_dataend_dma(struct tmio_mmc_host *host) {
>  	tasklet_schedule(&priv->dma_priv.dma_complete);
>  }
>  
> +/* Should not use host->sg_ptr/sg_len in the following function */

Maybe a short explanation why we shouldn't use the functions?

> +static void
> +renesas_sdhi_internal_dmac_unmap(struct tmio_mmc_host *host,
> +				 struct mmc_data *data,
> +				 enum renesas_sdhi_dma_cookie cookie,
> +				 bool expected_unmatch)

Can we maybe skip "expected_unmatch"? It is always true for
COOKIE_UNMAPPED and always false for the COOKIE_*MAPPED values, or?

> +{
> +	bool unmap = expected_unmatch ? (data->host_cookie != cookie) :
> +					(data->host_cookie == cookie);

Then, we could do:
 +	bool unmap = cookie == COOKIE_UNMAPPED ? (data->host_cookie != cookie) :
 +					(data->host_cookie == cookie);

> +
> +	if (unmap) {
> +		dma_unmap_sg(&host->pdev->dev, data->sg, data->sg_len,
> +			     mmc_get_dma_dir(data));
> +		data->host_cookie = COOKIE_UNMAPPED;
> +	}

Is it maybe worth a warning if the expected condition was not found?

Rest looks good!

All the best,

   Wolfram


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-12-14 15:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-04 13:17 [PATCH] mmc: host: renesas_internal_dmac: add pre_req and post_req support Yoshihiro Shimoda
2020-12-14 15:50 ` Wolfram Sang [this message]
2020-12-15  1:32   ` Yoshihiro Shimoda
2020-12-15  3:00     ` Yoshihiro Shimoda
2020-12-15  5:03       ` Yoshihiro Shimoda
2020-12-15 10:40         ` Wolfram Sang
2020-12-16  8:00         ` Yoshihiro Shimoda

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=20201214155001.GA950@ninjato \
    --to=wsa+renesas@sang-engineering.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=ulf.hansson@linaro.org \
    --cc=yoshihiro.shimoda.uh@renesas.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.