All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jaehoon Chung <jh80.chung@samsung.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC, PATCH] mmc: prepare SDHCI_HOST_CONTROL for SDMA operation
Date: Thu, 08 Nov 2012 10:37:23 +0900	[thread overview]
Message-ID: <509B0CD3.8000100@samsung.com> (raw)
In-Reply-To: <20121107214603.GA74000@crg>

Hi Rommel,

Looks good to me. Thank you.

Acked-by: Jaehoon Chung <jh80.chung@samsung.com>

On 11/08/2012 06:46 AM, Rommel G Custodio wrote:
> modification for commit 804c7f422169212e92530e1ddaf74bf1ca9ebfa1
> 
> The original patch contained a bug.
> Using a char with sdhci_readl/sdhci_writel operation.
> The adjacent bytes to SDHCI_HOST_CONTROL (specially SDHCI_POWER_CONTROL)
> get mangled and can result in the controller entering an unstable state.
> 
> This patch also moves the process inside sdhci_init().
> 
> Signed-off-by: Rommel G Custodio <sessyargc@gmail.com>
> ---
>  drivers/mmc/sdhci.c | 15 ++++++++-------
>  1 file changed, 8 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/mmc/sdhci.c b/drivers/mmc/sdhci.c
> index 7845f87..fae2169 100644
> --- a/drivers/mmc/sdhci.c
> +++ b/drivers/mmc/sdhci.c
> @@ -82,13 +82,6 @@ static int sdhci_transfer_data(struct sdhci_host *host, struct mmc_data *data,
>  				unsigned int start_addr)
>  {
>  	unsigned int stat, rdy, mask, timeout, block = 0;
> -#ifdef CONFIG_MMC_SDMA
> -	unsigned char ctrl;
> -	ctrl = sdhci_readl(host, SDHCI_HOST_CONTROL);
> -	ctrl &= ~SDHCI_CTRL_DMA_MASK;
> -	ctrl |= SDHCI_CTRL_SDMA;
> -	sdhci_writel(host, ctrl, SDHCI_HOST_CONTROL);
> -#endif
>  
>  	timeout = 1000000;
>  	rdy = SDHCI_INT_SPACE_AVAIL | SDHCI_INT_DATA_AVAIL;
> @@ -386,6 +379,14 @@ int sdhci_init(struct mmc *mmc)
>  {
>  	struct sdhci_host *host = (struct sdhci_host *)mmc->priv;
>  
> +#ifdef CONFIG_MMC_SDMA
> +	unsigned int ctrl;
> +	ctrl = sdhci_readl(host, SDHCI_HOST_CONTROL);
> +	ctrl &= ~SDHCI_CTRL_DMA_MASK;
> +	ctrl |= SDHCI_CTRL_SDMA;
> +	sdhci_writel(host, ctrl, SDHCI_HOST_CONTROL);
> +#endif
> +
>  	if ((host->quirks & SDHCI_QUIRK_32BIT_DMA_ADDR) && !aligned_buffer) {
>  		aligned_buffer = memalign(8, 512*1024);
>  		if (!aligned_buffer) {
> 

      reply	other threads:[~2012-11-08  1:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-07 21:46 [U-Boot] [RFC, PATCH] mmc: prepare SDHCI_HOST_CONTROL for SDMA operation Rommel G Custodio
2012-11-08  1:37 ` Jaehoon Chung [this message]

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=509B0CD3.8000100@samsung.com \
    --to=jh80.chung@samsung.com \
    --cc=u-boot@lists.denx.de \
    /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.