mbox series

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

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

Message

Kiwoong Kim Aug. 22, 2024, 11:15 a.m. UTC
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(-)

Comments

Bean Huo Aug. 22, 2024, 2:54 p.m. UTC | #1
On Thu, 2024-08-22 at 20:15 +0900, Kiwoong Kim wrote:
> 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

Hi kiwoong Kim,

I didn't see your above two patches following your cover-letter, did
you send patch with "--thread" optioin?


Kind regards,
Bean

> 
>  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(-)
>
Bart Van Assche Aug. 22, 2024, 4:26 p.m. UTC | #2
On 8/22/24 8:42 AM, Bean Huo wrote:
> On Thu, 2024-08-22 at 20:15 +0900, Kiwoong Kim wrote:
>> Kiwoong Kim (2):
>>    scsi: ufs: core: introduce override_cqe_ocs
>>    scsi: ufs: ufs-exynos: implement override_cqe_ocs
> 
> 
> Hi Kiwoong Kim,
> 
> I didn't see your patch email,just post your second patch here, and
> provide my comments:
> 
>   
> +static enum utp_ocs exynos_ufs_override_cqe_ocs(enum utp_ocs ocs)
> +{
> +	if (ocs == OCS_ABORTED)
> +		ocs = OCS_INVALID_COMMAND_STATUS;
> +	return ocs;
> +}
> 
> 
> I wonder if you have considered the case where the command is aborted
> by the host software or by the device itself?
> 
> If you change OCS to OCS_INVALID_COMMAND_STATUS, there will report a
> DID_REQUEUE to SCSI.

The decision about what to do probably should depend on whether or not
the command has been nullified.

Thanks,

Bart.
Kiwoong Kim Aug. 27, 2024, 5:51 a.m. UTC | #3
> +static enum utp_ocs exynos_ufs_override_cqe_ocs(enum utp_ocs ocs) {
> +	if (ocs == OCS_ABORTED)
> +		ocs = OCS_INVALID_COMMAND_STATUS;
> +	return ocs;
> +}
> 
> 
> I wonder if you have considered the case where the command is aborted
> by the host software or by the device itself?

I mean by the host software and Exynos host reports OCS_ABORTED only for the case when MCQ is enabled.

> 
> If you change OCS to OCS_INVALID_COMMAND_STATUS, there will report a
> DID_REQUEUE to SCSI.

Yes. That's what I meant, in order to process them properly after UFS initialization.

> 
> 
> Kind regards,
> Bean

Thank you.
Kiwoong Kim Aug. 27, 2024, 5:59 a.m. UTC | #4
> https://lore.kernel.org/linux-
> scsi/763ab716ba0207ecdad6f55ce38edf2d1bc7d04b.1724325280.git.kwmad.kim@sam
> sung.com/
> 
> Bart.

I included you but sending the patch set was blocked.
Sorry. Let me fix this as soon as possible.

Thank you.
Kiwoong Kim Sept. 2, 2024, 12:27 a.m. UTC | #5
> > I wonder if you have considered the case where the command is aborted
> > by the host software or by the device itself?
> >
> > If you change OCS to OCS_INVALID_COMMAND_STATUS, there will report a
> > DID_REQUEUE to SCSI.
> 
> The decision about what to do probably should depend on whether or not
> the command has been nullified.
> 
> Thanks,
> 
> Bart.

When MCQ is enabled, Exynos host reports OCS_ABORTED only for nullified cases.

Thanks.