On 9/20/21 10:30 AM, Adrian Hunter wrote:
On 17/09/21 8:58 pm, Bart Van Assche wrote:
The same comment applies to the commands sent by ufshcd_probe_hba() I think.
If you would like to address this issue, how about passing the flag
BLK_MQ_REQ_RESERVED to the blk_get_request() call in ufshcd_exec_dev_cmd()?
The following additional changes are required to make this work:
* Add a 'reserved_tags' member to struct scsi_host_template, e.g. close to
tag_alloc_policy.
* Modify scsi_mq_setup_tags() such that it copies the reserved_tags value
from the host template into tag_set->reserved_tags.
* Set 'reserved_tags' in the UFS driver SCSI host template.
I think these things only happen on the reset path, so all the slots should
be free, even if all the tags are allocated. With some care, it might be
possible simply to grab a free slot.
Hmm ... my understanding is that ufshcd_try_to_abort_task() may fail and hence
that it is not guaranteed that there will be free slot. Anyway, I'm fine with
the patch in its current shape and implementing the mechanism explained in my
previous email at a later time.
Bart.