lkml.org 
[lkml]   [2020]   [May]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH v2 3/3] scsi: ufs: cleanup ufs initialization path
Date
Hi,

> From: Bean Huo <beanhuo@micron.com>
>
> At UFS initialization stage, to get the length of the descriptor,
> ufshcd_read_desc_length() being called 6 times.
May I suggest one more clarifying sentence to your commit log:
"Instead, we will capture the descriptor size the first time we'll read it."

>This patch is to
> delete unnecessary reduntant code, remove ufshcd_read_desc_length()
typo: redundant

> and boost UFS initialization.
>
> Signed-off-by: Bean Huo <beanhuo@micron.com>

> + if (desc_id >= QUERY_DESC_IDN_MAX) {
> *desc_len = 0;
> return -EINVAL;
> }
if (desc_id == QUERY_DESC_IDN_RFU_0 || desc_id == QUERY_DESC_IDN_RFU_1)
*desc_len = 0;
else
> +
> + *desc_len = hba->desc_size[desc_id];
> return 0;
> }
> EXPORT_SYMBOL(ufshcd_map_desc_id_to_length);
>
> +static void ufshcd_update_desc_length(struct ufs_hba *hba,
> + enum desc_idn desc_id, int desc_len)
desc_len is at most 255 so maybe u8?

> +{
> + if (hba->desc_size[desc_id] == QUERY_DESC_MAX_SIZE &&
> + desc_id != QUERY_DESC_IDN_STRING)
> + hba->desc_size[desc_id] = desc_len;
> +}
> +


Thanks,
Avri

\
 
 \ /
  Last update: 2020-05-28 16:58    [W:0.161 / U:1.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site