From patchwork Mon Jun 17 12:06:56 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: 251828 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 480632C029B for ; Mon, 17 Jun 2013 22:09:19 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 80E8F4A1DE; Mon, 17 Jun 2013 14:09:12 +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 Cx4Hzck5sRzC; Mon, 17 Jun 2013 14:09:12 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id CAC684A1E3; Mon, 17 Jun 2013 14:08:08 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7A8904A1A5 for ; Mon, 17 Jun 2013 14:08:04 +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 LDGQhkILJO2N for ; Mon, 17 Jun 2013 14:07:59 +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-f53.google.com (mail-pb0-f53.google.com [209.85.160.53]) by theia.denx.de (Postfix) with ESMTPS id 1B4D84A199 for ; Mon, 17 Jun 2013 14:07:35 +0200 (CEST) Received: by mail-pb0-f53.google.com with SMTP id xb12so2713482pbc.12 for ; Mon, 17 Jun 2013 05:07:34 -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=aTLNpaunoC5bEZMmWuq3VMXix8AS+u/4bSabd/xIrNc=; b=NO+5CcWq7o8euSlQqDTHYyxF0s26O1PftepJ4o+dDsouC/KqGV7ii7z5rgQei0ZokU 7bRuicKdQfT4cMmDhBYQFxyab+nWmREoSlrUaW8iWVQKA8qSHGjJOZGSU06qc+NI4/gK 3swkYLgYAAxnARTNB4bqP22ZeRRpUl/dfwXGriBNzxCX96tzFvSsiPMbC7pXst3/WEYJ BXEBETMRsPZWZbn+Zhqag2c1UlCVXlmiJ8BN8Uf5R0JtrT34vL1oYsxJ75fCNemac3+6 l/tsrJ+hapRcW04WKuxLLsu5ATSy7kNIS3HAyJSHOETvJEQvf6r9w87j+dqTDSO2Xg3u jIvg== X-Received: by 10.68.96.193 with SMTP id du1mr12781637pbb.142.1371470854422; Mon, 17 Jun 2013 05:07:34 -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 wt5sm13621839pbc.38.2013.06.17.05.07.32 for (version=TLSv1 cipher=DES-CBC3-SHA bits=168/168); Mon, 17 Jun 2013 05:07:33 -0700 (PDT) From: Kuo-Jung Su To: u-boot@lists.denx.de Date: Mon, 17 Jun 2013 20:06:56 +0800 Message-Id: <1371470824-3228-7-git-send-email-dantesu@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371470824-3228-1-git-send-email-dantesu@gmail.com> References: <1371470824-3228-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 v5 06/14] 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 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 25f8752..0d7a5ac 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); } }