[lkml]   [2011]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCHv2] DMAEngine: Let dmac drivers to set chan_id
On 26 July 2011 01:38, Williams, Dan J <> wrote:

>>> I can sort of see why it is attractive for the goal of having clients
>>> being able to talk to multiple DMACs since it is a field that all
>>> channels already implement.  But, I don't think we should be mixing
>>> sysfs presentation details with a capability that indicates a certain
>>> compatibility level in a DMAC driver implementation.  If the goal is
>>> to be able to use a single client with multiple drivers that, to me,
>>> is asking for a new capability bit (dma_transaction_type) rather than
>>> an id.  Do you have an example of the client and the DMACs that would
>>> first take advantage of such a cross DMAC compatibility?
>> Apparently I fail to explain my well. let me ask you this....
>> Some DMAC drivers initialize chan_id before calling dma_async_device_register().
>> And dma_async_device_register() overwrites the chan_id _always_.
>> Clearly only _one_ of them should be setting chan_id. Which was meant to be?
> Correct, it is meant that chan_id is only a sysfs property.  Any
> driver usage that is assuming chan_id is anything more than a
> guaranteed unique number within a given dma_device's list of channels
> is probably inferring too much.

So you mean dmac/client drivers are wrong if they make use of chan_id.
They shouldn't count upon it's value - which is set by DMA API for a completely
independent purpose, i.e, creating contiguous sysfs entries.

Since "chan_id is only a sysfs property" and the fact that it is used
only _once_
by the DMA API

In drivers/dma/dmaengine.c

chan->chan_id = chancnt++;
dev_set_name(&chan->dev->device, "dma%dchan%d",
device->dev_id, chan->chan_id);

Can't we do away with chan_id altogether ? by having

dev_set_name(&chan->dev->device, "dma%dchan%d",
device->dev_id, chancnt++);

I mean why make every instance of dma_chan bigger by 4bytes ?

So why shouldn't we remove chan_id completely from the DMA API ?


-- │ Open source software for ARM SoCs | Follow Linaro  -!/linaroorg -
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2011-07-26 16:33    [W:0.095 / U:0.400 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site