@@ -2715,27 +2715,23 @@ static int ufshcd_compose_devman_upiu(struct ufs_hba *hba,
27152715 * for SCSI Purposes
27162716 * @hba: per adapter instance
27172717 * @lrbp: pointer to local reference block
2718- *
2719- * Return: 0 upon success; < 0 upon failure.
27202718 */
2721- static int ufshcd_comp_scsi_upiu (struct ufs_hba * hba , struct ufshcd_lrb * lrbp )
2719+ static void ufshcd_comp_scsi_upiu (struct ufs_hba * hba , struct ufshcd_lrb * lrbp )
27222720{
2721+ struct request * rq = scsi_cmd_to_rq (lrbp -> cmd );
2722+ unsigned int ioprio_class = IOPRIO_PRIO_CLASS (req_get_ioprio (rq ));
27232723 u8 upiu_flags ;
2724- int ret = 0 ;
27252724
27262725 if (hba -> ufs_version <= ufshci_version (1 , 1 ))
27272726 lrbp -> command_type = UTP_CMD_TYPE_SCSI ;
27282727 else
27292728 lrbp -> command_type = UTP_CMD_TYPE_UFS_STORAGE ;
27302729
2731- if (likely (lrbp -> cmd )) {
2732- ufshcd_prepare_req_desc_hdr (lrbp , & upiu_flags , lrbp -> cmd -> sc_data_direction , 0 );
2733- ufshcd_prepare_utp_scsi_cmd_upiu (lrbp , upiu_flags );
2734- } else {
2735- ret = - EINVAL ;
2736- }
2737-
2738- return ret ;
2730+ ufshcd_prepare_req_desc_hdr (lrbp , & upiu_flags ,
2731+ lrbp -> cmd -> sc_data_direction , 0 );
2732+ if (ioprio_class == IOPRIO_CLASS_RT )
2733+ upiu_flags |= UPIU_CMD_FLAGS_CP ;
2734+ ufshcd_prepare_utp_scsi_cmd_upiu (lrbp , upiu_flags );
27392735}
27402736
27412737/**
@@ -2823,8 +2819,6 @@ static int ufshcd_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
28232819 int err = 0 ;
28242820 struct ufs_hw_queue * hwq = NULL ;
28252821
2826- WARN_ONCE (tag < 0 || tag >= hba -> nutrs , "Invalid tag %d\n" , tag );
2827-
28282822 switch (hba -> ufshcd_state ) {
28292823 case UFSHCD_STATE_OPERATIONAL :
28302824 break ;
@@ -5098,8 +5092,7 @@ static int ufshcd_slave_configure(struct scsi_device *sdev)
50985092 struct request_queue * q = sdev -> request_queue ;
50995093
51005094 blk_queue_update_dma_pad (q , PRDT_DATA_BYTE_COUNT_PAD - 1 );
5101- if (hba -> quirks & UFSHCD_QUIRK_4KB_DMA_ALIGNMENT )
5102- blk_queue_update_dma_alignment (q , SZ_4K - 1 );
5095+
51035096 /*
51045097 * Block runtime-pm until all consumers are added.
51055098 * Refer ufshcd_setup_links().
@@ -5115,6 +5108,9 @@ static int ufshcd_slave_configure(struct scsi_device *sdev)
51155108 */
51165109 sdev -> silence_suspend = 1 ;
51175110
5111+ if (hba -> vops && hba -> vops -> config_scsi_dev )
5112+ hba -> vops -> config_scsi_dev (sdev );
5113+
51185114 ufshcd_crypto_register (hba , q );
51195115
51205116 return 0 ;
@@ -6924,8 +6920,6 @@ static int __ufshcd_issue_tm_cmd(struct ufs_hba *hba,
69246920 spin_lock_irqsave (host -> host_lock , flags );
69256921
69266922 task_tag = req -> tag ;
6927- WARN_ONCE (task_tag < 0 || task_tag >= hba -> nutmrs , "Invalid tag %d\n" ,
6928- task_tag );
69296923 hba -> tmf_rqs [req -> tag ] = req ;
69306924 treq -> upiu_req .req_header .task_tag = task_tag ;
69316925
@@ -7499,8 +7493,6 @@ static int ufshcd_abort(struct scsi_cmnd *cmd)
74997493 bool outstanding ;
75007494 u32 reg ;
75017495
7502- WARN_ONCE (tag < 0 , "Invalid tag %d\n" , tag );
7503-
75047496 ufshcd_hold (hba );
75057497
75067498 if (!is_mcq_enabled (hba )) {
0 commit comments