@@ -631,6 +631,8 @@ static inline void nvme_init_request(struct request *req,
631631 cmd -> common .flags &= ~NVME_CMD_SGL_ALL ;
632632
633633 req -> cmd_flags |= REQ_FAILFAST_DRIVER ;
634+ if (req -> mq_hctx -> type == HCTX_TYPE_POLL )
635+ req -> cmd_flags |= REQ_HIPRI ;
634636 nvme_clear_nvme_request (req );
635637 memcpy (nvme_req (req )-> cmd , cmd , sizeof (* cmd ));
636638}
@@ -1029,39 +1031,14 @@ blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req)
10291031}
10301032EXPORT_SYMBOL_GPL (nvme_setup_cmd );
10311033
1032- static void nvme_end_sync_rq (struct request * rq , blk_status_t error )
1033- {
1034- struct completion * waiting = rq -> end_io_data ;
1035-
1036- rq -> end_io_data = NULL ;
1037- complete (waiting );
1038- }
1039-
1040- static void nvme_execute_rq_polled (struct request_queue * q ,
1041- struct gendisk * bd_disk , struct request * rq , int at_head )
1042- {
1043- DECLARE_COMPLETION_ONSTACK (wait );
1044-
1045- WARN_ON_ONCE (!test_bit (QUEUE_FLAG_POLL , & q -> queue_flags ));
1046-
1047- rq -> cmd_flags |= REQ_HIPRI ;
1048- rq -> end_io_data = & wait ;
1049- blk_execute_rq_nowait (bd_disk , rq , at_head , nvme_end_sync_rq );
1050-
1051- while (!completion_done (& wait )) {
1052- blk_poll (q , request_to_qc_t (rq -> mq_hctx , rq ), true);
1053- cond_resched ();
1054- }
1055- }
1056-
10571034/*
10581035 * Returns 0 on success. If the result is negative, it's a Linux error code;
10591036 * if the result is positive, it's an NVM Express status code
10601037 */
10611038int __nvme_submit_sync_cmd (struct request_queue * q , struct nvme_command * cmd ,
10621039 union nvme_result * result , void * buffer , unsigned bufflen ,
10631040 unsigned timeout , int qid , int at_head ,
1064- blk_mq_req_flags_t flags , bool poll )
1041+ blk_mq_req_flags_t flags )
10651042{
10661043 struct request * req ;
10671044 int ret ;
@@ -1082,10 +1059,7 @@ int __nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
10821059 goto out ;
10831060 }
10841061
1085- if (poll )
1086- nvme_execute_rq_polled (req -> q , NULL , req , at_head );
1087- else
1088- blk_execute_rq (NULL , req , at_head );
1062+ blk_execute_rq (NULL , req , at_head );
10891063 if (result )
10901064 * result = nvme_req (req )-> result ;
10911065 if (nvme_req (req )-> flags & NVME_REQ_CANCELLED )
@@ -1102,7 +1076,7 @@ int nvme_submit_sync_cmd(struct request_queue *q, struct nvme_command *cmd,
11021076 void * buffer , unsigned bufflen )
11031077{
11041078 return __nvme_submit_sync_cmd (q , cmd , NULL , buffer , bufflen , 0 ,
1105- NVME_QID_ANY , 0 , 0 , false );
1079+ NVME_QID_ANY , 0 , 0 );
11061080}
11071081EXPORT_SYMBOL_GPL (nvme_submit_sync_cmd );
11081082
@@ -1465,7 +1439,7 @@ static int nvme_features(struct nvme_ctrl *dev, u8 op, unsigned int fid,
14651439 c .features .dword11 = cpu_to_le32 (dword11 );
14661440
14671441 ret = __nvme_submit_sync_cmd (dev -> admin_q , & c , & res ,
1468- buffer , buflen , 0 , NVME_QID_ANY , 0 , 0 , false );
1442+ buffer , buflen , 0 , NVME_QID_ANY , 0 , 0 );
14691443 if (ret >= 0 && result )
14701444 * result = le32_to_cpu (res .u32 );
14711445 return ret ;
@@ -2047,7 +2021,7 @@ int nvme_sec_submit(void *data, u16 spsp, u8 secp, void *buffer, size_t len,
20472021 cmd .common .cdw11 = cpu_to_le32 (len );
20482022
20492023 return __nvme_submit_sync_cmd (ctrl -> admin_q , & cmd , NULL , buffer , len , 0 ,
2050- NVME_QID_ANY , 1 , 0 , false );
2024+ NVME_QID_ANY , 1 , 0 );
20512025}
20522026EXPORT_SYMBOL_GPL (nvme_sec_submit );
20532027#endif /* CONFIG_BLK_SED_OPAL */
0 commit comments