From patchwork Sun Oct 1 01:20:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ahmed Samir Khalil X-Patchwork-Id: 820230 X-Patchwork-Delegate: jagannadh.teki@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="OoGqvKuo"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3y4SGm1ChGz9t2x for ; Sun, 1 Oct 2017 12:23:12 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id CF5FEC21E5B; Sun, 1 Oct 2017 01:22:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id B8F83C21EA2; Sun, 1 Oct 2017 01:21:16 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 79CC9C21D82; Sun, 1 Oct 2017 01:21:01 +0000 (UTC) Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by lists.denx.de (Postfix) with ESMTPS id 6CE4FC21E57 for ; Sun, 1 Oct 2017 01:20:55 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id k4so2739733wmc.1 for ; Sat, 30 Sep 2017 18:20:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=fu1ytR8KJ8wz89B/geh9SJnJ5Vlr89qC0JQgOz8rEK0=; b=OoGqvKuofGIczd6biXNXSp2NvXUlmrAbdSuXUaxxcbRUMumNslrOF436bDq5LfkW4s H9CdE57OGAlZbH5UF2LH21dCocyyvsUsauh4TZDdx8egKG4vNxThlVeHRw2jsfF+xWIw hu0EBjT308wPs6SB7iMO/A3+/+tFQ/ivcaquQioCgwS3m9SdM/MfomSUoQhJaUL8HdPH h9VUdp2JGPUnHsecLR/92SqMBITT8Lo2a/M1SvJujtMvB8a7e17Y0hT9JbN9rRuZHL8p TeUzUjRskKhSFJ8nYuvbhlbd/8lRIRwlcFNRZDjxBZVQKGb5TheAfCydn0YhCzZNa3qI AB/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=fu1ytR8KJ8wz89B/geh9SJnJ5Vlr89qC0JQgOz8rEK0=; b=FPgaA8zIBOktaLH8+JqzmymlKscBobXJ6g9fnjXNApu0RCOuDJl2o7b4Tq1kTn+COr OeAAevLPVbnU7VFZfd4vYPc+cj5HL6dNCNucDqRW8SbrdxmQpldJ4lXh5eFF54WAkuSW M3z/pn8QVTJQRtDjT/lKdjC+bsKVYj3NHWfoMK58iICflMJplHIG+SzY6DFSz5jCVCZz lz1+lCvAs0N5yiAwWzxQcuOJYDn1MAg5+lhxUjILnIyKKo/0to4+D6Z2c5zn5zZf82ZL LysDImj/LyEyU6aJaKi8kMK0GJKJHo8JZoikbdrzuecX381VR982i/gPJzo/rA3X635n RiXA== X-Gm-Message-State: AHPjjUhuirSSG1KTq/0A/UCIZS5M9IJj+4LQ6JIaza/1vNOATPWjYB4Q fhFiMF0BBQaDf+0AB5M2l/Pusg== X-Google-Smtp-Source: AOwi7QCOvRyWL8bWBg/BydBDm3ZmyEcxVG3Pbs8t627RZoa1YcsFHpKSTZQU2MxfVdt0c7iGHTF+SA== X-Received: by 10.28.180.2 with SMTP id d2mr6455592wmf.118.1506820854851; Sat, 30 Sep 2017 18:20:54 -0700 (PDT) Received: from sam-VirtualBox.Speedport_W_723V_1_43_000 (p50837F14.dip0.t-ipconnect.de. [80.131.127.20]) by smtp.gmail.com with ESMTPSA id o14sm3079684wra.54.2017.09.30.18.20.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 30 Sep 2017 18:20:53 -0700 (PDT) From: Ahmed Samir Khalil To: u-boot@lists.denx.de Date: Sun, 1 Oct 2017 03:20:43 +0200 Message-Id: <273cb4acaf14aaf63773c9dcb94e330b6f8f3bee.1506820067.git.engkhalil86@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: In-Reply-To: References: Cc: Ahmed Samir Khalil Subject: [U-Boot] [PATCH 4/5] mtd: spi_flash: Clear SR error flags in case of failed write X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 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" If writing fail, error that is flagged into status register-1 should be cleared. Otherwise, next operation(s) may be done incorrectly/incomplete. Signed-off-by: Ahmed S. Khalil --- drivers/mtd/spi/spi_flash.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mtd/spi/spi_flash.c b/drivers/mtd/spi/spi_flash.c index 6f54e10..b6b56fe 100644 --- a/drivers/mtd/spi/spi_flash.c +++ b/drivers/mtd/spi/spi_flash.c @@ -415,6 +415,9 @@ int spi_flash_cmd_write_ops(struct spi_flash *flash, u32 offset, buf + actual, chunk_len); if (ret < 0) { debug("SF: write failed\n"); +#ifdef CONFIG_SPI_FLASH_SPANSION + clear_sr(flash); +#endif break; }