lkml.org 
[lkml]   [2021]   [Feb]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRE: RE: [PATCH v22 4/4] scsi: ufs: Add HPB 2.0 support
From
Date
> > +       copied = ufshpb_fill_ppn_from_page(hpb, srgn->mctx, srgn_offset,
> > + pre_req->wb.len - offset,
> > + &addr[offset]);
> > +
> > + if (copied < 0)
> > + goto mctx_error;
> > +
> > + offset += copied;
> > + srgn_offset += offset;
> This seems wrong.
> How come the region offset is affected from the offset inside the pages?

I will change as : srgn_offset += copied
>
> > +
> > + if (srgn_offset == hpb->entries_per_srgn) {
> > + srgn_offset = 0;
> > +
> > + if (++srgn_idx == hpb->srgns_per_rgn) {
> > + srgn_idx = 0;
> > + rgn_idx++;
> > + }
> > + }
> > +
> > + if (offset < pre_req->wb.len)
> > + goto next_offset;
> If the 512k resides in a single subregion, and span across pages, fill_ppn should take care of that.
> If the 512k spans across subregion regions, than it spans across 2 subregions at most,
> and maybe you can use it.

I think it can be support span across pages.

The following is about the case of HPB entries are span to two page of
the mctx. fill_ppn() fills HPB entries in the first page of the mctx.
srgn_offset will be updated to check next page. In the next round,
fill_ppn() fills the entries in the second page of mctx.

Thanks,
Daejun

\
 
 \ /
  Last update: 2021-02-25 03:52    [W:0.209 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site