mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Daejun Park <daejun7.park@samsung.com>
To: Avri Altman <Avri.Altman@wdc.com>,
	Daejun Park <daejun7.park@samsung.com>,
	Greg KH <gregkh@linuxfoundation.org>,
	"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>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"huobean@gmail.com" <huobean@gmail.com>,
	ALIM AKHTAR <alim.akhtar@samsung.com>,
	Javier Gonzalez <javier.gonz@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>,
	SEUNGUK SHIN <seunguk.shin@samsung.com>,
	Sung-Jun Park <sungjun07.park@samsung.com>,
	yongmyung lee <ymhungry.lee@samsung.com>,
	Jinyoung CHOI <j-young.choi@samsung.com>,
	BoRam Shin <boram.shin@samsung.com>
Subject: RE: RE: [PATCH v22 4/4] scsi: ufs: Add HPB 2.0 support
Date: Tue, 23 Feb 2021 17:04:10 +0900	[thread overview]
Message-ID: <20210223080410epcms2p4704a20bb74cbbc1c1d0af92386eda2c7@epcms2p4> (raw)
In-Reply-To: <DM6PR04MB657588F1C76DC0D5BFC68862FC819@DM6PR04MB6575.namprd04.prod.outlook.com>

> > @@ -7447,8 +7452,14 @@ static int ufs_get_device_desc(struct ufs_hba *hba)
> > 
> >         if (dev_info->wspecversion >= UFS_DEV_HPB_SUPPORT_VERSION &&
> >             (b_ufs_feature_sup & UFS_DEV_HPB_SUPPORT)) {
> > -               dev_info->hpb_enabled = true;
> > -               ufshpb_get_dev_info(hba, desc_buf);
> > +               bool hpb_en = false;
> > +
> > +               err = ufshcd_query_flag_retry(hba,
> > UPIU_QUERY_OPCODE_READ_FLAG,
> > +                                             QUERY_FLAG_IDN_HPB_EN, 0, &hpb_en);
> > +               if (!err && hpb_en) {
> > +                       dev_info->hpb_enabled = true;
> > +                       ufshpb_get_dev_info(hba, desc_buf);
> QUERY_FLAG_IDN_HPB_EN only apply to HPB2.0

OK,

> > +               }
> >         }
> > 
> > +
> > +/*
> > + * WRITE_BUFFER CMD support 36K (len=9) ~ 512K (len=128) default.
> > + * it is possible to change range of transfer_len through sysfs.
> > + */
> Actually the transfer length is limited by its (and read id) single byte.
> Fixing MAX_HPB_READ_ID = 128  is IMO a reasonable choice,
> But not limited by spec.  Maybe make note of that ?
>  
> > +static inline bool ufshpb_is_required_wb(struct ufshpb_lu *hpb, int len)
> > +{
> > +       return (len >= hpb->pre_req_min_tr_len &&
> > +               len <= hpb->pre_req_max_tr_len);
> >  }
> Maybe also check HPB2.0 as well?

OK,

> > -void ufshpb_prep(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
> > +int ufshpb_prep(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
> >  {
> >         struct ufshpb_lu *hpb;
> >         struct ufshpb_region *rgn;
> > @@ -282,26 +546,27 @@ void ufshpb_prep(struct ufs_hba *hba, struct
> > ufshcd_lrb *lrbp)
> >         u64 ppn;
> >         unsigned long flags;
> >         int transfer_len, rgn_idx, srgn_idx, srgn_offset;
> > +       int read_id = MAX_HPB_READ_ID;
> Should be 0 if wb is not used?

I will fix it.

> > +
> > +       hpb->pre_req = kcalloc(qd, sizeof(struct ufshpb_req), GFP_KERNEL);
> > +       hpb->throttle_pre_req = qd;
> What is the point in throttling if you are allowing 32 simultaneous commands?
> There can't be more than qd/2 anyway?
> On the contrary, it makes much more sense to control the inflight map requests, instead?

OK, I will change it to qd/2.
 
> > +       hpb->num_inflight_pre_req = 0;
> > +
>  
> > -#define HPB_SUPPORT_VERSION                    0x100
> > +#define HPB_SUPPORT_VERSION                    0x200
> In ufshpb_get_dev_info you are bailing out if version != HPB_SUPPORT_VERSION
> Meaning you are no longer backward supporting HPB1.0?

I add to support legacy version of HPB.

Thanks,
Daejun

  parent reply	other threads:[~2021-02-23  8:05 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20210222092907epcms2p307f3c4116349ebde6eed05c767287449@epcms2p3>
2021-02-22  9:29 ` [PATCH v22 0/4] scsi: ufs: Add Host Performance Booster Support Daejun Park
     [not found]   ` <CGME20210222092907epcms2p307f3c4116349ebde6eed05c767287449@epcms2p7>
2021-02-22  9:29     ` [PATCH v22 1/4] scsi: ufs: Introduce HPB feature Daejun Park
2021-02-25  2:42     ` RE: RE: [PATCH v22 4/4] scsi: ufs: Add HPB 2.0 support Daejun Park
2021-02-25  7:51       ` Avri Altman
     [not found]   ` <CGME20210222092907epcms2p307f3c4116349ebde6eed05c767287449@epcms2p6>
2021-02-22  9:30     ` [PATCH v22 2/4] scsi: ufs: L2P map management for HPB read Daejun Park
2021-02-23  7:50       ` Avri Altman
2021-02-23  7:54       ` Avri Altman
     [not found]       ` <CGME20210222092907epcms2p307f3c4116349ebde6eed05c767287449@epcms2p4>
2021-02-23  8:01         ` Daejun Park
2021-02-23  8:04         ` Daejun Park [this message]
2021-02-23  8:02     ` Re: [PATCH v22 4/4] scsi: ufs: Add HPB 2.0 support Daejun Park
2021-02-23 23:54     ` Daejun Park
2021-02-24  8:20       ` Avri Altman
2021-02-24  9:06         ` Avri Altman
     [not found]   ` <CGME20210222092907epcms2p307f3c4116349ebde6eed05c767287449@epcms2p1>
2021-02-22  9:31     ` Daejun Park
2021-02-22 11:57       ` Bean Huo
2021-02-22 19:29       ` Avri Altman
2021-02-23  9:25       ` Bean Huo
2021-02-23 12:46       ` Avri Altman
2021-02-24  8:11       ` Avri Altman
2021-02-23 23:38     ` RE: [PATCH v22 3/4] scsi: ufs: Prepare HPB read for cached sub-region Daejun Park
     [not found]   ` <CGME20210222092907epcms2p307f3c4116349ebde6eed05c767287449@epcms2p8>
2021-02-22  9:31     ` Daejun Park
2021-02-23  8:27       ` Avri Altman
     [not found]       ` <CGME20210222092907epcms2p307f3c4116349ebde6eed05c767287449@epcms2p5>
2021-02-23  8:43         ` Daejun Park
2021-02-23  9:07           ` Avri Altman
2021-02-23  9:24             ` Avri Altman
2021-02-23  9:49         ` Re: [PATCH v22 4/4] scsi: ufs: Add HPB 2.0 support Daejun Park
2021-02-25  2:50         ` Daejun Park
2021-02-23 13:49       ` [PATCH v22 3/4] scsi: ufs: Prepare HPB read for cached sub-region Avri Altman
2021-02-23  8:00     ` RE: [PATCH v22 2/4] scsi: ufs: L2P map management for HPB read Daejun Park
2021-02-23  8:31     ` Daejun Park
2021-02-23  8:46       ` Avri Altman
2021-02-23  9:51     ` RE: RE: [PATCH v22 3/4] scsi: ufs: Prepare HPB read for cached sub-region Daejun Park
2021-02-23  8:55 ` RE: RE: RE: [PATCH v22 2/4] scsi: ufs: L2P map management for HPB read 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=20210223080410epcms2p4704a20bb74cbbc1c1d0af92386eda2c7@epcms2p4 \
    --to=daejun7.park@samsung.com \
    --cc=Avri.Altman@wdc.com \
    --cc=alim.akhtar@samsung.com \
    --cc=asutoshd@codeaurora.org \
    --cc=boram.shin@samsung.com \
    --cc=bvanassche@acm.org \
    --cc=cang@codeaurora.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=huobean@gmail.com \
    --cc=j-young.choi@samsung.com \
    --cc=javier.gonz@samsung.com \
    --cc=jejb@linux.ibm.com \
    --cc=jh.i.park@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=seunguk.shin@samsung.com \
    --cc=stanley.chu@mediatek.com \
    --cc=sungjun07.park@samsung.com \
    --cc=ymhungry.lee@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®