Skip to content
Snippets Groups Projects
Commit 4c1cd721 authored by Anton staaf's avatar Anton staaf Committed by Wolfgang Denk
Browse files

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: default avatarAnton Staaf <robotboy@chromium.org>
Cc: Lukasz Majewski <l.majewski@samsung.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Dave Liu <r63238@freescale.com>
Cc: Andy Fleming <afleming@gmail.com>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>

Change-Id: I32e1594d90ef039137bb219b0f7ced55768744ff
Acked-by: default avatarMike Frysinger <vapier@gentoo.org>
parent f781dd38
No related branches found
No related tags found
No related merge requests found
......@@ -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;
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment