RE: [PATCH v2] scsi: ufshpb: Opt out pre-reqs from HPB2.0 flows

From: Avri Altman
Date: Fri Oct 29 2021 - 19:47:56 EST


> Hi Avri,
>
> > @@ -1841,13 +1575,7 @@ static void ufshpb_lu_parameter_init(struct
> ufs_hba *hba,
> > u32 entries_per_rgn;
> > u64 rgn_mem_size, tmp;
> >
> > - /* for pre_req */
> > - hpb->pre_req_min_tr_len = hpb_dev_info->max_hpb_single_cmd + 1;
> > -
> > - if (ufshpb_is_legacy(hba))
> > - hpb->pre_req_max_tr_len = HPB_LEGACY_CHUNK_HIGH;
> > - else
> > - hpb->pre_req_max_tr_len = HPB_MULTI_CHUNK_HIGH;
> > + hpb->pre_req_max_tr_len = HPB_LEGACY_CHUNK_HIGH;
>
> They are should be not changed, because it makes
> ufshpb_is_supported_chunk() determine to non-HPB READ when the its size
> is bigger than 4KB.
Yes, this patch downgrades HPB to support single block only as if HPB1.0.
But You are correct.
the spec only _recommend_ to use pre-req commands if transfer length > bMAX_DATA_SIZE_FOR_HPB_SINGLE_CMD.
Meaning, it is ok to use HPB-READ with hpb-read-id = 0x0 and transfer length <= bMAX_DATA_SIZE_FOR_HPB_SINGLE_CMD.
Will re-insert those pieces of code in v3.

While at it, I noticed that I didn't removed ufshpb_get_read_id - will remove it as well.

Thanks,
Avri