All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: Venkatraman S <svenkatr@ti.com>
Cc: linux-mmc@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-omap@vger.kernel.org
Subject: Re: [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback
Date: Mon, 01 Mar 2010 15:44:58 +0300	[thread overview]
Message-ID: <4B8BB6CA.7000104@ru.mvista.com> (raw)
In-Reply-To: <618f0c911003010325q201fbcedr776da21c709ac421@mail.gmail.com>

Hello.

Venkatraman S wrote:

> It is observed that sometimes the MMC Transfer Complete (TC) is not
> received when DMA completion callback is processed (or takes too long
> to process)
> This patch moves the releasing of DMA channel from dma callback to the
> mmc transfer complete handler.
> This is observed consistently when descriptor loading is used (see the
> rest of the series)
>
> Signed-off-by: Venkatraman S <svenkatr@ti.com>
> ---
>  drivers/mmc/host/omap_hsmmc.c |   19 +++++++++++--------
>  1 files changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 83f0aff..06337f6 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -1046,8 +1046,18 @@ static irqreturn_t omap_hsmmc_irq(int irq, void *dev_id)
>
>  	if (end_cmd || ((status & CC) && host->cmd))
>  		omap_hsmmc_cmd_done(host, host->cmd);
> -	if ((end_trans || (status & TC)) && host->mrq)
> +	if ((end_trans || (status & TC)) && host->mrq) {
>  		omap_hsmmc_xfer_done(host, data);
> +		if (host->dma_ch != -1) {
> +			omap_free_dma(host->dma_ch);
> +			host->dma_ch = -1;
> +		/*
> +		 * Callback: run in interrupt context.
> +		 * mutex_unlock will throw a kernel warning if used.
> +		 */
>   

   The comment should be aligned with the rest of the code.

> +			up(&host->sem);
> +		}
> +	}
>
>  	spin_unlock(&host->irq_lock);

WBR, Sergei


WARNING: multiple messages have this Message-ID (diff)
From: sshtylyov@mvista.com (Sergei Shtylyov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback
Date: Mon, 01 Mar 2010 15:44:58 +0300	[thread overview]
Message-ID: <4B8BB6CA.7000104@ru.mvista.com> (raw)
In-Reply-To: <618f0c911003010325q201fbcedr776da21c709ac421@mail.gmail.com>

Hello.

Venkatraman S wrote:

> It is observed that sometimes the MMC Transfer Complete (TC) is not
> received when DMA completion callback is processed (or takes too long
> to process)
> This patch moves the releasing of DMA channel from dma callback to the
> mmc transfer complete handler.
> This is observed consistently when descriptor loading is used (see the
> rest of the series)
>
> Signed-off-by: Venkatraman S <svenkatr@ti.com>
> ---
>  drivers/mmc/host/omap_hsmmc.c |   19 +++++++++++--------
>  1 files changed, 11 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
> index 83f0aff..06337f6 100644
> --- a/drivers/mmc/host/omap_hsmmc.c
> +++ b/drivers/mmc/host/omap_hsmmc.c
> @@ -1046,8 +1046,18 @@ static irqreturn_t omap_hsmmc_irq(int irq, void *dev_id)
>
>  	if (end_cmd || ((status & CC) && host->cmd))
>  		omap_hsmmc_cmd_done(host, host->cmd);
> -	if ((end_trans || (status & TC)) && host->mrq)
> +	if ((end_trans || (status & TC)) && host->mrq) {
>  		omap_hsmmc_xfer_done(host, data);
> +		if (host->dma_ch != -1) {
> +			omap_free_dma(host->dma_ch);
> +			host->dma_ch = -1;
> +		/*
> +		 * Callback: run in interrupt context.
> +		 * mutex_unlock will throw a kernel warning if used.
> +		 */
>   

   The comment should be aligned with the rest of the code.

> +			up(&host->sem);
> +		}
> +	}
>
>  	spin_unlock(&host->irq_lock);

WBR, Sergei

  reply	other threads:[~2010-03-01 12:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-01 11:25 [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback Venkatraman S
2010-03-01 11:25 ` Venkatraman S
2010-03-01 12:44 ` Sergei Shtylyov [this message]
2010-03-01 12:44   ` Sergei Shtylyov
2010-03-10 16:47 ` Madhusudhan
2010-03-10 16:47   ` Madhusudhan
  -- strict thread matches above, loose matches on Subject: below --
2010-03-10 14:11 Venkatraman S
2010-03-10 14:11 ` Venkatraman S
2010-03-10 14:27 ` Shilimkar, Santosh
2010-03-10 14:27 ` Shilimkar, Santosh
2010-03-10 14:27   ` Shilimkar, Santosh
2010-03-10 15:20   ` Venkatraman S
2010-03-10 15:20     ` Venkatraman S
2010-03-10 17:07     ` Kevin Hilman
2010-03-10 17:07       ` Kevin Hilman
2010-08-27 19:37 ` Chris Ball
2010-08-27 19:37   ` Chris Ball

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=4B8BB6CA.7000104@ru.mvista.com \
    --to=sshtylyov@mvista.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=svenkatr@ti.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.