RE: [PATCH v5 3/3] scsi: ufs: sysfs: Make max_number_of_rtt read-write

From: Avri Altman
Date: Thu May 23 2024 - 23:54:43 EST


>
> On 5/23/24 05:58, Avri Altman wrote:
> > + /* make sure that there are no outstanding requests when rtt is set */
> > + ufshcd_scsi_block_requests(hba);
> > + blk_mq_wait_quiesce_done(&hba->host->tag_set);
> > +
> > + ret = ufshcd_query_attr(hba, UPIU_QUERY_OPCODE_WRITE_ATTR,
> > + QUERY_ATTR_IDN_MAX_NUM_OF_RTT, 0, 0, &rtt);
> > +
> > + ufshcd_scsi_unblock_requests(hba);
>
> The above doesn't look correct to me. ufshcd_scsi_block_requests() does not
> guarantee that all pending commands have finished by the time it returns.
> Please blk_mq_freeze_queue() / blk_mq_unfreeze_queue() instead.
Thanks. Will use those to drain the queues.

Thanks,
Avri

>
> Thanks,
>
> Bart.