Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3057272imm; Sun, 1 Jul 2018 11:14:20 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdW7mzhxkxCPZItrP8Y7O8NM9rTPFEPkzf7bx4HPFYG4vj40s8ZjhvCspo6EK1BtsfkEL00 X-Received: by 2002:a63:1a49:: with SMTP id a9-v6mr1794233pgm.423.1530468860215; Sun, 01 Jul 2018 11:14:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530468860; cv=none; d=google.com; s=arc-20160816; b=Kv96NoGqTOlfIt0QkW4HVZShmronaNY4fElSaW8tQCQwqSKuklg6UzFul9R1QsnQuN mAcDYUR1BHsH7Pl0IAmwQrP5Y4T6yu+sdx2jDczDvYduIL6h/vNz3Rm7RraveT4M9bpz 9XiA4QouA+L06pJUNi892X0w6t9YiEQnnDWGZ15O+44bT0hgFJ+0M4/elfkVfej61Xkd BLV6OcMTdZt5etUqzbt+OnMSOUZVQ906gtpMYWjc/dkmVaGBhVBjzv1uTP60SafmD2aP e8LYEGqXzTvO8s6MveEplPe2lClvw798rZUoVRnW05gJZih6Y9wY6ZXuLTiIf0Y8EM3b 0xGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=E/2zUCTd5t83GMWHXvvRtTXvUNX99WLw8AfO0i44SWA=; b=gxCCap0oyFeI+73ddYALXGQJ6v+WCKw4jpupFfXb9lbHo0R+vuYTBR1xQ3MiopilGH GcrwCnHjTyuk+SsncLvhJ3QlKGYTFKXJ0+WF/MO0UeeVsXA1lcYQf7VgszhmFw2ermvH YnF2GmqOZ/5Z6K80eJEWdIDDifCSC3ClMp02W+MjqRTLIsnI/nWHsQlc+JaG3yowTrvs ar697v0IVvrine2xsPd66s98MRyPoNwNZPIS9lFpbUOmpbb2lequukj5W6mwjZ/ZvgKD V+K8p1m/RA5Y58Jtjmb+d1+BP7tk8NigBZO+RircWoE6iBOLau7L0y4Mk/1OixX6TgTD pFhg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a20-v6si393051pgb.600.2018.07.01.11.14.05; Sun, 01 Jul 2018 11:14:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965491AbeGAQ1W (ORCPT + 99 others); Sun, 1 Jul 2018 12:27:22 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34060 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965476AbeGAQ1Q (ORCPT ); Sun, 1 Jul 2018 12:27:16 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id ACD2092B; Sun, 1 Jul 2018 16:27:15 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tokunori Ikegami , Joakim Tjernlund , Chris Packham , Brian Norris , David Woodhouse , Boris Brezillon , Marek Vasut , Richard Weinberger , Cyrille Pitchen , linux-mtd@lists.infradead.org, Boris Brezillon Subject: [PATCH 4.9 040/101] mtd: cfi_cmdset_0002: Change write buffer to check correct value Date: Sun, 1 Jul 2018 18:21:26 +0200 Message-Id: <20180701160758.767802165@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160757.138608453@linuxfoundation.org> References: <20180701160757.138608453@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Tokunori Ikegami commit dfeae1073583dc35c33b32150e18b7048bbb37e6 upstream. For the word write it is checked if the chip has the correct value. But it is not checked for the write buffer as only checked if ready. To make sure for the write buffer change to check the value. It is enough as this patch is only checking the last written word. Since it is described by data sheets to check the operation status. Signed-off-by: Tokunori Ikegami Reviewed-by: Joakim Tjernlund Cc: Chris Packham Cc: Brian Norris Cc: David Woodhouse Cc: Boris Brezillon Cc: Marek Vasut Cc: Richard Weinberger Cc: Cyrille Pitchen Cc: linux-mtd@lists.infradead.org Cc: stable@vger.kernel.org Signed-off-by: Boris Brezillon Signed-off-by: Greg Kroah-Hartman --- drivers/mtd/chips/cfi_cmdset_0002.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/mtd/chips/cfi_cmdset_0002.c +++ b/drivers/mtd/chips/cfi_cmdset_0002.c @@ -1876,7 +1876,7 @@ static int __xipram do_write_buffer(stru if (time_after(jiffies, timeo) && !chip_ready(map, adr)) break; - if (chip_ready(map, adr)) { + if (chip_good(map, adr, datum)) { xip_enable(map, chip, adr); goto op_done; }