From d025021e981fc2c06e95a3512f81f799f45d1f9c Mon Sep 17 00:00:00 2001 From: Clemens Gruber Date: Mon, 29 Aug 2016 17:10:36 +0200 Subject: gunzip: cache-align write buffer memory When using gzwrite to eMMC on an i.MX6Q board, the following warning occurs repeatedly: CACHE: Misaligned operation at range [4fd63318, 4fe63318] This patch cache-aligns the memory allocation for the gzwrite writebuf, therefore avoiding the misaligned dcache flush and the warning from check_cache_range. Signed-off-by: Clemens Gruber Reviewed-by: Eric Nelson Reviewed-by: Stefan Agner --- lib/gunzip.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/gunzip.c b/lib/gunzip.c index bc746d655e..832b3064e7 100644 --- a/lib/gunzip.c +++ b/lib/gunzip.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include @@ -193,7 +194,7 @@ int gzwrite(unsigned char *src, int len, s.next_in = src + i; s.avail_in = payload_size+8; - writebuf = (unsigned char *)malloc(szwritebuf); + writebuf = (unsigned char *)malloc_cache_aligned(szwritebuf); /* decompress until deflate stream ends or end of file */ do { -- cgit v1.2.3