Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 971fe3b4 authored by Can Guo's avatar Can Guo Committed by Todd Kjos
Browse files

FROMGIT: scsi: ufs: Use DBD setting in mode sense

UFS standard requires DBD field to be set to 1 in MODE SENSE(10).

Some card vendors are more strict and check the DBD field, hence respond
with CHECK_CONDITION (Sense key set to ILLEGAL_REQUEST and ASC set to
INVALID FIELD IN CDB).  When host sends MODE SENSE for page caching, as a
result of the CHECK_CONDITION response, host assumes that the device
doesn't support the cache feature and doesn't send SYNCHRONIZE_CACHE
commands to flush the device cache. This can result in data corruption in
case of sudden power down when there is data stored in the device cache.

This patch fixes the DBD field setting as required in UFS standard.

Bug: 143632303
(cherry picked from commit d3e59f87ee9343b8ebf80a7da960b2c501aacea0
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 5.6/scsi-queue)
Change-Id: Ib9bf6b5eb025a889d8621c8b65ac1acf347c8cd7
Link: https://lore.kernel.org/r/0101016ed3d657e4-32a6dd52-1505-4312-97ff-2bd3bee59eb7-000000@us-west-2.amazonses.com


Reviewed-by: default avatarBean Huo <beanhuo@micron.com>
Signed-off-by: default avatarCan Guo <cang@codeaurora.org>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: default avatarAsutosh Das <asutoshd@codeaurora.org>
parent 7f36a2a1
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment