Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp3007538imm; Sun, 1 Jul 2018 10:10:51 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIvNYzWCYO7R4jCvgt3cMekSvWkP89BriTqAjYJ451rrRpZqqMewrAUrkxYAYc4FE47obgs X-Received: by 2002:a63:9246:: with SMTP id s6-v6mr19366351pgn.35.1530465051838; Sun, 01 Jul 2018 10:10:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530465051; cv=none; d=google.com; s=arc-20160816; b=AVoWqj6IqYFbqoXDEfi7M/yq2X/aXdcTytkBDXAbLjv4OZ5j1p/KbeGv/36ZBa042t vH0g4L3KexnyqlvUgoDrhVHNZM0nkP9tGSATfWpxAaJ/XhbQtzr7nirKAFh/qkVIafr6 sw7x9aiGxXQk2nb890oXo4I/3etNPr25ew/7/7NhBTpzhS608XTKquq8+G5CST7wZKet OnWQ9USRrehw0JE6HLOAnX8/nHRlqfsKLxLBgoZSI/XZuAXrsE8SMNWP90aC1bskSwz0 WvLoRVP2PMJfRdxG3VstoxE7rTlwMpkac22XQOwsDgTolfg8YFGv7HD1YjY3maDWHrn6 CYsg== 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=MWiuuflVcoNKYN+aChzIAVtQQuK65axPMg+cJDGMRfY=; b=nRfKJoXpwzYtIfT2Ko/E4IHtH9GrclseTl4pfaFhX5Pj8vCUCaih2EgFqhB2tJEJRT 6QvzVZpwIo1zO3NuGAY8louMvUE9jKlgBbANeY17nbIqPPT3tfsfxYQEcUd+4K8RGQm3 r62oIkr30D/Nh5PLPVoqC4A79aq4q/MgCLVKTNcmSiLU1kXkuDtUCMwHgzEn2Po80MSz oI9WJPPs6D6Dv2bjwh9fQ4Qd/iz0olFXMb6D9ilxcSlMCGqUSgpiVq8IMLx3MhWVcIdX S/Ay7jlwKK0OoocXpi+xjderIPnzahT4VMqA0JjNRCSrldSiFJMfL5ol5ekd+EcpiHfV nlFQ== 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 l10-v6si14212206pfb.69.2018.07.01.10.10.37; Sun, 01 Jul 2018 10:10:51 -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 S933920AbeGARKD (ORCPT + 99 others); Sun, 1 Jul 2018 13:10:03 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:37308 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1032003AbeGAQlJ (ORCPT ); Sun, 1 Jul 2018 12:41:09 -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 71F1AAA6; Sun, 1 Jul 2018 16:41:08 +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.17 100/220] mtd: cfi_cmdset_0002: Change write buffer to check correct value Date: Sun, 1 Jul 2018 18:22:04 +0200 Message-Id: <20180701160912.586493348@linuxfoundation.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180701160908.272447118@linuxfoundation.org> References: <20180701160908.272447118@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.17-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 @@ -1880,7 +1880,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; }