From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757751Ab2BCDfm (ORCPT ); Thu, 2 Feb 2012 22:35:42 -0500 Received: from hqemgate03.nvidia.com ([216.228.121.140]:12825 "EHLO hqemgate03.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755954Ab2BCDfl (ORCPT ); Thu, 2 Feb 2012 22:35:41 -0500 X-PGP-Universal: processed; by hqnvupgp07.nvidia.com on Thu, 02 Feb 2012 19:35:33 -0800 From: Venu Byravarasu To: "dedekind1@gmail.com" , Nicolas Ferre , "Voss, Nikolaus" , =?utf-8?B?RXJpYyBCw6luYXJk?= CC: "'linux-mtd@lists.infradead.org'" , "'linux-kernel@vger.kernel.org'" Date: Fri, 3 Feb 2012 09:05:29 +0530 Subject: RE: [PATCH] mtd: atmel_nand: fix access to 16 bit NAND devices Thread-Topic: [PATCH] mtd: atmel_nand: fix access to 16 bit NAND devices Thread-Index: Aczhou94g2X+EODkR2yEqVGrbCEVswAgKUgQ Message-ID: References: <201201251217.q0PCHmRe027024@gatekeeper.vosshq.de> <1327670996.26648.43.camel@sauron.fi.intel.com> <4F265B7E.6060806@atmel.com> <1328184370.28171.175.camel@sauron.fi.intel.com> In-Reply-To: <1328184370.28171.175.camel@sauron.fi.intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US MIME-Version: 1.0 Content-Language: en-US Content-Type: text/plain; charset="utf-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id q133Zsfk000512 I see a problem with atmel_read_buf16 & atmel_write_buf16 functions. As they are calling __raw_readsw & __raw_writesw respectively, which would cause panic in cases of 16 bit unaligned buffers. However, the buf passed to these functions is of type u8* from atmel_read_buf & atmel_write_buf functions. [Venu] > - /* if no DMA operation possible, use PIO */ > - memcpy_fromio(buf, chip->IO_ADDR_R, len); > + if (host->board->bus_width_16) > + atmel_read_buf16(mtd, buf, len); > + else > + atmel_read_buf8(mtd, buf, len); > } {.n++%ݶw{.n+{G{ayʇڙ,jfhz_(階ݢj"mG?&~iOzv^m ?I