* [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback
@ 2010-03-01 11:25 Venkatraman S
2010-03-01 12:44 ` Sergei Shtylyov
2010-03-10 16:47 ` Madhusudhan
0 siblings, 2 replies; 8+ messages in thread
From: Venkatraman S @ 2010-03-01 11:25 UTC (permalink / raw)
To: linux-arm-kernel
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.
+ */
+ up(&host->sem);
+ }
+ }
spin_unlock(&host->irq_lock);
@@ -1267,13 +1277,6 @@ static void omap_hsmmc_dma_cb(int lch, u16
ch_status, void *data)
return;
}
- omap_free_dma(host->dma_ch);
- host->dma_ch = -1;
- /*
- * DMA Callback: run in interrupt context.
- * mutex_unlock will throw a kernel warning if used.
- */
- up(&host->sem);
}
/*
--
1.6.3.3
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback
2010-03-01 11:25 [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback Venkatraman S
@ 2010-03-01 12:44 ` Sergei Shtylyov
2010-03-10 16:47 ` Madhusudhan
1 sibling, 0 replies; 8+ messages in thread
From: Sergei Shtylyov @ 2010-03-01 12:44 UTC (permalink / raw)
To: linux-arm-kernel
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
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback
2010-03-01 11:25 [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback Venkatraman S
2010-03-01 12:44 ` Sergei Shtylyov
@ 2010-03-10 16:47 ` Madhusudhan
1 sibling, 0 replies; 8+ messages in thread
From: Madhusudhan @ 2010-03-10 16:47 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: linux-mmc-owner at vger.kernel.org [mailto:linux-mmc-
> owner at vger.kernel.org] On Behalf Of Venkatraman S
> Sent: Monday, March 01, 2010 5:26 AM
> To: linux-mmc at vger.kernel.org; linux-arm-kernel at lists.infradead.org;
> linux-omap at vger.kernel.org
> Subject: [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc
> callback
>
> 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;
Why is this necessary? The core is notified of xfer complete only when TC is
received which is good enough.
> + /*
> + * Callback: run in interrupt context.
> + * mutex_unlock will throw a kernel warning if used.
> + */
> + up(&host->sem);
> + }
> + }
>
> spin_unlock(&host->irq_lock);
>
> @@ -1267,13 +1277,6 @@ static void omap_hsmmc_dma_cb(int lch, u16
> ch_status, void *data)
> return;
> }
>
> - omap_free_dma(host->dma_ch);
> - host->dma_ch = -1;
> - /*
> - * DMA Callback: run in interrupt context.
> - * mutex_unlock will throw a kernel warning if used.
> - */
> - up(&host->sem);
> }
>
> /*
> --
> 1.6.3.3
> --
> To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback
@ 2010-03-10 14:11 Venkatraman S
2010-03-10 14:27 ` Shilimkar, Santosh
2010-08-27 19:37 ` Chris Ball
0 siblings, 2 replies; 8+ messages in thread
From: Venkatraman S @ 2010-03-10 14:11 UTC (permalink / raw)
To: linux-arm-kernel
See previous post http://patchwork.kernel.org/patch/82907/
Rebased to 2.6.34-rc1 and fixed comment alignment.
CC: Adrian Hunter <adrian.hunter@nokia.com>
CC: Madhusudhan C <madhu.cr@ti.com>
CC: Tony Lindgren <tony@atomide.com>
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..ea2a082 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.
+ */
+ up(&host->sem);
+ }
+ }
spin_unlock(&host->irq_lock);
@@ -1267,13 +1277,6 @@ static void omap_hsmmc_dma_cb(int lch, u16
ch_status, void *data)
return;
}
- omap_free_dma(host->dma_ch);
- host->dma_ch = -1;
- /*
- * DMA Callback: run in interrupt context.
- * mutex_unlock will throw a kernel warning if used.
- */
- up(&host->sem);
}
/*
--
1.6.3.3
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback
2010-03-10 14:11 Venkatraman S
@ 2010-03-10 14:27 ` Shilimkar, Santosh
2010-03-10 15:20 ` Venkatraman S
2010-08-27 19:37 ` Chris Ball
1 sibling, 1 reply; 8+ messages in thread
From: Shilimkar, Santosh @ 2010-03-10 14:27 UTC (permalink / raw)
To: linux-arm-kernel
> -----Original Message-----
> From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-owner at vger.kernel.org] On Behalf Of
> Venkatraman S
> Sent: Wednesday, March 10, 2010 7:42 PM
> To: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org; linux-mmc at vger.kernel.org
> Cc: Adrian Hunter; Chikkature Rajashekar, Madhusudhan; Tony Lindgren
> Subject: [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback
>
> See previous post http://patchwork.kernel.org/patch/82907/
> Rebased to 2.6.34-rc1 and fixed comment alignment.
>
Why did you dropped change log in all your patches? You should retain that and
just change the patch version in the subject.
> CC: Adrian Hunter <adrian.hunter@nokia.com>
> CC: Madhusudhan C <madhu.cr@ti.com>
> CC: Tony Lindgren <tony@atomide.com>
> 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..ea2a082 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.
> + */
> + up(&host->sem);
> + }
> + }
>
> spin_unlock(&host->irq_lock);
>
> @@ -1267,13 +1277,6 @@ static void omap_hsmmc_dma_cb(int lch, u16
> ch_status, void *data)
> return;
> }
>
> - omap_free_dma(host->dma_ch);
> - host->dma_ch = -1;
> - /*
> - * DMA Callback: run in interrupt context.
> - * mutex_unlock will throw a kernel warning if used.
> - */
> - up(&host->sem);
> }
>
> /*
> --
> 1.6.3.3
> --
> To unsubscribe from this list: send the line "unsubscribe linux-omap" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 8+ messages in thread* [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback
2010-03-10 14:27 ` Shilimkar, Santosh
@ 2010-03-10 15:20 ` Venkatraman S
2010-03-10 17:07 ` Kevin Hilman
0 siblings, 1 reply; 8+ messages in thread
From: Venkatraman S @ 2010-03-10 15:20 UTC (permalink / raw)
To: linux-arm-kernel
Shilimkar, Santosh wrote:
>> -----Original Message-----
>> From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-owner at vger.kernel.org] On Behalf Of
>> Venkatraman S
>> Sent: Wednesday, March 10, 2010 7:42 PM
>> To: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org; linux-mmc at vger.kernel.org
>> Cc: Adrian Hunter; Chikkature Rajashekar, Madhusudhan; Tony Lindgren
>> Subject: [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback
>>
>> See previous post http://patchwork.kernel.org/patch/82907/
>> Rebased to 2.6.34-rc1 and fixed comment alignment.
>>
> Why did you dropped change log in all your patches? You should retain that and
> just change the patch version in the subject.
>
My bad. I just edited the merge commit to point to the previous
threads and posted it.
Should I post them again ?
Thanks and regards,
Venkat.
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback
2010-03-10 15:20 ` Venkatraman S
@ 2010-03-10 17:07 ` Kevin Hilman
0 siblings, 0 replies; 8+ messages in thread
From: Kevin Hilman @ 2010-03-10 17:07 UTC (permalink / raw)
To: linux-arm-kernel
Venkatraman S <svenkatr@ti.com> writes:
> Shilimkar, Santosh wrote:
>>> -----Original Message-----
>>> From: linux-omap-owner at vger.kernel.org [mailto:linux-omap-owner at vger.kernel.org] On Behalf Of
>>> Venkatraman S
>>> Sent: Wednesday, March 10, 2010 7:42 PM
>>> To: linux-omap at vger.kernel.org; linux-arm-kernel at lists.infradead.org; linux-mmc at vger.kernel.org
>>> Cc: Adrian Hunter; Chikkature Rajashekar, Madhusudhan; Tony Lindgren
>>> Subject: [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback
>>>
>>> See previous post http://patchwork.kernel.org/patch/82907/
>>> Rebased to 2.6.34-rc1 and fixed comment alignment.
>>>
>> Why did you dropped change log in all your patches? You should retain that and
>> just change the patch version in the subject.
>>
>
> My bad. I just edited the merge commit to point to the previous
> threads and posted it.
> Should I post them again ?
>
Yes.
As Santosh pointed out, keep the changelog. and add any comments about
how this differs from previous versions after the '---' in the
changelog.
Keep in mind that the changelog will be stored in the git history and
should be useful without having to reference previous versions etc.
Anything useful to the reviewers but not important for the changelog
should go after the '---' since that will be ignored by git when
applying.
Kevin
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback
2010-03-10 14:11 Venkatraman S
2010-03-10 14:27 ` Shilimkar, Santosh
@ 2010-08-27 19:37 ` Chris Ball
1 sibling, 0 replies; 8+ messages in thread
From: Chris Ball @ 2010-08-27 19:37 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
Looks like the discussion on this patch stopped: do we think there's a
race worth fixing here?
On Wed, Mar 10, 2010 at 07:41:38PM +0530, Venkatraman S wrote:
> See previous post http://patchwork.kernel.org/patch/82907/
> Rebased to 2.6.34-rc1 and fixed comment alignment.
>
> CC: Adrian Hunter <adrian.hunter@nokia.com>
> CC: Madhusudhan C <madhu.cr@ti.com>
> CC: Tony Lindgren <tony@atomide.com>
> 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..ea2a082 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.
> + */
> + up(&host->sem);
> + }
> + }
>
> spin_unlock(&host->irq_lock);
>
> @@ -1267,13 +1277,6 @@ static void omap_hsmmc_dma_cb(int lch, u16
> ch_status, void *data)
> return;
> }
>
> - omap_free_dma(host->dma_ch);
> - host->dma_ch = -1;
> - /*
> - * DMA Callback: run in interrupt context.
> - * mutex_unlock will throw a kernel warning if used.
> - */
> - up(&host->sem);
> }
>
> /*
> --
> 1.6.3.3
--
Chris Ball <cjb@laptop.org> <http://printf.net/>
One Laptop Per Child
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2010-08-27 19:37 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-01 11:25 [PATCH 01/03] omap hsmmc: prevent race between dma and hsmmc callback Venkatraman S
2010-03-01 12:44 ` Sergei Shtylyov
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:27 ` Shilimkar, Santosh
2010-03-10 15:20 ` Venkatraman S
2010-03-10 17:07 ` Kevin Hilman
2010-08-27 19:37 ` Chris Ball
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).