Re: [PATCH v9 17/17] scsi: ufs: Inform the block layer about write ordering

Bao D. Nguyen
2023-08-18T00:21:00Z

On 8/17/2023 3:05 PM, Bart Van Assche wrote:
> On 8/17/23 14:47, Bao D. Nguyen wrote:
>> During initialization, ufshcd_auto_hibern8_update() is not called.
>> Therefore,
>> you may have SDB mode with auto hibernate enabled ->
>> preserves_write_order = false, [ ... ]
>
> Hi Bao,
>
> ufshcd_slave_configure() is called before any SCSI commands are
> submitted to a
> logical unit. ufshcd_slave_configure() sets 'preserves_write_order'
> depending on
> the value of hba->ahit. Does this answer your question?

Sorry Bart. Not yet :-) Please let me try to explain myself again.

For example, in SDB mode, after the probe and you want to enable
auto-hibern8, you would call ufshcd_auto_hibern8_update() which then calls
ufshcd_update_preserves_write_order(). Before auto-hibern8 is enabled,
you would check this condition:
if (blk_queue_is_zoned(q) && !q->elevator)

In other words, auto-hibern8 is enabled only if the above condition false.

However, the during a normal operation, the ufshcd_auto_hibern8_update()
may not get called at all, and auto-hibern8 can be enabled in SDB mode
as part of ufs init. Would that be a problem to have auto-hibern8
enabled without checking whether the above condition is false?

Thanks
Bao

>
> Thanks,
>
> Bart.