Re: [PATCH] scsi: core: Set BLK_FEAT_SKIP_TAGSET_QUIESCE on pseudo SCSI devices

From: Stanley Jhu

Date: Tue Sep 01 2026 - 22:01:39 EST


On Tue, 1 Sep 2026, Bart Van Assche wrote:
> Does setting BLK_FEAT_SKIP_TAGSET_QUIESCE on pseudo_sdev break frequency
> scaling? ufshcd_pause_command_processing() also calls blk_mq_quiesce_tagset().
>
> Why not replace blk_mq_quiesce_tagset() in ufshcd_err_handling_prepare()
> with blk_mq_wait_quiesce_done() and drop blk_mq_unquiesce_tagset() in
> ufshcd_err_handling_unprepare()?

Hi Bart,

Looking at the three call sites of blk_mq_quiesce_tagset() in ufshcd.c, they
have distinct requirements regarding pseudo_sdev:

1. Clock scaling (ufshcd_clock_scaling_prepare):
Requires freezing all queues (including pseudo_sdev) while clock
frequencies change.
2. Command pause (ufshcd_pause_command_processing):
Requires freezing all queues while TX equalization retraining runs.
3. Error handling (ufshcd_err_handling_prepare):
Requires quiescing attached logical units to avoid HOST_BUSY retry
storms during host reset, but must keep pseudo_sdev open so internal
recovery commands (e.g. NOP OUT in ufshcd_verify_dev_init) can proceed.

Setting BLK_FEAT_SKIP_TAGSET_QUIESCE on pseudo_sdev in SCSI core breaks (1)
and (2). Conversely, replacing blk_mq_quiesce_tagset() with
blk_mq_wait_quiesce_done() in (3) leaves logical units unquiesced, causing
incoming I/O to storm the recovering controller with HOST_BUSY retries.

Would it be cleaner to keep blk_mq_quiesce_tagset() for (1) and (2), and
handle (3) locally in UFS error handling by quiescing only logical units?

static void ufshcd_quiesce_all_sdevs(struct ufs_hba *hba)
{
struct scsi_device *sdev;

shost_for_each_device(sdev, hba->host)
blk_mq_quiesce_queue_nowait(sdev->request_queue);
blk_mq_wait_quiesce_done(&hba->host->tag_set);
}

static void ufshcd_unquiesce_all_sdevs(struct ufs_hba *hba)
{
struct scsi_device *sdev;

shost_for_each_device(sdev, hba->host)
blk_mq_unquiesce_queue(sdev->request_queue);
}

Because shost_for_each_device() explicitly skips pseudo SCSI devices
(via scsi_device_is_pseudo_dev() in __scsi_iterate_devices()), logical units
are quiesced while pseudo_sdev remains unquiesced for recovery commands.

What do you think about this approach? If this looks reasonable to you,
I will withdraw the SCSI core patch and submit the UFS-local fix.

Thanks,
Stanley Jhu