2021-02-24 10:28:04

by Avri Altman

[permalink] [raw]
Subject: RE: [PATCH v24 4/4] scsi: ufs: Add HPB 2.0 support


> +static int ufshpb_issue_umap_all_req(struct ufshpb_lu *hpb)
Maybe ufshpb_issue_umap_all_req is just a wrapper for ufshpb_issue_umap_req?
e.g it calls ufshpb_issue_umap_req(hpb, int read_buferr_id = 0x3) ?
Then on host mode inactivation:
static int ufshpb_issue_umap_single_req(struct ufshpb_lu *hpb)
{
return ufshpb_issue_umap_req(hpb, 0x1);
}

> @@ -1691,6 +2180,7 @@ static void ufshpb_hpb_lu_prepared(struct ufs_hba
> *hba)
> ufshpb_set_state(hpb, HPB_PRESENT);
> if ((hpb->lu_pinned_end - hpb->lu_pinned_start) > 0)
> queue_work(ufshpb_wq, &hpb->map_work);
> + ufshpb_issue_umap_all_req(hpb);
If (!is_legacy)


2021-02-24 11:57:10

by Avri Altman

[permalink] [raw]
Subject: RE: [PATCH v24 4/4] scsi: ufs: Add HPB 2.0 support

>
>
> > +static int ufshpb_issue_umap_all_req(struct ufshpb_lu *hpb)
> Maybe ufshpb_issue_umap_all_req is just a wrapper for
> ufshpb_issue_umap_req?
> e.g it calls ufshpb_issue_umap_req(hpb, int read_buferr_id = 0x3) ?
> Then on host mode inactivation:
> static int ufshpb_issue_umap_single_req(struct ufshpb_lu *hpb)
> {
> return ufshpb_issue_umap_req(hpb, 0x1);
> }
Better yet, ufshpb_execute_umap_req can get *rgn as an extra argument.
ufshpb_issue_umap_all_req will call it with NULL, while
ufshpb_issue_umap_single_req will call it with the rgn to inactivate.

Then, ufshpb_set_unmap_cmd takes the form:
static void ufshpb_set_unmap_cmd(unsigned char *cdb, struct ufshpb_region *rgn)
{
cdb[0] = UFSHPB_WRITE_BUFFER;

if (rgn) {
cdb[1] = UFSHPB_WRITE_BUFFER_INACT_SINGLE_ID;
put_unaligned_be16(rgn->rgn_idx, &cdb[2]);
} else {
cdb[1] = UFSHPB_WRITE_BUFFER_INACT_ALL_ID;
}

cdb[9] = 0x00;
}

Does it make sense?
Thanks,
Avri

2021-02-25 06:17:39

by Daejun Park

[permalink] [raw]
Subject: RE: RE: [PATCH v24 4/4] scsi: ufs: Add HPB 2.0 support

> >
> > > +static int ufshpb_issue_umap_all_req(struct ufshpb_lu *hpb)
> > Maybe ufshpb_issue_umap_all_req is just a wrapper for
> > ufshpb_issue_umap_req?
> > e.g it calls ufshpb_issue_umap_req(hpb, int read_buferr_id = 0x3) ?
> > Then on host mode inactivation:
> > static int ufshpb_issue_umap_single_req(struct ufshpb_lu *hpb)
> > {
> > return ufshpb_issue_umap_req(hpb, 0x1);
> > }
> Better yet, ufshpb_execute_umap_req can get *rgn as an extra argument.
> ufshpb_issue_umap_all_req will call it with NULL, while
> ufshpb_issue_umap_single_req will call it with the rgn to inactivate.
>
> Then, ufshpb_set_unmap_cmd takes the form:
> static void ufshpb_set_unmap_cmd(unsigned char *cdb, struct ufshpb_region *rgn)
> {
> cdb[0] = UFSHPB_WRITE_BUFFER;
>
> if (rgn) {
> cdb[1] = UFSHPB_WRITE_BUFFER_INACT_SINGLE_ID;
> put_unaligned_be16(rgn->rgn_idx, &cdb[2]);
> } else {
> cdb[1] = UFSHPB_WRITE_BUFFER_INACT_ALL_ID;
> }
>
> cdb[9] = 0x00;
> }
>
> Does it make sense?

I got it.

Thanks,
Daejun