lkml.org 
[lkml]   [2020]   [Jun]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRE: [RFC PATCH 5/5] scsi: ufs: Prepare HPB read for cached sub-region
    From
    Date
    > > +static bool ufshpb_test_ppn_dirty(struct ufshpb_lu *hpb, int rgn_idx,
    > > + int srgn_idx, int srgn_offset, int cnt)

    > > +
    > > + for (i = 0; i < bit_len; i++) {
    > > + if (test_bit(srgn_offset + i, srgn->mctx->ppn_dirty))
    > Maybe use a mask or hweight instead of testing bit by bit?
    There is no problem in this HPB vesion because it only supports 4KB sized read IO.
    However, this code is not as efficient as you pointed out. So I will change this in HPB version 2.0.

    > > +static void
    > > +ufshpb_set_hpb_read_to_upiu(struct ufshpb_lu *hpb, struct ufshcd_lrb
    > > *lrbp,
    > > + u32 lpn, u64 ppn, unsigned int transfer_len)
    > > +{
    > > + unsigned char *cdb = lrbp->ucd_req_ptr->sc.cdb;
    > > +
    > > + cdb[0] = UFSHPB_READ;
    > > +
    > > + put_unaligned_be32(lpn, &cdb[2]);
    > Is this needed? The lba is already occupying bytes 2..5
    The needless code will be deleted on next patch.

    Thanks,
    Daejun

    \
     
     \ /
      Last update: 2020-06-09 02:58    [W:4.179 / U:0.092 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site