Re: [PATCH 3/4] scsi: ufs: Make the polling code report which command has been completed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/12/24 02:14, Avri Altman wrote:
-static void ufshcd_mcq_process_cqe(struct ufs_hba *hba,
-                                  struct ufs_hw_queue *hwq)
+/* Returns true if and only if @compl_cmd has been completed. */
+static bool ufshcd_mcq_process_cqe(struct ufs_hba *hba,
+                                  struct ufs_hw_queue *hwq,
+                                  struct scsi_cmnd *compl_cmd)
  {
         struct cq_entry *cqe = ufshcd_mcq_cur_cqe(hwq);
-       int tag = ufshcd_mcq_get_tag(hba, cqe);

         if (cqe->command_desc_base_addr) {
-               ufshcd_compl_one_cqe(hba, tag, cqe);
-               /* After processed the cqe, mark it empty (invalid) entry */
+               const int tag = ufshcd_mcq_get_tag(hba, cqe);
+               /* Mark the CQE as invalid. */
                 cqe->command_desc_base_addr = 0;
+               return ufshcd_compl_one_cqe(hba, tag, cqe, compl_cmd);
         }
+       return false;
  }

Maybe elaborate on explaining why the tag isn't enough to designate the completing command?

Hi Avri,

Anything that uniquely identifies a SCSI command would work. I think
it's more a matter of making a choice rather than arguing why not using
the blk_mq_unique_tag_to_hwq() return value?

Thanks,

Bart.




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux