On 5/26/24 01:16, Avri Altman wrote:
+static inline void ufshcd_freez_hw_queues(struct ufs_hba *hba) +{ + struct scsi_device *sdev; + + shost_for_each_device(sdev, hba->host) { + if (sdev == hba->ufs_device_wlun) + continue; + blk_mq_freeze_queue(sdev->request_queue); + blk_mq_quiesce_queue(sdev->request_queue); + } +} + +static inline void ufshcd_unfreez_hw_queues(struct ufs_hba *hba) +{ + struct scsi_device *sdev; + + shost_for_each_device(sdev, hba->host) { + if (sdev == hba->ufs_device_wlun) + continue; + blk_mq_unquiesce_queue(sdev->request_queue); + blk_mq_unfreeze_queue(sdev->request_queue); + } +}
Why have these functions been declared inline? blk_mq_freeze_queue() may sleep and hence performance is not an argument to inline these functions. Additionally, the WLUN should not be skipped when freezing or unfreezing request queues. The blk_mq_quiesce_queue() and blk_mq_unquiesce_queue() calls are not necessary in the above code. Please remove these. Thanks, Bart.