Re: [PATCH v2] PL330: Add PL330 DMA controller driver

From: jassi brar
Date: Tue Mar 30 2010 - 21:41:11 EST


On Wed, Mar 31, 2010 at 10:07 AM, Ben Dooks <ben-linux@xxxxxxxxx> wrote:
> On Fri, Mar 26, 2010 at 11:08:06AM +0900, jassi brar wrote:
>> On Thu, Mar 25, 2010 at 12:17 PM, Joonyoung Shim
>> <jy0922.shim@xxxxxxxxxxx> wrote:
>> > +static struct pl330_desc *
>> > +pl330_alloc_descriptor(struct pl330_chan *pl330_ch, gfp_t flags)
>> > +{
>> > + Â Â Â struct device *dev = pl330_ch->pl330_dev->common.dev;
>> > + Â Â Â struct pl330_desc *desc;
>> > + Â Â Â dma_addr_t phys;
>> > +
>> > + Â Â Â desc = kzalloc(sizeof(*desc), flags);
>> > + Â Â Â if (!desc)
>> > + Â Â Â Â Â Â Â return NULL;
>> > +
>> > + Â Â Â desc->desc_pool_virt = dma_alloc_coherent(dev, PL330_POOL_SIZE, &phys,
>> > + Â Â Â Â Â Â Â Â Â Â Â flags);
>> These allocations are inefficient and don't need to be done so often.
>> My implementation allocates a pool of such buffers(size specified by
>> DMA API driver)
>> and manage them by simple pointer manipulation.
>> Though the xfer requests for DMA API has to be managed in the DMA API driver.
>
> There's a dma pool implementation too in the kernel.
I meant during 'probe' of the DMAC a chunk of dma consistent memory is allocated
for MicroCode for each channel.
We use the same chunk during xfers, since we can generate MC in a way that 256
bytes are enough to do xfer of 2.5MB at burst size of 1 byte and for
bulkier requests
the DMA API driver can either break the bigger request or allocate
bigger chunk for
the channels.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/