linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Can Guo <cang@codeaurora.org>
To: asutoshd@codeaurora.org, nguyenb@codeaurora.org,
	rnayak@codeaurora.org, linux-scsi@vger.kernel.org,
	kernel-team@android.com, saravanak@google.com,
	salyzyn@google.com, cang@codeaurora.org
Cc: "James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	linux-kernel@vger.kernel.org (open list)
Subject: [PATCH v4 1/5] scsi: Adjust DBD setting in mode sense for caching mode page per LLD
Date: Tue, 12 Nov 2019 22:00:19 -0800	[thread overview]
Message-ID: <1573624824-671-2-git-send-email-cang@codeaurora.org> (raw)
In-Reply-To: <1573624824-671-1-git-send-email-cang@codeaurora.org>

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.

Signed-off-by: Can Guo <cang@codeaurora.org>
---
 drivers/scsi/scsi_lib.c    | 2 ++
 include/scsi/scsi_device.h | 1 +
 2 files changed, 3 insertions(+)

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 5447738..3812e90 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -2108,6 +2108,8 @@ void scsi_exit_queue(void)
 
 	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;
 
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 3ed836d..f8312a3 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -172,6 +172,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) */
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


       reply	other threads:[~2019-11-13  6:00 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1573624824-671-1-git-send-email-cang@codeaurora.org>
2019-11-13  6:00 ` Can Guo [this message]
2019-11-19  5:50   ` [PATCH v4 1/5] scsi: Adjust DBD setting in mode sense for caching mode page per LLD Martin K. Petersen
2019-11-13  6:00 ` [PATCH v4 2/5] scsi: ufs: Use DBD setting in mode sense Can Guo
2019-12-04  1:31   ` [EXT] " Bean Huo (beanhuo)
2019-11-13  6:00 ` [PATCH v4 3/5] scsi: ufs: Release clock if DMA map fails Can Guo
2019-11-13 16:26   ` [EXT] " Bean Huo (beanhuo)
2019-11-13  6:00 ` [PATCH v4 4/5] scsi: ufs: Do not clear the DL layer timers Can Guo
2019-11-20 15:03   ` Avri Altman
2019-11-25  7:22     ` Avri Altman
2019-11-25  7:39       ` cang
     [not found]   ` <0101016ec584a776-2140a805-4b1d-4a3d-af0a-f073425be2d6-000000@us-west-2.amazonses.com>
2019-12-02  7:42     ` Avri Altman
2019-12-04  1:45       ` [EXT] " Bean Huo (beanhuo)
2019-11-13  6:00 ` [PATCH v4 5/5] scsi: ufs: Do not free irq in suspend Can Guo
2019-11-20 15:36   ` Avri Altman
2019-11-25  7:43     ` cang
     [not found]     ` <0101016ea18429ac-d170e670-bde4-4769-a6c1-6767fae70534-000000@us-west-2.amazonses.com>
2019-11-25  7:45       ` Avri Altman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1573624824-671-2-git-send-email-cang@codeaurora.org \
    --to=cang@codeaurora.org \
    --cc=asutoshd@codeaurora.org \
    --cc=jejb@linux.ibm.com \
    --cc=kernel-team@android.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=nguyenb@codeaurora.org \
    --cc=rnayak@codeaurora.org \
    --cc=salyzyn@google.com \
    --cc=saravanak@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).