From: Robert Jarzmik <robert.jarzmik@free.fr>
To: Vinod Koul <vinod.koul@intel.com>
Cc: Jonathan Corbet <corbet@lwn.net>, Daniel Mack <daniel@zonque.org>,
Haojian Zhuang <haojian.zhuang@gmail.com>,
dmaengine@vger.kernel.org, linux-doc@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH v2 3/5] dmaengine: pxa: add pxa dmaengine driver
Date: Sat, 09 May 2015 19:00:43 +0200 [thread overview]
Message-ID: <87twvln0sk.fsf@belgarion.home> (raw)
In-Reply-To: <20150509115911.GL3521@localhost> (Vinod Koul's message of "Sat, 9 May 2015 17:29:11 +0530")
Vinod Koul <vinod.koul@intel.com> writes:
> On Fri, May 08, 2015 at 02:28:37PM +0200, Robert Jarzmik wrote:
>> Sorry I don't get this comment, would you care to explain me please ?
> Right now you are using very genric names which can conflict with others, so
> makese sense to add PXA_DCMD_LENGTH with me lesser prone to conflicts rather
> than DCMD_LENGTH
OK, got it, for v3.
>> >> + } while (0)
>> >> +
>> >> +/*
>> > ??
>> > Does this code compile?
Ah I see what happens. The patch 4/5 adds :
+ * Debug fs
+ */
And fixes this. Actually this line belongs to patch 4/5, and not 3/5. That's why
I didn't see the compilation issue, I compiled with all 5 patches applied. I'll
move that comment beginner to patch 4/5, good catch.
I'll also run it through my "bissectability check" automaton to see if other
culprits lay around.
>> >> + spin_lock_irqsave(&pdev->phy_lock, flags);
>> >> + for (prio = pchan->prio; prio >= PXAD_PRIO_HIGHEST; prio--) {
>> >> + for (i = 0; i < pdev->nr_chans; i++) {
>> >> + if (prio != (i & 0xf) >> 2)
>> >> + continue;
>> >> + phy = &pdev->phys[i];
>> >> + if (!phy->vchan) {
>> >> + phy->vchan = pchan;
>> >> + found = phy;
>> >> + goto out_unlock;
>> > what does phy have to do with priorty here?
>> Each phy has a priority, it's part of the hardware. IOW each phy has a "granted
>> bandwidth". This guarantee is based on the number of request on the system bus
>> the DMA IP can place.
>>
>> In PXA2xx/PXA3xx, the DMA IP can have 8 simulaneous request. The highest
>> priority phys always get 4 slots, the high 2 slots, etc ...
>>
>> So a priority is an intrinsic property of a phy.
> Yes that part is ok, but why are you looking up priorty while searching for
> a phy, searching thru number of channels should suffice?
This loop has this as a requirement :
- if available, find the first free phy of priority prio
- if not available, find the first free phy of higher priority than prio
- etc ... up to all priorities
That fullfills the bandwidth requirement, ie. a channel request of priority prio
ends up mapped on a phy of priority prio or better. Is it any clearer now ?
>> >> +static enum dma_status pxad_tx_status(struct dma_chan *dchan,
>> >> + dma_cookie_t cookie,
>> >> + struct dma_tx_state *txstate)
>> >> +{
>> >> + struct pxad_chan *chan = to_pxad_chan(dchan);
>> >> + enum dma_status ret;
>> >> +
>> >> + ret = dma_cookie_status(dchan, cookie, txstate);
>> > pls check if txstate is valid
>> My understanding is that's already the job of dma_cookie_status() and
>> dma_set_residue().
> Yes it is, but is txstate is NULL then no need to calculate residue so bail
> out here
Ah got it now, it's an optimization to not call pxad_residue() needlessly. Ok,
I'll add that for v3, good idea.
--
Robert
next prev parent reply other threads:[~2015-05-09 17:01 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-11 19:40 [PATCH v2 0/5] Driver for pxa architectures Robert Jarzmik
2015-04-11 19:40 ` [PATCH v2 1/5] Documentation: dmaengine: pxa-dma design Robert Jarzmik
2015-05-08 4:36 ` Vinod Koul
2015-05-08 12:52 ` Robert Jarzmik
2015-05-12 10:12 ` Vinod Koul
2015-05-12 19:13 ` Robert Jarzmik
2015-04-11 19:40 ` [PATCH v2 2/5] MAINTAINERS: add pxa dma driver to pxa architecture Robert Jarzmik
2015-04-11 19:40 ` [PATCH v2 3/5] dmaengine: pxa: add pxa dmaengine driver Robert Jarzmik
2015-05-08 6:34 ` Vinod Koul
2015-05-08 12:28 ` Robert Jarzmik
2015-05-09 11:59 ` Vinod Koul
2015-05-09 17:00 ` Robert Jarzmik [this message]
2015-04-11 19:40 ` [PATCH v2 4/5] dmaengine: pxa_dma: add debug information Robert Jarzmik
2015-04-11 19:40 ` [PATCH v2 5/5] dmaengine: pxa_dma: add support for legacy transition Robert Jarzmik
2015-04-19 20:01 ` [PATCH v2 0/5] Driver for pxa architectures Robert Jarzmik
2015-04-26 19:59 ` Robert Jarzmik
2015-05-01 20:13 ` Robert Jarzmik
2015-05-03 15:23 ` Vinod Koul
2015-05-03 18:47 ` Robert Jarzmik
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=87twvln0sk.fsf@belgarion.home \
--to=robert.jarzmik@free.fr \
--cc=arnd@arndb.de \
--cc=corbet@lwn.net \
--cc=daniel@zonque.org \
--cc=dmaengine@vger.kernel.org \
--cc=haojian.zhuang@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vinod.koul@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®