WSL2-Linux-Kernel/drivers/scsi/ufs
Vamshi Gajjela 2ac8f14d7f scsi: ufs: core: Fix hba->last_dme_cmd_tstamp timestamp updating logic
commit ab9fd06cb8f0db0854291833fc40c789e43a361f upstream.

The ufshcd_add_delay_before_dme_cmd() always introduces a delay of
MIN_DELAY_BEFORE_DME_CMDS_US between DME commands even when it's not
required. The delay is added when the UFS host controller supplies the
quirk UFSHCD_QUIRK_DELAY_BEFORE_DME_CMDS.

Fix the logic to update hba->last_dme_cmd_tstamp to ensure subsequent DME
commands have the correct delay in the range of 0 to
MIN_DELAY_BEFORE_DME_CMDS_US.

Update the timestamp at the end of the function to ensure it captures the
latest time after any necessary delay has been applied.

Signed-off-by: Vamshi Gajjela <vamshigajjela@google.com>
Link: https://lore.kernel.org/r/20240724135126.1786126-1-vamshigajjela@google.com
Fixes: cad2e03d86 ("ufs: add support to allow non standard behaviours (quirks)")
Cc: stable@vger.kernel.org
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-08-19 05:45:44 +02:00
..
Kconfig
Makefile
cdns-pltfrm.c scsi: ufs: cdns-pltfrm: Perform read back after writing HCLKDIV 2024-06-16 13:39:19 +02:00
tc-dwc-g210-pci.c
tc-dwc-g210-pltfrm.c
tc-dwc-g210.c
tc-dwc-g210.h
ti-j721e-ufs.c
ufs-debugfs.c
ufs-debugfs.h
ufs-exynos.c
ufs-exynos.h
ufs-fault-injection.c
ufs-fault-injection.h
ufs-hisi.c
ufs-hisi.h
ufs-mediatek-trace.h
ufs-mediatek.c
ufs-mediatek.h
ufs-qcom-ice.c
ufs-qcom.c scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW major version > 5 2024-06-16 13:40:01 +02:00
ufs-qcom.h scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW version major 5 2024-06-16 13:39:19 +02:00
ufs-sysfs.c
ufs-sysfs.h
ufs.h
ufs_bsg.c
ufs_bsg.h
ufs_quirks.h
ufshcd-crypto.c
ufshcd-crypto.h
ufshcd-dwc.c
ufshcd-dwc.h
ufshcd-pci.c scsi: ufs: ufs-pci: Add support for Intel Lunar Lake 2023-05-24 17:36:45 +01:00
ufshcd-pltfrm.c
ufshcd-pltfrm.h
ufshcd.c scsi: ufs: core: Fix hba->last_dme_cmd_tstamp timestamp updating logic 2024-08-19 05:45:44 +02:00
ufshcd.h scsi: ufs: core: Fix devfreq deadlocks 2023-02-01 08:27:26 +01:00
ufshci-dwc.h
ufshci.h
ufshpb.c
ufshpb.h
unipro.h