lkml.org 
[lkml]   [2018]   [Oct]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
Subject[DMA-engine Question] inconsistent policy of src_addr_widths, dst_addr_widths
Hi.


When I wrote my DMA engine driver,
I had difficulty in understanding
what to set to the struct dma_device members.


For example, src_addr_widths.
I see two driver groups regarding this.



[A] BIT(DMA_SLAVE_BUSWIDTH_*_BYTES) are OR'ed

For example, st_fdma.c

https://github.com/torvalds/linux/blob/v4.19-rc4/drivers/dma/st_fdma.c#L729



[B] DMA_SLAVE_BUSWIDTH_*_BYTES are directly OR'ed without BIT()

For example, sh/rcar-dmac.c

https://github.com/torvalds/linux/blob/v4.19-rc4/drivers/dma/sh/rcar-dmac.c#L1778



Which is correct?



If we go with [A],
BIT(DMA_SLAVE_BUSWIDTH_64_BYTES) i.e. BIT(64)
would not fit in ddevice->src_addr_widths whose type is u32.


If we go with [B], the following formula is met.
DMA_SLAVE_BUSWIDTH_3_BYTES ==
DMA_SLAVE_BUSWIDTH_1_BYTE | DMA_SLAVE_BUSWIDTH_2_BYTES

We never know whether 3_BYTES is supported,
or it is just a combination of 1_BYTE and 2_BYTES.



--
Best Regards
Masahiro Yamada

\
 
 \ /
  Last update: 2018-10-10 14:01    [W:0.022 / U:0.736 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site