lkml.org 
[lkml]   [2011]   [Jul]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCHv2] DMAEngine: Let dmac drivers to set chan_id
From
On Tue, Jul 26, 2011 at 7:30 AM, Jaswinder Singh
<jaswinder.singh@linaro.org> wrote:
> On 26 July 2011 01:38, Williams, Dan J <dan.j.williams@intel.com> wrote:
>> 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.

They can count on it being unique, and maybe the fact that it is in
the same order as dma_device.channels.

>
> 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 ?

Good point... Let's remove chan_id from the core and push it into the
drivers that need it.

--
Dan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-07-26 17:41    [W:0.130 / U:0.444 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site