Re: [PATCH] dmaengine: delete redundant chan_id and chancntinitialization in dma drivers

From: Barry Song
Date: Wed Sep 21 2011 - 20:09:14 EST


2011/9/21 Jassi Brar <jassisinghbrar@xxxxxxxxx>:
> On Fri, Sep 16, 2011 at 3:13 PM, Barry Song <Baohua.Song@xxxxxxx> wrote:
>> dma_async_device_register will re-init chan_id and chancnt,
>> so whatever chan_id and chancnt are set in drivers, they will
>> be re-written by dma_async_device_register.
>>
>> Cc: Nicolas Ferre <nicolas.ferre@xxxxxxxxx>
>> Cc: Viresh Kumar <viresh.kumar@xxxxxx>
>> Cc: Vinod Koul <vinod.koul@xxxxxxxxx>
>> Cc: Piotr Ziecik <kosmo@xxxxxxxxxxxx>
>> Cc: Yong Wang <yong.y.wang@xxxxxxxxx>
>> Cc: Jaswinder Singh <jassi.brar@xxxxxxxxxxx>
>> Cc: Pelagicore AB <info@xxxxxxxxxxxxxx>
>> Signed-off-by: Barry Song <Baohua.Song@xxxxxxx>
>> ---
>> Âdrivers/dma/at_hdmac.c   Â|  Â5 ++---
>> Âdrivers/dma/dw_dmac.c    |  Â5 ++---
>> Âdrivers/dma/intel_mid_dma.c | Â Â2 --
>> Âdrivers/dma/mpc512x_dma.c  |  Â1 -
>> Âdrivers/dma/pch_dma.c    |  Â2 --
>> Âdrivers/dma/pl330.c     |  Â2 --
>> Âdrivers/dma/timb_dma.c   Â|  Â3 +--
>
> Apparently ....
>
> drivers/dma/ppc4xx/adma.c
> drivers/dma/ipu/ipu_idmac.c
> Â Â Â still write to chan_id.
>
> drivers/dma/amba-pl08x.c
> drivers/dma/fsldma.c
> drivers/dma/ioat/dma_v2.c
> drivers/dma/ioat/dma.c
> drivers/dma/mpc512x_dma.c
> drivers/dma/shdma.c
> Â Â Â still write to chancnt
>
> Most of them are simply a matter of removal, but some seem
> like really depending upon setting them(?)
>
> Anyways, even after you modify those as well, chan_id and chancnt
> are rendered overstaying guests in dmaengine core. Because chan_id
> of each channel would be _precisely_ the order in which the
> _dmac-driver_ added the channel to the 'channels' list.
>
> So if their values are _always_ gonna be just contiguously incrementing
> why need variables for that in the dmaengine api?
> Dmac drivers could use local variables for that.
>
> OTOH, why not chan_id be left solely for use by dmac drivers read by the
> dmaengine only to create sysfs entries ?

actually i don't like the way dmaengine core handles chan_id. in my
opinion, every dmac only needs to tell dmaengine core the chan_base.
then dmaengine core set the id in a global scale.

for example, if you have two dmac in system:
dmac0 chan_base 0
dmac1 chan_base 16
then core will have chan 0~31 by chan_id from 0 to 31 but not
dmac0chan0~15, dmac1chan0~15.

client drivers can request a specific chan_id just like it can request a gpio.

now dmac drivers and dmaengine core have repeated chan_id and chancnt,
anyway, it is a problem that should be fixed at first. then i'd like
to have some common function to support the request of specific
chan_id.

>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
>

-barry
--
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/