From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-yw0-f49.google.com ([209.85.213.49]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1RSxW0-00057o-Ps for linux-mtd@lists.infradead.org; Tue, 22 Nov 2011 21:04:29 +0000 Received: by ywa12 with SMTP id 12so756916ywa.36 for ; Tue, 22 Nov 2011 13:04:27 -0800 (PST) Subject: Re: [PATCH v3 3/3] mtd/nand : workaround for Freescale FCM to support large-page Nand chip From: Artem Bityutskiy To: b35362@freescale.com Date: Tue, 22 Nov 2011 23:04:18 +0200 In-Reply-To: <1321349355-1639-3-git-send-email-b35362@freescale.com> References: <1321349355-1639-1-git-send-email-b35362@freescale.com> <1321349355-1639-2-git-send-email-b35362@freescale.com> <1321349355-1639-3-git-send-email-b35362@freescale.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Message-ID: <1321995862.2222.2.camel@koala> Mime-Version: 1.0 Cc: Artem.Bityutskiy@nokia.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Liu Shuo , Shengzhou Liu , linux-mtd@lists.infradead.org, scottwood@freescale.com, akpm@linux-foundation.org, leoli@freescale.com, dwmw2@infradead.org Reply-To: dedekind1@gmail.com List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, 2011-11-15 at 17:29 +0800, b35362@freescale.com wrote: > + /* > + * Freescale FCM controller has a 2K size limitation of buffer > + * RAM, so elbc_fcm_ctrl->buffer have to be used if writesize > + * of chip is greater than 2048. > + * We malloc a large enough buffer at this point, because we > + * don't know writesize before calling nand_scan(). We will > + * re-malloc later if needed. > + */ > + elbc_fcm_ctrl->buffer = kmalloc(4096 * 6, GFP_KERNEL); > + if (!elbc_fcm_ctrl->buffer) > + return -ENOMEM; Why 4096*6? Judging from the comment it should be 4096. Artem. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-gx0-f179.google.com (mail-gx0-f179.google.com [209.85.161.179]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority" (verified OK)) by ozlabs.org (Postfix) with ESMTPS id CFBE31007DA for ; Wed, 23 Nov 2011 08:04:30 +1100 (EST) Received: by ggnq2 with SMTP id q2so711221ggn.38 for ; Tue, 22 Nov 2011 13:04:27 -0800 (PST) Subject: Re: [PATCH v3 3/3] mtd/nand : workaround for Freescale FCM to support large-page Nand chip From: Artem Bityutskiy To: b35362@freescale.com Date: Tue, 22 Nov 2011 23:04:18 +0200 In-Reply-To: <1321349355-1639-3-git-send-email-b35362@freescale.com> References: <1321349355-1639-1-git-send-email-b35362@freescale.com> <1321349355-1639-2-git-send-email-b35362@freescale.com> <1321349355-1639-3-git-send-email-b35362@freescale.com> Content-Type: text/plain; charset="UTF-8" Message-ID: <1321995862.2222.2.camel@koala> Mime-Version: 1.0 Cc: Artem.Bityutskiy@nokia.com, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Liu Shuo , Shengzhou Liu , linux-mtd@lists.infradead.org, scottwood@freescale.com, akpm@linux-foundation.org, dwmw2@infradead.org Reply-To: dedekind1@gmail.com List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On Tue, 2011-11-15 at 17:29 +0800, b35362@freescale.com wrote: > + /* > + * Freescale FCM controller has a 2K size limitation of buffer > + * RAM, so elbc_fcm_ctrl->buffer have to be used if writesize > + * of chip is greater than 2048. > + * We malloc a large enough buffer at this point, because we > + * don't know writesize before calling nand_scan(). We will > + * re-malloc later if needed. > + */ > + elbc_fcm_ctrl->buffer = kmalloc(4096 * 6, GFP_KERNEL); > + if (!elbc_fcm_ctrl->buffer) > + return -ENOMEM; Why 4096*6? Judging from the comment it should be 4096. Artem. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758455Ab1KVVE3 (ORCPT ); Tue, 22 Nov 2011 16:04:29 -0500 Received: from mail-gy0-f174.google.com ([209.85.160.174]:55745 "EHLO mail-gy0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755957Ab1KVVE2 (ORCPT ); Tue, 22 Nov 2011 16:04:28 -0500 Subject: Re: [PATCH v3 3/3] mtd/nand : workaround for Freescale FCM to support large-page Nand chip From: Artem Bityutskiy Reply-To: dedekind1@gmail.com To: b35362@freescale.com Cc: dwmw2@infradead.org, Artem.Bityutskiy@nokia.com, linux-mtd@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, leoli@freescale.com, scottwood@freescale.com, Liu Shuo , Shengzhou Liu Date: Tue, 22 Nov 2011 23:04:18 +0200 In-Reply-To: <1321349355-1639-3-git-send-email-b35362@freescale.com> References: <1321349355-1639-1-git-send-email-b35362@freescale.com> <1321349355-1639-2-git-send-email-b35362@freescale.com> <1321349355-1639-3-git-send-email-b35362@freescale.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.0.3 (3.0.3-1.fc15) Content-Transfer-Encoding: 7bit Message-ID: <1321995862.2222.2.camel@koala> Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2011-11-15 at 17:29 +0800, b35362@freescale.com wrote: > + /* > + * Freescale FCM controller has a 2K size limitation of buffer > + * RAM, so elbc_fcm_ctrl->buffer have to be used if writesize > + * of chip is greater than 2048. > + * We malloc a large enough buffer at this point, because we > + * don't know writesize before calling nand_scan(). We will > + * re-malloc later if needed. > + */ > + elbc_fcm_ctrl->buffer = kmalloc(4096 * 6, GFP_KERNEL); > + if (!elbc_fcm_ctrl->buffer) > + return -ENOMEM; Why 4096*6? Judging from the comment it should be 4096. Artem.