Re: [PATCH v4 3/4] scsi: ufs: cleanup ufs initialization path

2020-05-31 Thread Bean Huo
On Sat, 2020-05-30 at 06:37 +, Avri Altman wrote: > > + /* Get the length of descriptor */ > > + ufshcd_map_desc_id_to_length(hba, desc_id, &buff_len); > > + if (!buff_len) { > > + dev_err(hba->dev, "%s: Failed to get desc length", > > __func__); > > +

Re: [PATCH v4 3/4] scsi: ufs: cleanup ufs initialization path

2020-05-30 Thread Bean Huo
Hi Avri thanks your review. On Sat, 2020-05-30 at 06:37 +, Avri Altman wrote: > > - case QUERY_DESC_IDN_RFU_0: > > - case QUERY_DESC_IDN_RFU_1: > > You forgot to check that desc_id < QUERY_DESC_IDN_MAX I deleted it since I saw the caller has checked this. I will add back. > >

RE: [PATCH v4 3/4] scsi: ufs: cleanup ufs initialization path

2020-05-29 Thread Avri Altman
> - case QUERY_DESC_IDN_RFU_0: > - case QUERY_DESC_IDN_RFU_1: You forgot to check that desc_id < QUERY_DESC_IDN_MAX > + if (desc_id == QUERY_DESC_IDN_RFU_0 || desc_id == > QUERY_DESC_IDN_RFU_1) > *desc_len = 0; > - break; > - default: > -

[PATCH v4 3/4] scsi: ufs: cleanup ufs initialization path

2020-05-29 Thread Bean Huo
From: Bean Huo At UFS initialization stage, to get the length of the descriptor, ufshcd_read_desc_length() being called 6 times. Instead, we will capture the descriptor size the first time we'll read it. Delete unnecessary redundant code, remove ufshcd_read_desc_length(), ufshcd_init_desc_sizes