All of lore.kernel.org
 help / color / mirror / Atom feed
From: cang@codeaurora.org
To: Mark Salyzyn <salyzyn@android.com>
Cc: asutoshd@codeaurora.org, nguyenb@codeaurora.org,
	rnayak@codeaurora.org, linux-scsi@vger.kernel.org,
	kernel-team@android.com, saravanak@google.com,
	salyzyn@google.com, "James E.J. Bottomley" <jejb@linux.ibm.com>,
	"Martin K. Petersen" <martin.petersen@oracle.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2 1/5] scsi: Adjust DBD setting in mode sense for caching mode page per LLD
Date: Fri, 01 Nov 2019 08:18:17 +0800	[thread overview]
Message-ID: <904e0c27ce60c91f3c6447bd9ac3dae9@codeaurora.org> (raw)
In-Reply-To: <6bda63c6-4bcf-b7ad-f552-4c72ba0b9024@android.com>

On 2019-10-31 23:40, Mark Salyzyn wrote:
> On 10/31/19 8:20 AM, Mark Salyzyn wrote:
>> On 10/28/19 8:10 PM, Can Guo wrote:
>>> 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        | 6 +++++-
>>>   include/scsi/scsi_host.h | 6 ++++++
>>>   2 files changed, 11 insertions(+), 1 deletion(-)
>>> 
>>> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
>>> index aab4ed8..6d8194f 100644
>>> --- a/drivers/scsi/sd.c
>>> +++ b/drivers/scsi/sd.c
>>> @@ -2629,6 +2629,7 @@ static int sd_try_rc16_first(struct scsi_device 
>>> *sdp)
>>>   {
>>>       int len = 0, res;
>>>       struct scsi_device *sdp = sdkp->device;
>>> +    struct Scsi_Host *host = sdp->host;
>> variable locality
>>>       int dbd;
>>>       int modepage;
>>> @@ -2660,7 +2661,10 @@ static int sd_try_rc16_first(struct 
>>> scsi_device *sdp)
>>>           dbd = 8;
>>>       } else {
>>>           modepage = 8;
>>> -        dbd = 0;
>>> +        if (host->set_dbd_for_caching)
>>> +            dbd = 8;
>>> +        else
>>> +            dbd = 0;
>>>       }
>> 
>> This simplifies to:
>> 
>> -   } else if (sdp->type == TYPE_RBC) {
>> 
>> +    } else if (sdp->type == TYPE_RBC || 
>> sdp->host->set_dbd_for_caching) {
> 
> IDK what happened with my mailer sending out an older infant copy
> (blame on fumble fingers). My final copy was instead the
> simplification:
> 
> +    dbd = sdp->host->set_dbd_for_caching ? 8 : 0;

Thank you for your review.

Regards,
Can Guo


  reply	other threads:[~2019-11-01  0:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-29  3:10 [PATCH v2 0/5] UFS driver general fixes bundle 1 Can Guo
2019-10-29  3:10 ` [PATCH v2 1/5] scsi: Adjust DBD setting in mode sense for caching mode page per LLD Can Guo
2019-10-31 15:20   ` Mark Salyzyn
2019-10-31 15:40     ` Mark Salyzyn
2019-11-01  0:18       ` cang [this message]
2019-10-29  3:10 ` [PATCH v2 2/5] scsi: ufs: Set DBD setting in mode sense for caching mode page Can Guo
2019-10-29  3:10 ` [PATCH v2 3/5] scsi: ufs: Release clock if DMA map fails Can Guo
2019-10-29  3:10 ` [PATCH v2 4/5] scsi: ufs: Do not clear the DL layer timers Can Guo
2019-10-29  3:10 ` [PATCH v2 5/5] scsi: ufs: Do not free irq in suspend 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=904e0c27ce60c91f3c6447bd9ac3dae9@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@android.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.