From patchwork Wed Oct 12 23:56:02 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton staaf X-Patchwork-Id: 119334 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id CFF75B6F69 for ; Thu, 13 Oct 2011 10:57:11 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id F3EF428B3F; Thu, 13 Oct 2011 01:56:55 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7qD7n57lTLHb; Thu, 13 Oct 2011 01:56:55 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B3D1E28B40; Thu, 13 Oct 2011 01:56:39 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id D4AF02895A for ; Thu, 13 Oct 2011 01:56:32 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pqZ3ele7O4gI for ; Thu, 13 Oct 2011 01:56:32 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.67]) by theia.denx.de (Postfix) with ESMTPS id 8A6C528A8F for ; Thu, 13 Oct 2011 01:56:23 +0200 (CEST) Received: from hpaq13.eem.corp.google.com (hpaq13.eem.corp.google.com [172.25.149.13]) by smtp-out.google.com with ESMTP id p9CNuDiA011262; Wed, 12 Oct 2011 16:56:13 -0700 Received: from servo.mtv.corp.google.com (servo.mtv.corp.google.com [172.22.72.56]) by hpaq13.eem.corp.google.com with ESMTP id p9CNu8K0023731; Wed, 12 Oct 2011 16:56:09 -0700 Received: by servo.mtv.corp.google.com (Postfix, from userid 99248) id 9F11D4A187; Wed, 12 Oct 2011 16:56:08 -0700 (PDT) From: Anton Staaf To: u-boot@lists.denx.de Date: Wed, 12 Oct 2011 16:56:02 -0700 Message-Id: <1318463764-28244-5-git-send-email-robotboy@chromium.org> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <1318463764-28244-1-git-send-email-robotboy@chromium.org> References: <1318463764-28244-1-git-send-email-robotboy@chromium.org> X-System-Of-Record: true Cc: Anton Staaf , Dave Liu , Andy Fleming Subject: [U-Boot] [PATCH v3 4/6] ext2: Cache line aligned partial sector bounce buffer X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 Acked-by: Mike Frysinger Cc: Lukasz Majewski Cc: Mike Frysinger Cc: Dave Liu Cc: Andy Fleming Cc: Albert ARIBAUD --- fs/ext2/dev.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/ext2/dev.c b/fs/ext2/dev.c index 78851d0..874e211 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; /*