From: Tony Lindgren <tony@atomide.com>
To: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Cc: linux-omap@vger.kernel.org, Jarkko Nikula <jhnikula@gmail.com>,
Liam Girdwood <lrg@slimlogic.co.uk>
Subject: Re: [PATCH v3 2/2] OMAP3: DMA: Errata: sDMA FIFO draining does not finish
Date: Fri, 1 Oct 2010 09:55:42 -0700 [thread overview]
Message-ID: <20101001165542.GS3117@atomide.com> (raw)
In-Reply-To: <1285936577-14881-3-git-send-email-peter.ujfalusi@nokia.com>
* Peter Ujfalusi <peter.ujfalusi@nokia.com> [101001 05:27]:
>
> --- a/arch/arm/plat-omap/dma.c
> +++ b/arch/arm/plat-omap/dma.c
> @@ -1018,8 +1019,39 @@ void omap_stop_dma(int lch)
> dma_write(0, CICR(lch));
>
> l = dma_read(CCR(lch));
> - l &= ~OMAP_DMA_CCR_EN;
> - dma_write(l, CCR(lch));
> + /* OMAP3 Errata i541: sDMA FIFO draining does not finish */
> + if (cpu_is_omap34xx() && (l & OMAP_DMA_CCR_SEL_SRC_DST_SYNC)) {
> + int i = 0;
> + u32 sys_cf;
> +
> + /* Configure No-Standby */
> + l = dma_read(OCP_SYSCONFIG);
> + sys_cf = l;
> + l &= ~DMA_SYSCONFIG_MIDLEMODE_MASK;
> + l |= DMA_SYSCONFIG_MIDLEMODE(DMA_IDLEMODE_NO_IDLE);
> + dma_write(l , OCP_SYSCONFIG);
> +
> + l = dma_read(CCR(lch));
> + l &= ~OMAP_DMA_CCR_EN;
> + dma_write(l, CCR(lch));
> +
> + /* Wait for sDMA FIFO drain */
> + l = dma_read(CCR(lch));
> + while (i < 100 && (l & (OMAP_DMA_CCR_RD_ACTIVE |
> + OMAP_DMA_CCR_WR_ACTIVE))) {
> + udelay(5);
> + i++;
> + l = dma_read(CCR(lch));
> + }
> + if (i >= 100)
> + printk(KERN_ERR "DMA drain did not completed on "
> + "lch %d\n", lch);
> + /* Restore OCP_SYSCONFIG */
> + dma_write(sys_cf, OCP_SYSCONFIG);
> + } else {
> + l &= ~OMAP_DMA_CCR_EN;
> + dma_write(l, CCR(lch));
> + }
>
> if (!omap_dma_in_1510_mode() && dma_chan[lch].next_lch != -1) {
> int next_lch, cur_lch = lch;
Thinking about moving to use dmaengine.c, we should not use
cpu_is_omapxxxx except during the platform init.
Can you please change this to be in u32 flags in dma.c that get set during
the init only for omap3? Then we can have something like:
#define OMAP_DMA_ERRATA_AAA (1 << 2)
#define OMAP_DMA_ERRATA_BBB (1 << 0)
...
Regards,
Tony
next prev parent reply other threads:[~2010-10-01 16:55 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-01 12:36 [PATCH v3 0/2] OMAP2/3: DMA: FIFO drain errata fixes Peter Ujfalusi
2010-10-01 12:36 ` [PATCH v3 1/2] omap: dma: Fix buffering disable bit setting for omap24xx Peter Ujfalusi
2010-10-02 4:42 ` G, Manjunath Kondaiah
2010-10-04 5:43 ` Jarkko Nikula
2010-10-04 5:55 ` G, Manjunath Kondaiah
2010-10-04 6:15 ` Peter Ujfalusi
2010-10-04 6:23 ` G, Manjunath Kondaiah
2010-10-04 7:15 ` Peter Ujfalusi
2010-10-04 7:36 ` G, Manjunath Kondaiah
2010-10-04 7:41 ` Peter Ujfalusi
2010-10-01 12:36 ` [PATCH v3 2/2] OMAP3: DMA: Errata: sDMA FIFO draining does not finish Peter Ujfalusi
2010-10-01 15:04 ` Shilimkar, Santosh
2010-10-02 4:43 ` G, Manjunath Kondaiah
2010-10-01 16:55 ` Tony Lindgren [this message]
2010-10-01 23:23 ` Tony Lindgren
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=20101001165542.GS3117@atomide.com \
--to=tony@atomide.com \
--cc=jhnikula@gmail.com \
--cc=linux-omap@vger.kernel.org \
--cc=lrg@slimlogic.co.uk \
--cc=peter.ujfalusi@nokia.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.