linux/drivers/ufs/host
Manivannan Sadhasivam 98b3777034 scsi: ufs: qcom: Update PHY settings only when scaling to higher gears
commit fc88ca19ad upstream.

The "hs_gear" variable is used to program the PHY settings (submode) during
ufs_qcom_power_up_sequence(). Currently, it is being updated every time the
agreed gear changes. Due to this, if the gear got downscaled before suspend
(runtime/system), then while resuming, the PHY settings for the lower gear
will be applied first and later when scaling to max gear with REINIT, the
PHY settings for the max gear will be applied.

This adds a latency while resuming and also really not needed as the PHY
gear settings are backwards compatible i.e., we can continue using the PHY
settings for max gear with lower gear speed.

So let's update the "hs_gear" variable _only_ when the agreed gear is
greater than the current one. This guarantees that the PHY settings will be
changed only during probe time and fatal error condition.

Due to this, UFSHCD_QUIRK_REINIT_AFTER_MAX_GEAR_SWITCH can now be skipped
when the PM operation is in progress.

Cc: stable@vger.kernel.org
Fixes: 96a7141da3 ("scsi: ufs: core: Add support for reinitializing the UFS device")
Reported-by: Can Guo <quic_cang@quicinc.com>
Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Link: https://lore.kernel.org/r/20230908145329.154024-1-manivannan.sadhasivam@linaro.org
Reviewed-by: Can Guo <quic_cang@quicinc.com>
Tested-by: Can Guo <quic_cang@quicinc.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2023-11-28 17:19:55 +00:00
..
cdns-pltfrm.c scsi: ufs: Fix kernel-doc headers 2023-07-31 15:17:50 -04:00
Kconfig scsi: ufs: ufs-mediatek: Add dependency for RESET_CONTROLLER 2023-07-05 21:40:53 -04:00
Makefile scsi: ufs: ufs-qcom: Switch to the new ICE API 2023-06-16 12:04:31 -04:00
tc-dwc-g210-pci.c scsi: ufs: Follow the kernel-doc syntax for documenting return values 2023-07-31 15:17:50 -04:00
tc-dwc-g210-pltfrm.c scsi: ufs: core: Simplify driver shutdown 2023-05-31 20:35:01 -04:00
tc-dwc-g210.c scsi: ufs: Fix kernel-doc headers 2023-07-31 15:17:50 -04:00
tc-dwc-g210.h scsi: ufs: Split the drivers/scsi/ufs directory 2022-05-19 20:27:37 -04:00
ti-j721e-ufs.c scsi: ufs: ti-j721e: Expose device tree aliases 2023-07-23 15:12:26 -04:00
ufs-exynos.c Merge patch series "UFS host controller driver patches" 2023-05-31 20:35:48 -04:00
ufs-exynos.h scsi: ufs: host: ufs-exynos: Add support for FSD UFS HCI 2022-06-13 21:57:33 -04:00
ufs-hisi.c Merge patch series "UFS host controller driver patches" 2023-05-31 20:35:48 -04:00
ufs-hisi.h scsi: ufs: Split the drivers/scsi/ufs directory 2022-05-19 20:27:37 -04:00
ufs-mediatek-trace.h scsi: ufs: ufs-mediatek: Support clk-scaling to optimize power consumption 2022-08-22 22:58:30 -04:00
ufs-mediatek.c scsi: ufs: Follow the kernel-doc syntax for documenting return values 2023-07-31 15:17:50 -04:00
ufs-mediatek.h scsi: ufs: ufs-mediatek: Add MCQ support for MTK platform 2023-07-11 15:00:04 -04:00
ufs-qcom.c scsi: ufs: qcom: Update PHY settings only when scaling to higher gears 2023-11-28 17:19:55 +00:00
ufs-qcom.h scsi: ufs: qcom: Add support for scaling interconnects 2023-07-31 14:47:11 -04:00
ufs-renesas.c Merge branch 'fixes' into misc 2023-09-02 08:25:19 +01:00
ufs-sprd.c scsi: ufs: core: Simplify driver shutdown 2023-05-31 20:35:01 -04:00
ufs-sprd.h scsi: ufs: ufs-unisoc: Add support for Unisoc UFS host controller 2023-01-11 21:17:18 -05:00
ufshcd-dwc.c scsi: ufs: Fix kernel-doc headers 2023-07-31 15:17:50 -04:00
ufshcd-dwc.h scsi: ufs: Split the drivers/scsi/ufs directory 2022-05-19 20:27:37 -04:00
ufshcd-pci.c scsi: ufs: ufs-pci: Add support for QEMU 2023-08-07 22:39:00 -04:00
ufshcd-pltfrm.c scsi: ufs: host: Convert to dev_err_probe() in ufshcd_pltfrm_init() 2023-08-21 16:45:14 -04:00
ufshcd-pltfrm.h scsi: ufs: core: Simplify driver shutdown 2023-05-31 20:35:01 -04:00
ufshci-dwc.h scsi: ufs: Split the drivers/scsi/ufs directory 2022-05-19 20:27:37 -04:00