Jump to content

UAS + mainline kernel + coherent-pool memory size

Recommended Posts

Issue identified by Hardkernel folks with ODROID XU4 and 4.9 kernel: 'When a bunch of sequential data(inode) is being sent to the UAS driver, the UAS driver is increasing the DMA block memory allocation dynamically for more efficient ring-buffer management. But the Kernel coherent-pool memory size was limited at 256KB by default and it was not sufficient for the UAS drivers.'


I added this as a temporary workaround to my OMV installation routine but would like to see this fixed on normal installations and also all affected boards too. I've to admit that I neither know how to determine coherent-pool memory size nor what potential downsides of increasing this are. Also no idea how to apply a fix (kernel patch or cmdline modification?)



Link to comment
Share on other sites

Armbian Linux community supported weekly builds download

3 minutes ago, tkaiser said:

Also no idea how to apply a fix (kernel patch or cmdline modification?)

Looks like the default value is set in arch/arm/mm/dma-mapping.c


so it can be patched instead of altering the kernel command line


This is for 32-bit arm, 64-bit has the same default in arch/arm64/mm/dma-mapping.c

Link to comment
Share on other sites

8 minutes ago, zador.blood.stained said:



So first step could be someone having all of our kernels checked out ( @Igor maybe? ;) ) doing a quick

find $sources -name dma-mapping.c | while read ; do grep DEFAULT_DMA_COHERENT_POOL_SIZE "$REPLY" ; done


Link to comment
Share on other sites

On 28. 7. 2017 at 5:32 PM, tkaiser said:

So first step could be someone having all of our kernels checked out

What can go wrong if we simply put this:



Link to comment
Share on other sites

27 minutes ago, zador.blood.stained said:

A kernel patch is relatively easy to add, easy to remove and the next kernel update will include the new coherent pool size.


OMG, I totally forgot that we need one patch per kernel tree. So I would propose everyone of us touching UAS capable kernels simply adds the necessary increase from 256K to 1MB per kernel when changing anything the next days/weeks.

Link to comment
Share on other sites

2 minutes ago, zador.blood.stained said:

So how would you define a "uas capable kernel"?


All next and dev kernels. Wrt default kernels my believe is we should look starting with 4.4.


Ok, let's look in detail: Stricken through all platforms where UAS isn't working:




I think we don't need to care about rda8810 and s500? Last time I tested with i.MX6 platforms UAS was not available but that needs to be checked. With Armada 38x also no UAS but that needs to be checked too (though I think there aren't that many reasons to maintain default kernel for Clearfogs anyway).


I will check later with EspressoBin. And someone else has to test with MiQi/Tinkerboard.

Link to comment
Share on other sites

Is there an indication that SZ_1M is enough? Synolgoy: https://forum.synology.com/enu/viewtopic.php?t=109025  It looks like 1024k was too small for DVB transport in their case, I find this of interest as I can see an OMV setup with TV tuner being a popular use case (personally biased).  I can patch it, although determining if it worked is another matter.  I can not, for what it's worth, come up with any downside to increasing it, unless of course it cuts too much into available RAM.

Link to comment
Share on other sites

This topic is now closed to further replies.

  • Create New...