Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gLvsf-000868-KA for linux-mtd@lists.infradead.org; Sun, 11 Nov 2018 19:58:51 +0000 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Boris Brezillon" , linux-mtd@lists.infradead.org, "Tokunori Ikegami" , "Chris Packham" , "Brian Norris" , "Marek Vasut" , "Boris Brezillon" , "Cyrille Pitchen" , "David Woodhouse" , "Joakim Tjernlund" , "Richard Weinberger" Date: Sun, 11 Nov 2018 19:49:05 +0000 Message-ID: Subject: [PATCH 3.16 096/366] mtd: cfi_cmdset_0002: Change write buffer to check correct value In-Reply-To: List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 3.16.61-rc1 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 Signed-off-by: Boris Brezillon Signed-off-by: Ben Hutchings --- 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 @@ -1541,7 +1541,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; }