Re: [PATCH v6 1/2] ufs: core: skip ABORT TASK for device management commands
From: Bart Van Assche
Date: Wed Nov 04 2026 - 22:40:28 EST
On 11/4/26 4:43 PM, Kiwoong Kim wrote:
> @@ -8046,6 +8046,9 @@ int ufshcd_try_to_abort_task(struct ufs_hba *hba, int tag)
>
> lrbp = scsi_cmd_priv(cmd);
>
> + if (!ufshcd_is_scsi_cmd(cmd))
> + goto clear_cmd;
> +
ufshcd_abort() already has the following code for the SDB path:
if (blk_mq_is_reserved_rq(rq))
err = ufshcd_clear_cmd(hba, tag);
else
err = ufshcd_try_to_abort_task(hba, tag);
and ufshcd_abort_one() skips reserved requests. Hence, ufshcd_mcq_abort()
is the only caller that can pass a device management command to
ufshcd_try_to_abort_task(). Please handle this the same way for both
paths. Either add the check in ufshcd_mcq_abort(), similar to the SDB
path, or keep it in ufshcd_try_to_abort_task() and remove the now
redundant check from ufshcd_abort().
If the check stays in ufshcd_try_to_abort_task(), please also update
its kernel-doc header. That header says that UFS_QUERY_TASK and
UFS_ABORT_TASK are sent unconditionally.
> Fixes: 08b12cda6c44 ("scsi: ufs: core: Switch to scsi_get_internal_cmd()")
> Signed-off-by: Kiwoong Kim <kwmad.kim@xxxxxxxxxxx>
> Reviewed-by: Bean Huo <beanhuo@xxxxxxxxxx>
> Reported-by: Bart Van Assche <bvanassche@xxxxxxx>
Please move the Reported-by: tag above the Signed-off-by: tag.
checkpatch also expects a Closes: tag after Reported-by:.
Thanks,
Bart.