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

Commit 7f36a2a1 authored by Can Guo's avatar Can Guo Committed by Todd Kjos
Browse files

FROMGIT: scsi: core: Adjust DBD setting in MODE SENSE for caching mode page per LLD

UFS JEDEC standards require DBD field to be set to 1 in mode sense
command.  This patch allows LLD to define the setting of DBD, if
required.

Bug: 143632303
(cherry picked from commit f711610be3421363c5358b1a3c34c038c943e8f2
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git 5.6/scsi-queue)
Link: https://lore.kernel.org/r/0101016ed3d643f9-ffd45d6c-c593-4a13-a18f-a32da3d3bb97-000000@us-west-2.amazonses.com


Change-Id: I9b81ce59b59cbd2286bd41a2a99d6d189ecfd53d
Reviewed-by: default avatarAvri Altman <avri.altman@wdc.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 8cb3648c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -2109,6 +2109,8 @@ scsi_mode_sense(struct scsi_device *sdev, int dbd, int modepage,

	memset(data, 0, sizeof(*data));
	memset(&cmd[0], 0, 12);

	dbd = sdev->set_dbd_for_ms ? 8 : dbd;
	cmd[1] = dbd & 0x18;	/* allows DBD and LLBA bits */
	cmd[2] = modepage;

+1 −0
Original line number Diff line number Diff line
@@ -170,6 +170,7 @@ struct scsi_device {
				     * because we did a bus reset. */
	unsigned use_10_for_rw:1; /* first try 10-byte read / write */
	unsigned use_10_for_ms:1; /* first try 10-byte mode sense/select */
	unsigned set_dbd_for_ms:1; /* Set "DBD" field in mode sense */
	unsigned no_report_opcodes:1;	/* no REPORT SUPPORTED OPERATION CODES */
	unsigned no_write_same:1;	/* no WRITE SAME command */
	unsigned use_16_for_rw:1; /* Use read/write(16) over read/write(10) */