All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daejun Park <daejun7.park@samsung.com>
To: Bart Van Assche <bvanassche@acm.org>,
	Daejun Park <daejun7.park@samsung.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	"avri.altman@wdc.com" <avri.altman@wdc.com>,
	"jejb@linux.ibm.com" <jejb@linux.ibm.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"asutoshd@codeaurora.org" <asutoshd@codeaurora.org>,
	"stanley.chu@mediatek.com" <stanley.chu@mediatek.com>,
	"cang@codeaurora.org" <cang@codeaurora.org>,
	"huobean@gmail.com" <huobean@gmail.com>,
	ALIM AKHTAR <alim.akhtar@samsung.com>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	JinHwan Park <jh.i.park@samsung.com>,
	Javier Gonzalez <javier.gonz@samsung.com>,
	Sung-Jun Park <sungjun07.park@samsung.com>,
	Jinyoung CHOI <j-young.choi@samsung.com>,
	Dukhyun Kwon <d_hyun.kwon@samsung.com>,
	Keoseong Park <keosung.park@samsung.com>,
	Jaemyung Lee <jaemyung.lee@samsung.com>,
	Jieon Seol <jieon.seol@samsung.com>
Subject: RE: Re: [PATCH v35 3/4] scsi: ufs: Prepare HPB read for cached sub-region
Date: Fri, 04 Jun 2021 10:11:24 +0900	[thread overview]
Message-ID: <20210604011124epcms2p39a466db169ebbfd2c889e25fba9aa0b4@epcms2p3> (raw)
In-Reply-To: <12392bef-e018-8260-5279-16b7b43f5a8f@acm.org>

Hi Bart,

>> +static void
>> +ufshpb_set_hpb_read_to_upiu(struct ufshpb_lu *hpb, struct ufshcd_lrb *lrbp,
>> +                            u32 lpn, u64 ppn, u8 transfer_len)
>> +{
>> +        unsigned char *cdb = lrbp->cmd->cmnd;
>> +
>> +        cdb[0] = UFSHPB_READ;
>> +
>> +        /* ppn value is stored as big-endian in the host memory */
> 
>I think that that comment means that the type of the 'ppn' argument
>should be changed from 'u64' into __be64.

OK, I will change it.

> 
>> +        memcpy(&cdb[6], &ppn, sizeof(__be64));
>> +        cdb[14] = transfer_len;
>> +
>> +        lrbp->cmd->cmd_len = UFS_CDB_SIZE;
>> +}
>> +
>> +/*
>> + * This function will set up HPB read command using host-side L2P map data.
>> + * In HPB v1.0, maximum size of HPB read command is 4KB.
>> + */
>> +void ufshpb_prep(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
>> +{
>[ ... ]
>> +
>> +        ufshpb_set_hpb_read_to_upiu(hpb, lrbp, lpn, ppn, transfer_len);
> 
>'transfer_len' has type int and is truncated to type 'u8' when passed as
>an argument to ufshpb_set_hpb_read_to_upiu(). Please handle transfer_len
>values >= 256 properly.

Before entering the function, ufshpb_is_supported_chunk() checks whether
transfer_len <= hpb->pre_req_max_tr_len which is set to
HPB_MULTI_CHUNK_HIGH (128) on initalization.

Thanks,
Daejun

  parent reply	other threads:[~2021-06-04  1:11 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210524084345epcms2p63dde85f3fdc127c29d25ada7d7f539cb@epcms2p6>
2021-05-24  8:43 ` [PATCH v35 0/4] scsi: ufs: Add Host Performance Booster Support Daejun Park
     [not found]   ` <CGME20210524084345epcms2p63dde85f3fdc127c29d25ada7d7f539cb@epcms2p5>
2021-05-24  8:44     ` [PATCH v35 1/4] scsi: ufs: Introduce HPB feature Daejun Park
     [not found]   ` <CGME20210524084345epcms2p63dde85f3fdc127c29d25ada7d7f539cb@epcms2p2>
2021-05-24  8:45     ` [PATCH v35 3/4] scsi: ufs: Prepare HPB read for cached sub-region Daejun Park
2021-06-03 20:12       ` Bart Van Assche
     [not found]       ` <CGME20210524084345epcms2p63dde85f3fdc127c29d25ada7d7f539cb@epcms2p3>
2021-06-04  1:11         ` Daejun Park [this message]
2021-06-04  2:54           ` Bart Van Assche
2021-06-03 17:38   ` [PATCH v35 0/4] scsi: ufs: Add Host Performance Booster Support Greg KH
2021-06-03 17:47     ` Bart Van Assche
     [not found]   ` <CGME20210524084345epcms2p63dde85f3fdc127c29d25ada7d7f539cb@epcms2p7>
2021-05-24  8:45     ` [PATCH v35 2/4] scsi: ufs: L2P map management for HPB read Daejun Park
2021-06-04  4:06     ` Re: [PATCH v35 3/4] scsi: ufs: Prepare HPB read for cached sub-region Daejun Park
2021-05-24  8:46 ` [PATCH v35 4/4] scsi: ufs: Add HPB 2.0 support Daejun Park

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=20210604011124epcms2p39a466db169ebbfd2c889e25fba9aa0b4@epcms2p3 \
    --to=daejun7.park@samsung.com \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=avri.altman@wdc.com \
    --cc=bvanassche@acm.org \
    --cc=cang@codeaurora.org \
    --cc=d_hyun.kwon@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=huobean@gmail.com \
    --cc=j-young.choi@samsung.com \
    --cc=jaemyung.lee@samsung.com \
    --cc=javier.gonz@samsung.com \
    --cc=jejb@linux.ibm.com \
    --cc=jh.i.park@samsung.com \
    --cc=jieon.seol@samsung.com \
    --cc=keosung.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stanley.chu@mediatek.com \
    --cc=sungjun07.park@samsung.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.