lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 23 Feb 2021 17:04:10 +0900
From:   Daejun Park <daejun7.park@...sung.com>
To:     Avri Altman <Avri.Altman@....com>,
        Daejun Park <daejun7.park@...sung.com>,
        Greg KH <gregkh@...uxfoundation.org>,
        "jejb@...ux.ibm.com" <jejb@...ux.ibm.com>,
        "martin.petersen@...cle.com" <martin.petersen@...cle.com>,
        "asutoshd@...eaurora.org" <asutoshd@...eaurora.org>,
        "stanley.chu@...iatek.com" <stanley.chu@...iatek.com>,
        "cang@...eaurora.org" <cang@...eaurora.org>,
        "bvanassche@....org" <bvanassche@....org>,
        "huobean@...il.com" <huobean@...il.com>,
        ALIM AKHTAR <alim.akhtar@...sung.com>,
        Javier Gonzalez <javier.gonz@...sung.com>
CC:     "linux-scsi@...r.kernel.org" <linux-scsi@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        JinHwan Park <jh.i.park@...sung.com>,
        SEUNGUK SHIN <seunguk.shin@...sung.com>,
        Sung-Jun Park <sungjun07.park@...sung.com>,
        yongmyung lee <ymhungry.lee@...sung.com>,
        Jinyoung CHOI <j-young.choi@...sung.com>,
        BoRam Shin <boram.shin@...sung.com>
Subject: RE: RE: [PATCH v22 4/4] scsi: ufs: Add HPB 2.0 support

> > @@ -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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ