mbox series

[RESEND,v2,0/2] scsi: ufs: introduce a callback to override OCS value

Message ID cover.1725251103.git.kwmad.kim@samsung.com
Headers show
Series scsi: ufs: introduce a callback to override OCS value | expand

Message

Kiwoong Kim Sept. 2, 2024, 4:26 a.m. UTC
I send this again adding more reviewers.

UFSHCI defines OCS values but doesn't specify what exact
conditions raise them. So I think it needs another callback
to replace the original OCS value with the value that works
the way you want.

v1 -> v2: fix build error for arguments

Kiwoong Kim (2):
  scsi: ufs: core: introduce override_cqe_ocs
  scsi: ufs: ufs-exynos: implement override_cqe_ocs

 drivers/ufs/core/ufshcd-priv.h |  9 +++++++++
 drivers/ufs/core/ufshcd.c      | 11 +++++++----
 drivers/ufs/host/ufs-exynos.c  |  8 ++++++++
 include/ufs/ufshcd.h           |  1 +
 4 files changed, 25 insertions(+), 4 deletions(-)


base-commit: 3ba963597d19d88eb06b50af8e8757abbdc9035b

Comments

Bart Van Assche Sept. 3, 2024, 7:42 p.m. UTC | #1
On 9/1/24 9:26 PM, Kiwoong Kim wrote:
> Exynos host reports OCS_ABORT when a command is nullifed
> or cleaned up with MCQ enabled.

That is the behavior that is required by the UFSHCI 4.0 standard. Hence,
handling the OCS_ABORTED response should be the same for all host
controllers and no new callback function should be introduced to handle
nullified commands.

> I think the command in those
> situations should be issued again, rather than fail, because
> when some conditions that caused the nullification or cleaning up
> disppears after recovery, the command could be processed.

ufshcd_mcq_nullify_sqe() is called by ufshcd_mcq_sqe_search() and the
latter function is called by ufshcd_mcq_abort(). It is up to the SCSI
core to decide whether or not commands aborted by ufshcd_mcq_abort()
should be resubmitted. This is not something the host driver should
decide about.

Thanks,

Bart.