RE: [PATCH v34 4/4] scsi: ufs: Add HPB 2.0 support
From: Avri Altman
Date: Thu May 20 2021 - 08:33:06 EST
> + /* 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 = max(HPB_MULTI_CHUNK_HIGH,
> + hpb->pre_req_min_tr_len);
I think this should only be
else
hpb->pre_req_max_tr_len = HPB_MULTI_CHUNK_HIGH;
where HPB_MULTI_CHUNK_HIGH should fit into a single byte,
regardless of bMAX_ DATA_SIZE_FOR_HPB_SINGLE_CMD,
which being an attribute (u32) can be significantly larger.
Thanks,
Avri