Re: [PATCH v1] scsi: ufs: core: Process abort completed command in MCQ mode

From: Bart Van Assche
Date: Wed Nov 01 2023 - 12:39:26 EST


On 11/1/23 01:45, SEO HOYOUNG wrote:
In MCQ mode, the case where OCS is updated to aborted is as follows
1. when abort processing is completed
2. When a duplicate command occurs

What is a "duplicate command"? The UFSHCI driver guarantees that each
SCSI command has a unique tag.

In case of 1 situation, cmd should be re-request.

It should be resubmitted by the SCSI error handler. The UFSHCI driver
does not have to request this explicitly. See also the code at the end
of scmd_eh_abort_handler().

case OCS_ABORTED:
- result |= DID_ABORT << 16;
+ if (cqe)
+ eec = le32_to_cpu(cqe->status) & MASK_EEC;
+
+ if (is_mcq_enabled(hba) && !eec)
+ result |= DID_REQUEUE << 16;
+ else
+ result |= DID_ABORT << 16;
break;

I don't think this change is necessary. Additionally, introducing
different behavior for MCQ compared to legacy mode in this code path is
suspicious. Why should how commands are queued affect how aborts are
processed?

Thanks,

Bart.