I am trying to test the ION Driver in linux 4.4.60. I am testing in 32 bit kernel. This particular test case "DMAReadCached" in tests/device_test.cpp (part of LIBION) is failing.
Details on DMAReadCached: (This fails)
This is a test case where memory will be allocated by ION Driver and ION itself will take care of cache maintenance. (ION_IOC_FLAGGED). We are trying to write something into the cached memory allocated. And we are trying to read it into an userspace buffer. Then we compare the data written in userspace buffer with the original data we wrote in the cached memory.
FYI: DMAReadCachedNeedsSync is another test case where memory will be allocated by ION but cache maintenance will be done by explicit sync calls. This test case passed. DMAWriteCached also passed where we do the opposite of DMAReadCached.
I am currently using NULL Device (it must not create any issues for 32 bit kernel?). Only for 64 bit kernel we need proper device passed.
I tried to debug and I found that readDMA is not happening properly where I will be reading from a fd allocated using ion_alloc into a buf allocated in user space.
Also, DMAReadCached with explicit call to sync passed. But by default this test case should pass without the sync call itself.
Can anyone with knowledge on ION comment or help by suggesting the possible reasons for failure of this test case?
This is the only test case that is failing. Any help is appreciated.