From: linux@arm.linux.org.uk (Russell King - ARM Linux)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH RFC 1/2] MUSB: CPPI 4.1 DMA driver (take 4)
Date: Mon, 2 Nov 2009 11:54:58 +0000 [thread overview]
Message-ID: <20091102115458.GA3348@n2100.arm.linux.org.uk> (raw)
In-Reply-To: <19F8576C6E063C45BE387C64729E73940436EEB5EF@dbde02.ent.ti.com>
On Mon, Nov 02, 2009 at 04:27:59PM +0530, Gupta, Ajay Kumar wrote:
> > On Mon, Nov 02, 2009 at 09:51:13AM +0530, Gupta, Ajay Kumar wrote:
> > > Is there any updated patch on cppi4.1 core also?
> >
> > Is there _any_ cppi4.1 core patch anywhere? Not according to google.
>
> Russell,
>
> Here is the latest version of cppi4.1 core.
> http://patchwork.kernel.org/patch/46698/
A few points come up about this.
1. alloc_queue() - this is a find_next_zero_bit loop coupled with a
check for the excluded bitmap.
end = start + count;
do {
bit = find_next_zero_bit(allocated, end, start);
if (bit >= end)
return -ENOSPC;
start = bit + 1;
} while (test_bit(bit, excluded));
__set_bit(bit, allocated);
return bit;
Note that 'allocated' and 'excluded' both need to be arrays of
unsigned long.
2. alloc_queue() again - it looks to me like the existing implementation
is racy - who ensures that we don't have two people searching and
allocating the same bit? A solution to that without adding locking
would be:
end = start + count;
do {
bit = find_next_zero_bit(allocated, end, start);
if (bit >= end)
return -ENOSPC;
start = bit + 1;
} while (test_bit(bit, excluded) || test_and_set_bit(bit, allocated));
return bit;
3. linking_ram - cppi41_queue_mgr_init() seems to be the only user. I
don't see why linking_ram would be necessary.
4. debugging printks via pr_debug() please (and define DEBUG at the top of
the file to enable debugging.)
> > If it's a USB DMA device (from the patches I can find, that seems to be
> > the case) then why can't it live in drivers/usb or drivers/dma ?
>
> CPPI4.1 DMA engine can be used either by USB or by Ethernet interface though
> currently only USB is using it but in future even Ethernet devices may use it.
drivers/dma does seem to be the right place for this.
next prev parent reply other threads:[~2009-11-02 11:54 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <200908142241.00528.sshtylyov@ru.mvista.com>
[not found] ` <4A8A202E.2040505@windriver.com>
[not found] ` <4A8A7047.9080405@ru.mvista.com>
[not found] ` <4A8CF552.3080801@windriver.com>
[not found] ` <19F8576C6E063C45BE387C64729E73940436EEAE36@dbde02.ent.ti.com>
[not found] ` <4AE85B02.1080207@ru.mvista.com>
2009-10-28 15:18 ` [PATCH RFC 1/2] MUSB: CPPI 4.1 DMA driver (take 4) Gupta, Ajay Kumar
2009-11-02 4:21 ` Gupta, Ajay Kumar
2009-11-02 10:37 ` Russell King - ARM Linux
2009-11-02 10:57 ` Gupta, Ajay Kumar
2009-11-02 11:02 ` Felipe Balbi
2009-11-02 11:24 ` Gupta, Ajay Kumar
2009-11-02 11:38 ` Felipe Balbi
2009-11-02 11:54 ` Russell King - ARM Linux [this message]
2009-11-04 3:54 ` Gupta, Ajay Kumar
2009-11-06 3:45 ` Gupta, Ajay Kumar
[not found] ` <4B0ED746.1040201@ru.mvista.com>
2009-11-27 2:37 ` Subbrathnam, Swaminathan
[not found] <19F8576C6E063C45BE387C64729E7394044A2779F5@dbde02.ent.ti.com>
2009-12-29 8:43 ` Gupta, Ajay Kumar
2009-12-29 12:54 ` Felipe Balbi
2009-12-30 3:46 ` Subbrathnam, Swaminathan
2009-12-30 12:24 ` Felipe Balbi
2009-12-30 13:02 ` Subbrathnam, Swaminathan
[not found] ` <4B3B5232.5030804@ru.mvista.com>
2009-12-30 13:22 ` Felipe Balbi
[not found] ` <19F8576C6E063C45BE387C64729E7394044A96D44E@dbde02.ent.ti.com>
2010-02-10 6:46 ` Gupta, Ajay Kumar
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=20091102115458.GA3348@n2100.arm.linux.org.uk \
--to=linux@arm.linux.org.uk \
--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 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).