All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nicolin Chen <nicoleotsuka@gmail.com>
To: Thierry Reding <thierry.reding@gmail.com>
Cc: Ulf Hansson <ulf.hansson@linaro.org>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Jon Hunter <jonathanh@nvidia.com>,
	inux-mmc@vger.kernel.org, linux-tegra@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mmc: sdhci: Let drivers define their DMA mask
Date: Fri, 20 Sep 2019 14:47:47 -0700	[thread overview]
Message-ID: <20190920214746.GA21389@Asurada-Nvidia.nvidia.com> (raw)
In-Reply-To: <20190920145317.11972-2-thierry.reding@gmail.com>

On Fri, Sep 20, 2019 at 04:53:16PM +0200, Thierry Reding wrote:
> From: Adrian Hunter <adrian.hunter@intel.com>
> 
> Add host operation ->set_dma_mask() so that drivers can define their own
> DMA masks.
> 
> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
> Signed-off-by: Thierry Reding <treding@nvidia.com>

Tested-by: Nicolin Chen <nicoleotsuka@gmail.com>

Ran a boot test with both patches on a Tegra186 board.

Thanks!

> ---
>  drivers/mmc/host/sdhci.c | 12 ++++--------
>  drivers/mmc/host/sdhci.h |  1 +
>  2 files changed, 5 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c
> index a5dc5aae973e..bc04c3180477 100644
> --- a/drivers/mmc/host/sdhci.c
> +++ b/drivers/mmc/host/sdhci.c
> @@ -3756,18 +3756,14 @@ int sdhci_setup_host(struct sdhci_host *host)
>  		host->flags &= ~SDHCI_USE_ADMA;
>  	}
>  
> -	/*
> -	 * It is assumed that a 64-bit capable device has set a 64-bit DMA mask
> -	 * and *must* do 64-bit DMA.  A driver has the opportunity to change
> -	 * that during the first call to ->enable_dma().  Similarly
> -	 * SDHCI_QUIRK2_BROKEN_64_BIT_DMA must be left to the drivers to
> -	 * implement.
> -	 */
>  	if (sdhci_can_64bit_dma(host))
>  		host->flags |= SDHCI_USE_64_BIT_DMA;
>  
>  	if (host->flags & (SDHCI_USE_SDMA | SDHCI_USE_ADMA)) {
> -		ret = sdhci_set_dma_mask(host);
> +		if (host->ops->set_dma_mask)
> +			ret = host->ops->set_dma_mask(host);
> +		else
> +			ret = sdhci_set_dma_mask(host);
>  
>  		if (!ret && host->ops->enable_dma)
>  			ret = host->ops->enable_dma(host);
> diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h
> index 902f855efe8f..8285498c0d8a 100644
> --- a/drivers/mmc/host/sdhci.h
> +++ b/drivers/mmc/host/sdhci.h
> @@ -622,6 +622,7 @@ struct sdhci_ops {
>  
>  	u32		(*irq)(struct sdhci_host *host, u32 intmask);
>  
> +	int		(*set_dma_mask)(struct sdhci_host *host);
>  	int		(*enable_dma)(struct sdhci_host *host);
>  	unsigned int	(*get_max_clock)(struct sdhci_host *host);
>  	unsigned int	(*get_min_clock)(struct sdhci_host *host);
> -- 
> 2.23.0
> 

  reply	other threads:[~2019-09-20 21:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-20 14:53 [PATCH 0/2] mmc: tegra: Use proper DMA mask Thierry Reding
2019-09-20 14:53 ` [PATCH 1/2] mmc: sdhci: Let drivers define their " Thierry Reding
2019-09-20 21:47   ` Nicolin Chen [this message]
2019-09-20 14:53 ` [PATCH 2/2] mmc: tegra: Implement ->set_dma_mask() Thierry Reding
2019-09-23  6:39   ` Adrian Hunter
2019-09-23  6:41   ` Adrian Hunter
2019-09-20 16:17 ` [PATCH 0/2] mmc: tegra: Use proper DMA mask Thierry Reding

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=20190920214746.GA21389@Asurada-Nvidia.nvidia.com \
    --to=nicoleotsuka@gmail.com \
    --cc=adrian.hunter@intel.com \
    --cc=inux-mmc@vger.kernel.org \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=ulf.hansson@linaro.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 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.