From patchwork Fri Oct 23 18:14:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vadzim Dambrouski X-Patchwork-Id: 535158 X-Patchwork-Delegate: albert.aribaud@free.fr 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 77C811400A0 for ; Sat, 24 Oct 2015 05:14:31 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=YUOSEm9N; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C9E904B892; Fri, 23 Oct 2015 20:14:28 +0200 (CEST) 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 SXvXP0t81_h9; Fri, 23 Oct 2015 20:14:28 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 130BC4B889; Fri, 23 Oct 2015 20:14:28 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 4CEA04B889 for ; Fri, 23 Oct 2015 20:14:25 +0200 (CEST) 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 2vOhMEO42XM1 for ; Fri, 23 Oct 2015 20:14:25 +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-lf0-f65.google.com (mail-lf0-f65.google.com [209.85.215.65]) by theia.denx.de (Postfix) with ESMTPS id 0668E4B887 for ; Fri, 23 Oct 2015 20:14:22 +0200 (CEST) Received: by lffz202 with SMTP id z202so8583091lff.3 for ; Fri, 23 Oct 2015 11:14:22 -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; bh=JTVi3P9s8qIzSIVFfD6LpDRg9AWIeslQ2LkkzBaVazY=; b=YUOSEm9NuBDjycBu2Mfk4TMwW5ISUEab7BhCQXMMbVw9bcYszmQ4KwcNsA6Zgab/uO HY4JFjNfyXSWr10B74NB1QR+yYc38I/OExdBmcB56fQbq4QMRvn3ierOju7j37U06ouF i0cJHzWRUeEzs3Gv/JZNvUShcp46G4DB+OKSjZzpSzbROhHP3tWqzWhlJ++fe1bJDdtT B8KfXFFaqftU5j02i4sytb3/Xfj6aXSdyy/I7gYHGl4DYAMBchcOjlfG7exm+DloOrny vkJFk9mc9feKHtT28woHLFYmwPsuOHk1juKGMvyB1xyoMk4RX+uBk1kI3PvBQ0Js3EUZ ywuQ== X-Received: by 10.112.147.10 with SMTP id tg10mr12066337lbb.58.1445624061883; Fri, 23 Oct 2015 11:14:21 -0700 (PDT) Received: from inspiron.lan ([93.125.42.172]) by smtp.gmail.com with ESMTPSA id o197sm3281353lfb.7.2015.10.23.11.14.20 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 23 Oct 2015 11:14:20 -0700 (PDT) From: Vadzim Dambrouski To: u-boot@lists.denx.de Date: Fri, 23 Oct 2015 21:14:06 +0300 Message-Id: <1445624047-6592-1-git-send-email-pftbest@gmail.com> X-Mailer: git-send-email 2.6.2 Cc: "rev13@wp.pl" , Tom Rini Subject: [U-Boot] [PATCH v2 1/2] arm: stm32f4: fix a bug when only first sector gets erased X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" flash_lock call is inside a for loop, so after the first iteration flash is locked and no more sectors can be erased. Move flash_lock out of the loop. Signed-off-by: Vadzim Dambrouski --- arch/arm/cpu/armv7m/stm32f4/flash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/cpu/armv7m/stm32f4/flash.c b/arch/arm/cpu/armv7m/stm32f4/flash.c index e5c6111..ae63790 100644 --- a/arch/arm/cpu/armv7m/stm32f4/flash.c +++ b/arch/arm/cpu/armv7m/stm32f4/flash.c @@ -114,9 +114,9 @@ int flash_erase(flash_info_t *info, int first, int last) ; clrbits_le32(&STM32_FLASH->cr, STM32_FLASH_CR_SER); - stm32f4_flash_lock(1); } + stm32f4_flash_lock(1); return 0; }