public inbox for linux-kernel@vger.kernel.org
 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 v3 1/5] scsi: Adjust DBD setting in mode sense for caching mode page per LLD
Date: Fri,  1 Nov 2019 22:01:34 -0700	[thread overview]
Message-ID: <1572670898-750-2-git-send-email-cang@codeaurora.org> (raw)
In-Reply-To: <1572670898-750-1-git-send-email-cang@codeaurora.org>

Host sends MODE_SENSE_10 with caching mode page, to check if the device
supports the cache feature.
UFS JEDEC standards require DBD field to be set to 1.

This patch allows LLD to define the setting of DBD if required.

Signed-off-by: Can Guo <cang@codeaurora.org>
---
 drivers/scsi/sd.c        | 2 +-
 include/scsi/scsi_host.h | 6 ++++++
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index aab4ed8..a9cca2f 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -2660,7 +2660,7 @@ static int sd_try_rc16_first(struct scsi_device *sdp)
 		dbd = 8;
 	} else {
 		modepage = 8;
-		dbd = 0;
+		dbd = sdp->host->set_dbd_for_caching ? 8 : 0;
 	}
 
 	/* cautiously ask */
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h
index 2c3f0c5..3900987 100644
--- a/include/scsi/scsi_host.h
+++ b/include/scsi/scsi_host.h
@@ -650,6 +650,12 @@ struct Scsi_Host {
 	unsigned no_scsi2_lun_in_cdb:1;
 
 	/*
+	 * Set "DBD" field in mode_sense caching mode page in case it is
+	 * mandatory by LLD standard.
+	 */
+	unsigned set_dbd_for_caching:1;
+
+	/*
 	 * Optional work queue to be utilized by the transport
 	 */
 	char work_q_name[20];
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project


       reply	other threads:[~2019-11-02  5:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1572670898-750-1-git-send-email-cang@codeaurora.org>
2019-11-02  5:01 ` Can Guo [this message]
2019-11-03 21:16   ` [EXT] [PATCH v3 1/5] scsi: Adjust DBD setting in mode sense for caching mode page per LLD Bean Huo (beanhuo)
2019-11-13  3:03   ` Martin K. Petersen
2019-11-13  3:22     ` cang
2019-11-02  5:01 ` [PATCH v3 2/5] scsi: ufs: Set DBD setting in mode sense for caching mode page Can Guo
2019-11-03 21:17   ` [EXT] " Bean Huo (beanhuo)
2019-11-02  5:01 ` [PATCH v3 3/5] scsi: ufs: Release clock if DMA map fails Can Guo
2019-11-02  5:01 ` [PATCH v3 4/5] scsi: ufs: Do not clear the DL layer timers Can Guo
2019-11-02  5:01 ` [PATCH v3 5/5] scsi: ufs: Do not free irq in suspend Can Guo
     [not found] <1572657631-25749-1-git-send-email-cang@qti.qualcomm.com>
2019-11-02  1:20 ` [PATCH v3 1/5] scsi: Adjust DBD setting in mode sense for caching mode page per LLD Can Guo

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=1572670898-750-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