From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4A5737AA.7050208@gmail.com> Date: Fri, 10 Jul 2009 15:44:26 +0300 From: Artem Bityutskiy MIME-Version: 1.0 To: David Woodhouse Subject: Re: [PATCH 2:2][MTD][NAND]omap : Adding DMA mode support in nand prefetch/post-write References: <63362.192.168.10.89.1247226916.squirrel@dbdmail.itg.ti.com> <1247227344.20721.363.camel@localhost.localdomain> <1247229621.29541.4.camel@macbook.infradead.org> In-Reply-To: <1247229621.29541.4.camel@macbook.infradead.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, david-b@pacbell.net, Tony Lindgren , linux-mtd@lists.infradead.org, vimal singh List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , David Woodhouse wrote: > On Fri, 2009-07-10 at 15:02 +0300, Artem Bityutskiy wrote: >> On Fri, 2009-07-10 at 17:25 +0530, vimal singh wrote: >>> + /* The fifo depth is 64 bytes. We have a sync at each frame and frame >>> + * length is 64 bytes. >>> + */ >>> + int buf_len = len/64; >> To optimize performance it is better not to rely on gcc and use << > > If you ever see gcc screwing up division of an 'int' by a constant 64, > file a GCC bug. I did see gcc generated division instruction instead of shift instruction on x86 when the kernel is compiles with size optimization. I think this is because it division instruction is shorter. The exact place I we saw was the UBIFS binary search function, and division by 2 was not compiled into a shift instruction. So what I suggested is to use shift explicitly if this is wanted. -- Best Regards, Artem Bityutskiy (Артём Битюцкий) From mboxrd@z Thu Jan 1 00:00:00 1970 From: Artem Bityutskiy Subject: Re: [PATCH 2:2][MTD][NAND]omap : Adding DMA mode support in nand prefetch/post-write Date: Fri, 10 Jul 2009 15:44:26 +0300 Message-ID: <4A5737AA.7050208@gmail.com> References: <63362.192.168.10.89.1247226916.squirrel@dbdmail.itg.ti.com> <1247227344.20721.363.camel@localhost.localdomain> <1247229621.29541.4.camel@macbook.infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; Format="flowed" Content-Transfer-Encoding: base64 Return-path: In-Reply-To: <1247229621.29541.4.camel@macbook.infradead.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-mtd-bounces@lists.infradead.org Errors-To: linux-mtd-bounces+gldm-linux-mtd-36=gmane.org@lists.infradead.org To: David Woodhouse Cc: linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org, david-b@pacbell.net, Tony Lindgren , linux-mtd@lists.infradead.org, vimal singh List-Id: linux-omap@vger.kernel.org RGF2aWQgV29vZGhvdXNlIHdyb3RlOgo+IE9uIEZyaSwgMjAwOS0wNy0xMCBhdCAxNTowMiArMDMw MCwgQXJ0ZW0gQml0eXV0c2tpeSB3cm90ZToKPj4gT24gRnJpLCAyMDA5LTA3LTEwIGF0IDE3OjI1 ICswNTMwLCB2aW1hbCBzaW5naCB3cm90ZToKPj4+ICsJLyogVGhlIGZpZm8gZGVwdGggaXMgNjQg Ynl0ZXMuIFdlIGhhdmUgYSBzeW5jIGF0IGVhY2ggZnJhbWUgYW5kIGZyYW1lCj4+PiArCSAqIGxl bmd0aCBpcyA2NCBieXRlcy4KPj4+ICsJICovCj4+PiArCWludCBidWZfbGVuID0gbGVuLzY0Owo+ PiBUbyBvcHRpbWl6ZSBwZXJmb3JtYW5jZSBpdCBpcyBiZXR0ZXIgbm90IHRvIHJlbHkgb24gZ2Nj IGFuZCB1c2UgPDwKPiAKPiBJZiB5b3UgZXZlciBzZWUgZ2NjIHNjcmV3aW5nIHVwIGRpdmlzaW9u IG9mIGFuICdpbnQnIGJ5IGEgY29uc3RhbnQgNjQsCj4gZmlsZSBhIEdDQyBidWcuCgpJIGRpZCBz ZWUgZ2NjIGdlbmVyYXRlZCBkaXZpc2lvbiBpbnN0cnVjdGlvbiBpbnN0ZWFkIG9mIHNoaWZ0Cmlu c3RydWN0aW9uIG9uIHg4NiB3aGVuIHRoZSBrZXJuZWwgaXMgY29tcGlsZXMgd2l0aCBzaXplIG9w dGltaXphdGlvbi4KSSB0aGluayB0aGlzIGlzIGJlY2F1c2UgaXQgZGl2aXNpb24gaW5zdHJ1Y3Rp b24gaXMgc2hvcnRlci4KClRoZSBleGFjdCBwbGFjZSBJIHdlIHNhdyB3YXMgdGhlIFVCSUZTIGJp bmFyeSBzZWFyY2ggZnVuY3Rpb24sIGFuZApkaXZpc2lvbiBieSAyIHdhcyBub3QgY29tcGlsZWQg aW50byBhIHNoaWZ0IGluc3RydWN0aW9uLgoKU28gd2hhdCBJIHN1Z2dlc3RlZCBpcyB0byB1c2Ug c2hpZnQgZXhwbGljaXRseSBpZiB0aGlzIGlzIHdhbnRlZC4KCi0tIApCZXN0IFJlZ2FyZHMsCkFy dGVtIEJpdHl1dHNraXkgKNCQ0YDRgtGR0Lwg0JHQuNGC0Y7RhtC60LjQuSkKCl9fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fXwpMaW51eCBNVEQgZGlz Y3Vzc2lvbiBtYWlsaW5nIGxpc3QKaHR0cDovL2xpc3RzLmluZnJhZGVhZC5vcmcvbWFpbG1hbi9s aXN0aW5mby9saW51eC1tdGQvCg== From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757432AbZGJMqf (ORCPT ); Fri, 10 Jul 2009 08:46:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757081AbZGJMox (ORCPT ); Fri, 10 Jul 2009 08:44:53 -0400 Received: from smtp.nokia.com ([192.100.105.134]:19946 "EHLO mgw-mx09.nokia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756965AbZGJMow (ORCPT ); Fri, 10 Jul 2009 08:44:52 -0400 Message-ID: <4A5737AA.7050208@gmail.com> Date: Fri, 10 Jul 2009 15:44:26 +0300 From: Artem Bityutskiy User-Agent: Thunderbird 2.0.0.21 (X11/20090320) MIME-Version: 1.0 To: David Woodhouse CC: dedekind@infradead.org, vimal singh , linux-mtd@lists.infradead.org, Tony Lindgren , david-b@pacbell.net, linux-kernel@vger.kernel.org, linux-omap@vger.kernel.org Subject: Re: [PATCH 2:2][MTD][NAND]omap : Adding DMA mode support in nand prefetch/post-write References: <63362.192.168.10.89.1247226916.squirrel@dbdmail.itg.ti.com> <1247227344.20721.363.camel@localhost.localdomain> <1247229621.29541.4.camel@macbook.infradead.org> In-Reply-To: <1247229621.29541.4.camel@macbook.infradead.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-OriginalArrivalTime: 10 Jul 2009 12:44:29.0141 (UTC) FILETIME=[2A473850:01CA015C] X-Nokia-AV: Clean Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org David Woodhouse wrote: > On Fri, 2009-07-10 at 15:02 +0300, Artem Bityutskiy wrote: >> On Fri, 2009-07-10 at 17:25 +0530, vimal singh wrote: >>> + /* The fifo depth is 64 bytes. We have a sync at each frame and frame >>> + * length is 64 bytes. >>> + */ >>> + int buf_len = len/64; >> To optimize performance it is better not to rely on gcc and use << > > If you ever see gcc screwing up division of an 'int' by a constant 64, > file a GCC bug. I did see gcc generated division instruction instead of shift instruction on x86 when the kernel is compiles with size optimization. I think this is because it division instruction is shorter. The exact place I we saw was the UBIFS binary search function, and division by 2 was not compiled into a shift instruction. So what I suggested is to use shift explicitly if this is wanted. -- Best Regards, Artem Bityutskiy (Артём Битюцкий)