android: ion: fix missing buffer initialization
Every buffer allocated to userspace should be initialized to a
specific pattern to remove data written by previous users of the
memory in the buffer. The initialization should include elimination
of dirty cache lines allocated for a uncached buffer to prevent write
back from dirty cache lines after uncached data write to the buffer.
This write-back corrupts the buffer with the stale data in the cache.
Cache flush on allocation uses __flush_dcache_area() that is not a
kernel API function allowed for the drivers. But we have no chice than
that because dma-mapping API needs a device descriptor configured for
DMA. Instead modifying pseudo device descriptor, ion_device, we have
decided to use ARM64 specific function __funsh_dcache_area() for
convenient maintenance.
Change-Id: I6d6dda56a5ac4f8cf9dc796b3eddb7ba40e337d9
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>