mtd: cfi_cmdset_0001.c: fix resume for LH28F640BF chips

After '#echo mem > /sys/power/state' some devices can not be properly resumed
because apparently the MTD Partition Configuration Register has been reset
to default thus the rootfs cannot be mounted cleanly on resume.
An example of this can be found in the SA-1100 Developer's Manual at 9.5.3.3
where the second step of the Sleep Shutdown Sequence is described:
"An internal reset is applied to the SA-1100. All units are reset...".

As workaround we refresh the PCR value as done initially on chip setup.

This behavior and the fix are confirmed by our tests done on 2 different Zaurus
collie units with kernel 3.17.

Fixes: 812c5fa82bae: ("mtd: cfi_cmdset_0001.c: add support for Sharp LH28F640BF NOR")
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Andrea Adami <andrea.adami@gmail.com>
Cc: <stable@vger.kernel.org> # 3.16+
Signed-off-by: Brian Norris <computersforpeace@gmail.com>

authored by Dmitry Eremin-Solenikov and committed by Brian Norris 89cf38dd 0c53b4e7

Changed files
+2
drivers
mtd
+2
drivers/mtd/chips/cfi_cmdset_0001.c
··· 2590 2590 2591 2591 /* Go to known state. Chip may have been power cycled */ 2592 2592 if (chip->state == FL_PM_SUSPENDED) { 2593 + /* Refresh LH28F640BF Partition Config. Register */ 2594 + fixup_LH28F640BF(mtd); 2593 2595 map_write(map, CMD(0xFF), cfi->chips[i].start); 2594 2596 chip->oldstate = chip->state = FL_READY; 2595 2597 wake_up(&chip->wq);