diff options
author | Bean Huo <beanhuo@micron.com> | 2020-06-03 11:19:58 +0200 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2020-06-16 05:17:48 +0200 |
commit | 7a0bf85b5e1859bfd40a07279d20edd847265702 (patch) | |
tree | 6db0554782b1cb18b9f18efe69e9a9afba7f4bf3 /drivers/scsi/ufs/ufshcd.h | |
parent | scsi: ufs: Fix potential NULL pointer access during memcpy (diff) | |
download | linux-7a0bf85b5e1859bfd40a07279d20edd847265702.tar.xz linux-7a0bf85b5e1859bfd40a07279d20edd847265702.zip |
scsi: ufs: Clean up ufs initialization path
At UFS initialization stage, to get the length of the descriptor,
ufshcd_read_desc_length() was 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(), and boost UFS initialization.
Link: https://lore.kernel.org/r/20200603091959.27618-5-huobean@gmail.com
Acked-by: Avri Altman <avri.altman@wdc.com>
Reviewed-by: Bart van Assche <bvanassche@acm.org>
Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>
Signed-off-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/ufs/ufshcd.h')
-rw-r--r-- | drivers/scsi/ufs/ufshcd.h | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index 84842003c7ac..11cb12bf44f7 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -236,16 +236,6 @@ struct ufs_dev_cmd { struct ufs_query query; }; -struct ufs_desc_size { - int dev_desc; - int pwr_desc; - int geom_desc; - int interc_desc; - int unit_desc; - int conf_desc; - int hlth_desc; -}; - /** * struct ufs_clk_info - UFS clock related info * @list: list headed by hba->clk_list_head @@ -767,7 +757,7 @@ struct ufs_hba { bool is_urgent_bkops_lvl_checked; struct rw_semaphore clk_scaling_lock; - struct ufs_desc_size desc_size; + unsigned char desc_size[QUERY_DESC_IDN_MAX]; atomic_t scsi_block_reqs_cnt; struct device bsg_dev; @@ -1005,8 +995,8 @@ int ufshcd_read_string_desc(struct ufs_hba *hba, u8 desc_index, int ufshcd_hold(struct ufs_hba *hba, bool async); void ufshcd_release(struct ufs_hba *hba); -int ufshcd_map_desc_id_to_length(struct ufs_hba *hba, enum desc_idn desc_id, - int *desc_length); +void ufshcd_map_desc_id_to_length(struct ufs_hba *hba, enum desc_idn desc_id, + int *desc_length); u32 ufshcd_get_local_unipro_ver(struct ufs_hba *hba); |