]> git.ipfire.org Git - people/ms/u-boot.git/commit
fat: Use cache aligned buffers for fat_opendir
authorNeil Armstrong <narmstrong@baylibre.com>
Fri, 24 Nov 2017 08:54:41 +0000 (09:54 +0100)
committerTom Rini <trini@konsulko.com>
Thu, 30 Nov 2017 03:36:59 +0000 (22:36 -0500)
commit34dd853ce5f44d34bfb0358c73da2fe9f2a4e5d1
tree0314d77d62f902c3d98a30ccce52c1531be2cf1e
parentb2e01ff5434d6f96f128075d534ebf4d39a10de3
fat: Use cache aligned buffers for fat_opendir

Before this patch one could receive following errors when executing "fatls"
command on machine with cache enabled (ex i.MX6Q) :

=> fatls mmc 0:1
CACHE: Misaligned operation at range [4f59dfc84f59e7c8]
CACHE: Misaligned operation at range [4f59dfc84f59e7c8]
ERROR: v7_outer_cache_inval_range - start address is not aligned - 0x4f59dfc8
ERROR: v7_outer_cache_inval_range - stop address is not aligned - 0x4f59e7c8
CACHE: Misaligned operation at range [4f59dfc84f59e7c8]
CACHE: Misaligned operation at range [4f59dfc84f59e7c8]
ERROR: v7_outer_cache_inval_range - start address is not aligned - 0x4f59dfc8
ERROR: v7_outer_cache_inval_range - stop address is not aligned - 0x4f59e7c8

To alleviate this problem - the calloc()s have been replaced with
malloc_cache_aligned() and memset().

After those changes the buffers are properly aligned (with both start
address and size) to SoC cache line.

Fixes: 09fa964bba80 ("fs/fat: Fix 'CACHE: Misaligned operation at range' warnings")
Suggested-by: Lukasz Majewski <lukma@denx.de>
Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Lukasz Majewski <lukma@denx.de>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
fs/fat/fat.c