From patchwork Thu Jul 4 03:40:36 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuo-Jung Su X-Patchwork-Id: 256781 X-Patchwork-Delegate: sr@denx.de 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 BC7D32C00B3 for ; Thu, 4 Jul 2013 13:41:49 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 71C504A037; Thu, 4 Jul 2013 05:41:41 +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 fft3c0J8BkDv; Thu, 4 Jul 2013 05:41:41 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 26F2F4A053; Thu, 4 Jul 2013 05:40:54 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B6CF14A030 for ; Thu, 4 Jul 2013 05:40:43 +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 sUg6czTlJRiG for ; Thu, 4 Jul 2013 05:40:39 +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 mail-pb0-f42.google.com (mail-pb0-f42.google.com [209.85.160.42]) by theia.denx.de (Postfix) with ESMTPS id 73D734A025 for ; Thu, 4 Jul 2013 05:40:26 +0200 (CEST) Received: by mail-pb0-f42.google.com with SMTP id un1so772495pbc.29 for ; Wed, 03 Jul 2013 20:40:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :in-reply-to:references; bh=a+oxrxL2D98Su2wzsvRWYyMKmHyIqH8K9f4qLR06tZE=; b=WwrXWnbe0Zk8Cf9ag8LVZEbm15jvLK6oHKNH1g1u0Mo8PZDPvzQCOw135J+VDseTi2 +lRSD2KYa21YXmzGA/wsP4z7ikffSn5uQ+UTXI3ZKZZuTrMhpeVGA25IuMpX0IxblCxs EtHzDJkdokqmz919nGzCVW3w8Q+GOL4SOsxRR+UzSi/Q5W0dwk0DkjvuanO9T39hLeR9 HmoGzsC2RUzmp5hOxu9FV5u+wFeoE0CZJkVOLvfcKeGsd3aSTssEmCRW6HObism/f9et 7BEr6SAuo21wSLeVYaMw7HCZ8fOgqslG6TxXljqMCf0zofHGjDUKGDT6CwL3oFCbKNtO PbZQ== X-Received: by 10.68.182.33 with SMTP id eb1mr3549643pbc.186.1372909224723; Wed, 03 Jul 2013 20:40:24 -0700 (PDT) Received: from localhost.localdomain (114-35-170-161.HINET-IP.hinet.net. [114.35.170.161]) by mx.google.com with ESMTPSA id kc8sm976470pbc.18.2013.07.03.20.40.22 for (version=TLSv1 cipher=DES-CBC3-SHA bits=168/168); Wed, 03 Jul 2013 20:40:24 -0700 (PDT) From: Kuo-Jung Su To: u-boot@lists.denx.de Date: Thu, 4 Jul 2013 11:40:36 +0800 Message-Id: <1372909244-25211-5-git-send-email-dantesu@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1372909244-25211-1-git-send-email-dantesu@gmail.com> References: <1372909244-25211-1-git-send-email-dantesu@gmail.com> In-Reply-To: <1364540788-13943-1-git-send-email-dantesu@gmail.com> References: <1364540788-13943-1-git-send-email-dantesu@gmail.com> Cc: Stefan Roese , Kuo-Jung Su Subject: [U-Boot] [PATCH v6 04/12] cfi_flash: use buffer length in unmap_physmem() X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 From: Kuo-Jung Su While the flash_detect_legacy() of drivers/mtd/cfi_flash.c feed unmap_physmem() with MAP_NOCACHE as 2nd parameter, the do_spi_flash_read_write() of common/cmd_sf.c feed unmap_physmem() with the length of the mapped buffer as 2nd parameter. It's apparently a bug, and I personally think the 2nd parameter should be the length of the mapped buffer. Signed-off-by: Kuo-Jung Su CC: Albert Aribaud CC: Stefan Roese --- Changes for v6: - Nothing updates Changes for v5: - Initial commit, which is separated from "arm: add MMU/D-Cache support for Faraday cores" drivers/mtd/cfi_flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 1.7.9.5 diff --git a/drivers/mtd/cfi_flash.c b/drivers/mtd/cfi_flash.c index 25a5710..616750d 100644 --- a/drivers/mtd/cfi_flash.c +++ b/drivers/mtd/cfi_flash.c @@ -1820,7 +1820,7 @@ static int flash_detect_legacy(phys_addr_t base, int banknum) break; else unmap_physmem((void *)info->start[0], - MAP_NOCACHE); + info->portwidth); } }