From: Anton staaf Date: Mon, 3 Oct 2011 13:55:00 +0000 (+0000) Subject: ext2: Cache line aligned partial sector bounce buffer X-Git-Tag: v2011.12-rc1~434 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4c1cd721d89d4b694dd018736007a97b5cdb04da;p=u-boot ext2: Cache line aligned partial sector bounce buffer Currently, if a device read request is done that does not begin or end on a sector boundary a stack allocated bounce buffer is used to perform the read, and then just the part of the sector that is needed is copied into the users buffer. This stack allocation can mean that the bounce buffer will not be aligned to the dcache line size. This is a problem when caches are enabled because unaligned cache invalidates are not safe. This patch uses ALLOC_CACHE_ALIGN_BUFFER to create a stack allocated cache line size aligned bounce buffer. Signed-off-by: Anton Staaf Cc: Lukasz Majewski Cc: Mike Frysinger Cc: Dave Liu Cc: Andy Fleming Cc: Albert ARIBAUD Change-Id: I32e1594d90ef039137bb219b0f7ced55768744ff Acked-by: Mike Frysinger --- diff --git a/fs/ext2/dev.c b/fs/ext2/dev.c index 78851d0a5d..874e21161e 100644 --- a/fs/ext2/dev.c +++ b/fs/ext2/dev.c @@ -52,7 +52,7 @@ int ext2fs_set_blk_dev(block_dev_desc_t *rbdd, int part) int ext2fs_devread(int sector, int byte_offset, int byte_len, char *buf) { - char sec_buf[SECTOR_SIZE]; + ALLOC_CACHE_ALIGN_BUFFER(char, sec_buf, SECTOR_SIZE); unsigned sectors; /*