Re: [PATCH RFC v2 03/18] scsi: core: Implement reserved command handling

John Garry
2022-06-16T08:23:12Z

On 16/06/2022 03:47, Damien Le Moal wrote:
>>> so going backward several years... That internal tag for ATA does not
>>> need to be reserved since this command is always used when the drive is
>>> idle and no other NCQ commands are on-going.
>>
>> So do you mean that ATA_TAG_INTERNAL qc is used for other commands
>> apart from internal commands?
>
> No. It is used only for internal commands. What I meant to say is that
> currently, internal commands are issued only on device scan, device
> revalidate and error handling. All of these phases are done with the
> device under EH with the issuing path stopped and all commands
> completed,

If I want to allocate a request for an ATA internal command then could I
use 1x from the regular tags? I didn't think that this was possible as I
thought that all tags may be outstanding when EH kicks in. I need to
double check it.

Even if it were true, not using a reserved tag for ATA internal command
makes things more tricky as this command requires special handling for
scsi blk_mq_ops and there is no easy way to identify the command as
reserved (to know special handling is required).

>so no regular commands can be issued. Only internal ones, non
> NCQ, using the ATA_TAG_INTERNAL. So strictly speaking, we should not
> need to reserve that internal tag at all.
>

Thanks,
John