linux/drivers/ufs/core
Vamshi Gajjela ab9fd06cb8 scsi: ufs: core: Fix hba->last_dme_cmd_tstamp timestamp updating logic
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>
2024-08-01 21:59:00 -04:00
..
Kconfig scsi: ufs: core: Remove HPB support 2023-07-23 16:40:39 -04:00
Makefile scsi: ufs: core: Remove HPB support 2023-07-23 16:40:39 -04:00
ufs_bsg.c scsi: bsg: Pass queue_limits to bsg_setup_queue() 2024-04-11 21:37:48 -04:00
ufs_bsg.h
ufs-debugfs.c
ufs-debugfs.h
ufs-fault-injection.c scsi: ufs: core: Make fault injection dynamically configurable per HBA 2023-11-24 19:23:35 -05:00
ufs-fault-injection.h scsi: ufs: core: Make fault injection dynamically configurable per HBA 2023-11-24 19:23:35 -05:00
ufs-hwmon.c scsi: ufs: Rename a function argument 2023-07-31 15:17:50 -04:00
ufs-mcq.c Merge patch series "UFS patches for kernel 6.11" 2024-07-10 22:26:08 -04:00
ufs-sysfs.c scsi: ufs: sysfs: Make max_number_of_rtt read-write 2024-05-30 20:34:38 -04:00
ufs-sysfs.h
ufshcd-crypto.c scsi: ufs: core: Add UFSHCD_QUIRK_BROKEN_CRYPTO_ENABLE 2024-07-10 22:32:30 -04:00
ufshcd-crypto.h scsi: ufs: core: Add UFSHCD_QUIRK_KEYS_IN_PRDT 2024-07-10 22:32:30 -04:00
ufshcd-priv.h scsi: ufs: core: Fix deadlock during RTC update 2024-07-15 22:57:16 -04:00
ufshcd.c scsi: ufs: core: Fix hba->last_dme_cmd_tstamp timestamp updating logic 2024-08-01 21:59:00 -04:00