mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bean Huo <huobean@gmail.com>
To: Avri Altman <Avri.Altman@wdc.com>,
	"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
	"asutoshd@codeaurora.org" <asutoshd@codeaurora.org>,
	"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"stanley.chu@mediatek.com" <stanley.chu@mediatek.com>,
	"beanhuo@micron.com" <beanhuo@micron.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"tomas.winkler@intel.com" <tomas.winkler@intel.com>,
	"cang@codeaurora.org" <cang@codeaurora.org>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 4/4] scsi: ufs: add compatibility with 3.1 UFS unit descriptor length
Date: Sat, 30 May 2020 20:33:30 +0200	[thread overview]
Message-ID: <07b197a84394a20cf175e37d1a442d52535856ae.camel@gmail.com> (raw)
In-Reply-To: <SN6PR04MB46404D5B77121B367C17AEA2FC8C0@SN6PR04MB4640.namprd04.prod.outlook.com>

Avri,


On Sat, 2020-05-30 at 06:56 +0000, Avri Altman wrote:
>  
> > 
> > From: Bean Huo <beanhuo@micron.com>
> > 
> > For UFS 3.1, the normal unit descriptor is 10 bytes larger
> > than the RPMB unit, however, both descriptors share the same
> > desc_idn, to cover both unit descriptors with one length, we
> > choose the normal unit descriptor length by desc_index.
> 
> This is not what your code is doing.
> For RPMB - desc size will not be 0x2d but remain 256.

sorry, I'm afraid I didn't quite get your point here.
would you go over it again in detail please?


> 
> Your strategy is still correct IMO - if you assign the larger size,
> The device will not reply with error, but with the proper buffer.
> 
> You can also rely that reading the rpmb unit descriptor will not
> happen before
> Reading regular luns, because this is happening in the first
> slave_alloc.
>  

On my side, I saw the Well-know LU descriptor is read before
regulaer/normal LU descritptor. see ufshcd_add_lus();

I did further debug to verify my patch, and the unit descriptor read
sequence:

1. read RPMB descriptor: desc_id 2, desc_index 0xc4
2. read LU 0 descriptor: desc_id 2, desc_index 0
3. read LU 0 descriptor: desc_id 2, desc_index 1
4. read LU 0 descriptor: desc_id 2, desc_index 2
5. read LU 0 descriptor: desc_id 2, desc_index 4
....

> Hence, I think you can drop the extra if, and just add the comment.
> 

so, this 'if' is still needed. otherwise, LU descriptor length will be
initialized as 0x23(RPMB descriptor length).

if I am wrong, please correct me.
thanks,

Bean




  reply	other threads:[~2020-05-30 18:33 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-29 16:40 [PATCH v4 0/4] scsi: ufs: cleanup ufs initialization Bean Huo
2020-05-29 16:40 ` [PATCH v4 1/4] scsi: ufs: remove max_t in ufs_get_device_desc Bean Huo
2020-05-29 17:37   ` Stanley Chu
2020-05-29 16:40 ` [PATCH v4 2/4] scsi: ufs: delete ufshcd_read_desc() Bean Huo
2020-05-29 16:40 ` [PATCH v4 3/4] scsi: ufs: cleanup ufs initialization path Bean Huo
2020-05-30  6:37   ` Avri Altman
2020-05-30 18:38     ` Bean Huo
2020-05-31 15:11     ` Bean Huo
2020-05-29 16:40 ` [PATCH v4 4/4] scsi: ufs: add compatibility with 3.1 UFS unit descriptor length Bean Huo
2020-05-30  6:56   ` Avri Altman
2020-05-30 18:33     ` Bean Huo [this message]
2020-05-30 19:43       ` 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=07b197a84394a20cf175e37d1a442d52535856ae.camel@gmail.com \
    --to=huobean@gmail.com \
    --cc=Avri.Altman@wdc.com \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=cang@codeaurora.org \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stanley.chu@mediatek.com \
    --cc=tomas.winkler@intel.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

Powered by JetHome