From patchwork Wed Dec 15 17:35:10 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charles Manning X-Patchwork-Id: 413941 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBFHZTMB028455 for ; Wed, 15 Dec 2010 17:35:30 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752992Ab0LORfQ (ORCPT ); Wed, 15 Dec 2010 12:35:16 -0500 Received: from smtp.scorch.co.nz ([27.110.127.199]:41534 "HELO scorch.co.nz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with SMTP id S1752777Ab0LORfO (ORCPT ); Wed, 15 Dec 2010 12:35:14 -0500 Received: (qmail 29132 invoked by uid 453); 15 Dec 2010 17:35:12 -0000 X-Virus-Checked: Checked by ClamAV on scorch.co.nz Received: from Unknown (HELO linux-dual-head.local) (10.14.21.25) by scorch.co.nz (qpsmtpd/0.40) with ESMTP; Thu, 16 Dec 2010 06:35:12 +1300 From: Charles Manning To: "Luca Ceresoli" Subject: Re: UbiFS + HWECC(?) + BeagleBoard = fail Date: Thu, 16 Dec 2010 06:35:10 +1300 User-Agent: KMail/1.9.10 Cc: linux-omap@vger.kernel.org, notasas@gmail.com References: <201012151713.43028.manningc2@actrix.gen.nz> In-Reply-To: <201012151713.43028.manningc2@actrix.gen.nz> MIME-Version: 1.0 Content-Disposition: inline Message-Id: <201012160635.11024.manningc2@actrix.gen.nz> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Wed, 15 Dec 2010 17:35:30 +0000 (UTC) --- a/drivers/mtd/nand/omap2.c +++ b/drivers/mtd/nand/omap2.c @@ -245,6 +245,18 @@ static void omap_read_buf_pref(struct mtd_info *mtd, u_char *buf, int len) int ret = 0; u32 *p = (u32 *)buf; + /* u32 align the buffer and read */ + /* NB: This assumes the buf ptr can be aligned *down* which is a valid. + * Assumption when dealing with ecc buffers etc. + */ + u32 addr = (u32)p; + + int diff = addr & 3; + addr -= diff; + len += diff; + len = (len + 3) & ~3; + p = (u32 *)addr; + /* take care of subpage reads */