On 2020-06-04 18:38, Daejun Park wrote:
> > + if (total_srgn_cnt != 0) {
> > +dev_err(hba->dev, "ufshpb(%d) error total_subregion_count %d",
> > + hpb->lun, total_srgn_cnt);
> > +goto release_srgn_table;
> > + }
> > +
> > + return 0;
> > +release_srgn_table:
> > + for (i = 0; i <
> > +static inline bool ufshpb_is_support_chunk(int transfer_len)
> > +{
> > + return transfer_len <= HPB_MULTI_CHUNK_HIGH;
> > +}
>
> The names used in the above function are mysterious. What is a support
> chunk? What does "multi chunk high" mean? Please add a comment.
HPB1.0 limits
On 2020-06-04 19:12, Daejun Park wrote:
> +static inline bool ufshpb_is_read_cmd(struct scsi_cmnd *cmd)
> +{
> + if (cmd->cmnd[0] == READ_10 || cmd->cmnd[0] == READ_16)
> + return true;
> +
> + return false;
> +}
Has it been considered to check req_op(cmd->request) instead of
On 2020-06-06 11:38, Avri Altman wrote:
>> + 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?
How about using find_next_bit() from include/linux/bitmap.h?
/*
*
> > +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
> +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
6 matches
Mail list logo