FROMLIST: ata/scsi: Prevent FS corruption on chromebook pixel2 at reboot

On Samus, even when rebooting, the root device is power cycled.
Normally, during reboot, root device is not power cycled, so the device
does not have to flush its volatle drive cache to permanent media.

However, in case of Samus, given the SSD is power cycled, we force the SSD
to flush its cache by issuing a SCSI START_STOP command, translated into
an ATA STANDBY command.

BUG=chromium:627304,chromium:1045821
TEST=Check on Samus with 4.14 that reboot does not change the
Power-Off_Retract_Count smart variable anymore.

(am from https://patchwork.kernel.org/patch/11366997)
(commit b6adbabe91e3 ("CHROMIUM: ata: Prevent FS corruption on samus at
reboot"))

Change-Id: I45a728552c25370282aaa08a4985275376c7d8b0
Signed-off-by: Gwendal Grignou <gwendal@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2048992
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
(cherry picked from commit f098fa4837b352751e8137fe537b73d9fe5c6dd9)
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/2090280
3 files changed