Re: [PATCH v2 7/9] scsi_transport_spi: Freeze request queues instead of quiescing

Bart Van Assche
2020-11-16T17:51:28Z

On 11/16/20 9:22 AM, Christoph Hellwig wrote:
> On Sun, Nov 15, 2020 at 07:04:57PM -0800, Bart Van Assche wrote:
>> Instead of quiescing the request queues involved in domain validation,
>> freeze these. As a result, the struct request_queue pm_only member is no
>> longer set during domain validation. That will allow to modify
>> scsi_execute() such that it stops setting the BLK_MQ_REQ_PREEMPT flag.
>> Three additional changes in this patch are that scsi_mq_alloc_queue() is
>> exported, that scsi_device_quiesce() is no longer exported and that
>> scsi_target_{quiesce,resume}() have been changed into
>> scsi_target_{freeze,unfreeze}().
>
> Can you explain why you need the new request_queue? spi_dv_device seems
> to generally be called from ->slave_configure where no other I/O
> should ever be pending.

Hi Christoph,

I think that the following sysfs attribute, defined in
drivers/scsi/scsi_transport_spi.c, allows to trigger SPI domain
validation at any time:

static DEVICE_ATTR(revalidate, S_IWUSR, NULL, store_spi_revalidate);

>> +++ b/drivers/scsi/scsi_lib.c
>> @@ -1893,6 +1893,7 @@ struct request_queue *scsi_mq_alloc_queue(struct scsi_device *sdev)
>> blk_queue_flag_set(QUEUE_FLAG_SCSI_PASSTHROUGH, q);
>> return q;
>> }
>> +EXPORT_SYMBOL_GPL(scsi_mq_alloc_queue);
>
> I'd much rather open scsi_mq_alloc_queue in a new caller, especially
> given that __scsi_init_queue already is exported.

I will look into this.

Thanks,

Bart.