[PATCH 4.9 040/101] mtd: cfi_cmdset_0002: Change write buffer to check correct value

2018-07-01 Thread Greg Kroah-Hartman
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-...@lists.infradead.org
Cc: sta...@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;
}




[PATCH 4.9 040/101] mtd: cfi_cmdset_0002: Change write buffer to check correct value

2018-07-01 Thread Greg Kroah-Hartman
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-...@lists.infradead.org
Cc: sta...@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;
}