Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: ufs: core: Pass a SCSI pointer instead of an LRB pointer

Pass a pointer to a SCSI command between functions instead of an LRB
pointer. This change prepares for removing the ufshcd_lrb task_tag
member.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Link: https://patch.msgid.link/20251031204029.2883185-25-bvanassche@acm.org
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Bart Van Assche and committed by
Martin K. Petersen
176b9300 22089c21

+11 -10
+11 -10
drivers/ufs/core/ufshcd.c
··· 2822 2822 /** 2823 2823 * ufshcd_prepare_utp_query_req_upiu() - fill the utp_transfer_req_desc for query request 2824 2824 * @hba: UFS hba 2825 - * @lrbp: local reference block pointer 2825 + * @cmd: SCSI command pointer 2826 2826 * @upiu_flags: flags 2827 2827 */ 2828 2828 static void ufshcd_prepare_utp_query_req_upiu(struct ufs_hba *hba, 2829 - struct ufshcd_lrb *lrbp, u8 upiu_flags) 2829 + struct scsi_cmnd *cmd, u8 upiu_flags) 2830 2830 { 2831 + struct ufshcd_lrb *lrbp = scsi_cmd_priv(cmd); 2831 2832 struct utp_upiu_req *ucd_req_ptr = lrbp->ucd_req_ptr; 2832 2833 struct ufs_query *query = &hba->dev_cmd.query; 2833 2834 u16 len = be16_to_cpu(query->request.upiu_req.length); ··· 2857 2856 memcpy(ucd_req_ptr + 1, query->descriptor, len); 2858 2857 } 2859 2858 2860 - static inline void ufshcd_prepare_utp_nop_upiu(struct ufshcd_lrb *lrbp) 2859 + static inline void ufshcd_prepare_utp_nop_upiu(struct scsi_cmnd *cmd) 2861 2860 { 2861 + struct ufshcd_lrb *lrbp = scsi_cmd_priv(cmd); 2862 2862 struct utp_upiu_req *ucd_req_ptr = lrbp->ucd_req_ptr; 2863 2863 2864 2864 memset(ucd_req_ptr, 0, sizeof(struct utp_upiu_req)); ··· 2874 2872 * ufshcd_compose_devman_upiu - UFS Protocol Information Unit(UPIU) 2875 2873 * for Device Management Purposes 2876 2874 * @hba: per adapter instance 2877 - * @lrbp: pointer to local reference block 2875 + * @cmd: SCSI command pointer 2878 2876 * 2879 2877 * Return: 0 upon success; < 0 upon failure. 2880 2878 */ 2881 2879 static int ufshcd_compose_devman_upiu(struct ufs_hba *hba, 2882 - struct ufshcd_lrb *lrbp) 2880 + struct scsi_cmnd *cmd) 2883 2881 { 2882 + struct ufshcd_lrb *lrbp = scsi_cmd_priv(cmd); 2884 2883 u8 upiu_flags; 2885 2884 int ret = 0; 2886 2885 2887 2886 ufshcd_prepare_req_desc_hdr(hba, lrbp, &upiu_flags, DMA_NONE, 0); 2888 2887 2889 2888 if (hba->dev_cmd.type == DEV_CMD_TYPE_QUERY) 2890 - ufshcd_prepare_utp_query_req_upiu(hba, lrbp, upiu_flags); 2889 + ufshcd_prepare_utp_query_req_upiu(hba, cmd, upiu_flags); 2891 2890 else if (hba->dev_cmd.type == DEV_CMD_TYPE_NOP) 2892 - ufshcd_prepare_utp_nop_upiu(lrbp); 2891 + ufshcd_prepare_utp_nop_upiu(cmd); 2893 2892 else 2894 2893 ret = -EINVAL; 2895 2894 ··· 3129 3126 static int ufshcd_compose_dev_cmd(struct ufs_hba *hba, struct scsi_cmnd *cmd, 3130 3127 enum dev_cmd_type cmd_type, int tag) 3131 3128 { 3132 - struct ufshcd_lrb *lrbp = scsi_cmd_priv(cmd); 3133 - 3134 3129 ufshcd_setup_dev_cmd(hba, cmd, cmd_type, 0, tag); 3135 3130 3136 - return ufshcd_compose_devman_upiu(hba, lrbp); 3131 + return ufshcd_compose_devman_upiu(hba, cmd); 3137 3132 } 3138 3133 3139 3134 /*