From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3] dmaengine: add CSR SiRFprimaII DMAC driver
Date: Mon, 17 Oct 2011 17:11:07 +0200 [thread overview]
Message-ID: <201110171711.07384.arnd@arndb.de> (raw)
In-Reply-To: <CAGsJ_4y4ZxqmefxXS+2QEtTcq6Jr9+o92pd4enRYQMkG3kZ=ng@mail.gmail.com>
On Monday 17 October 2011, Barry Song wrote:
> >> +
> >> + /* Start the DMA transfer */
> >> + writel_relaxed(sdesc->width, sdma->base + SIRFSOC_DMA_WIDTH_0 + cid * 4);
> >> + writel_relaxed(cid | (schan->mode << SIRFSOC_DMA_MODE_CTRL_BIT) |
> >> + (sdesc->dir << SIRFSOC_DMA_DIR_CTRL_BIT),
> >> + sdma->base + cid * 0x10 + SIRFSOC_DMA_CH_CTRL);
> >> + writel_relaxed(sdesc->xlen, sdma->base + cid * 0x10 + SIRFSOC_DMA_CH_XLEN);
> >> + writel_relaxed(sdesc->ylen, sdma->base + cid * 0x10 + SIRFSOC_DMA_CH_YLEN);
> >> + writel_relaxed(readl_relaxed(sdma->base + SIRFSOC_DMA_INT_EN) | (1 << cid),
> >> + sdma->base + SIRFSOC_DMA_INT_EN);
> >> + writel(sdesc->addr >> 2, sdma->base + cid * 0x10 + SIRFSOC_DMA_CH_ADDR);
> >> +
> >> + if (sdesc->cyclic) {
> >> + writel((1 << cid) | 1 << (cid + 16) |
> >> + readl_relaxed(sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL),
> >> + sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL);
> >> + schan->happened_cyclic = schan->completed_cyclic = 0;
> >> + }
> > any reason why we have mixed use of writel_relaxes and writel?
> > Shouldn't all the DMA register writes be done only using writel?
>
> Arnd comment this in v2.
The new version looks good to me, but a comment in the source code would
be very helpful, especially to prevent people from attempting to "fix" it
in the future.
I'm not sure about the writel/readl_relaxed in the end of that function,
because I don't understand what having a "cyclic" descriptor means.
Arnd
WARNING: multiple messages have this Message-ID (diff)
From: Arnd Bergmann <arnd@arndb.de>
To: linux-arm-kernel@lists.infradead.org
Cc: Barry Song <21cnbao@gmail.com>, Vinod Koul <vinod.koul@intel.com>,
Jassi Brar <jaswinder.singh@linaro.org>,
Linus Walleij <linus.walleij@linaro.org>,
linux-kernel@vger.kernel.org, workgroup.linux@csr.com,
Rongjun Ying <rongjun.ying@csr.com>,
Barry Song <Barry.Song@csr.com>
Subject: Re: [PATCH v3] dmaengine: add CSR SiRFprimaII DMAC driver
Date: Mon, 17 Oct 2011 17:11:07 +0200 [thread overview]
Message-ID: <201110171711.07384.arnd@arndb.de> (raw)
In-Reply-To: <CAGsJ_4y4ZxqmefxXS+2QEtTcq6Jr9+o92pd4enRYQMkG3kZ=ng@mail.gmail.com>
On Monday 17 October 2011, Barry Song wrote:
> >> +
> >> + /* Start the DMA transfer */
> >> + writel_relaxed(sdesc->width, sdma->base + SIRFSOC_DMA_WIDTH_0 + cid * 4);
> >> + writel_relaxed(cid | (schan->mode << SIRFSOC_DMA_MODE_CTRL_BIT) |
> >> + (sdesc->dir << SIRFSOC_DMA_DIR_CTRL_BIT),
> >> + sdma->base + cid * 0x10 + SIRFSOC_DMA_CH_CTRL);
> >> + writel_relaxed(sdesc->xlen, sdma->base + cid * 0x10 + SIRFSOC_DMA_CH_XLEN);
> >> + writel_relaxed(sdesc->ylen, sdma->base + cid * 0x10 + SIRFSOC_DMA_CH_YLEN);
> >> + writel_relaxed(readl_relaxed(sdma->base + SIRFSOC_DMA_INT_EN) | (1 << cid),
> >> + sdma->base + SIRFSOC_DMA_INT_EN);
> >> + writel(sdesc->addr >> 2, sdma->base + cid * 0x10 + SIRFSOC_DMA_CH_ADDR);
> >> +
> >> + if (sdesc->cyclic) {
> >> + writel((1 << cid) | 1 << (cid + 16) |
> >> + readl_relaxed(sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL),
> >> + sdma->base + SIRFSOC_DMA_CH_LOOP_CTRL);
> >> + schan->happened_cyclic = schan->completed_cyclic = 0;
> >> + }
> > any reason why we have mixed use of writel_relaxes and writel?
> > Shouldn't all the DMA register writes be done only using writel?
>
> Arnd comment this in v2.
The new version looks good to me, but a comment in the source code would
be very helpful, especially to prevent people from attempting to "fix" it
in the future.
I'm not sure about the writel/readl_relaxed in the end of that function,
because I don't understand what having a "cyclic" descriptor means.
Arnd
next prev parent reply other threads:[~2011-10-17 15:11 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-17 9:36 [PATCH v3] dmaengine: add CSR SiRFprimaII DMAC driver Barry Song
2011-10-17 9:36 ` Barry Song
2011-10-17 13:57 ` Vinod Koul
2011-10-17 13:57 ` Vinod Koul
2011-10-17 14:10 ` Linus Walleij
2011-10-17 14:10 ` Linus Walleij
2011-10-17 14:18 ` Barry Song
2011-10-17 14:18 ` Barry Song
2011-10-17 15:11 ` Arnd Bergmann [this message]
2011-10-17 15:11 ` Arnd Bergmann
2011-10-17 16:42 ` Vinod Koul
2011-10-17 16:42 ` Vinod Koul
2011-10-17 16:29 ` Vinod Koul
2011-10-17 16:29 ` Vinod Koul
2011-10-18 1:28 ` Barry Song
2011-10-18 1:28 ` Barry Song
2011-10-17 14:45 ` Barry Song
2011-10-17 14:45 ` Barry Song
2011-10-17 16:30 ` Vinod Koul
2011-10-17 16:30 ` Vinod Koul
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=201110171711.07384.arnd@arndb.de \
--to=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.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.