OpenCloudOS-Kernel/drivers/ufs/host
Andrew Halaney 872f68019b scsi: ufs: cdns-pltfrm: Perform read back after writing HCLKDIV
[ Upstream commit b715c55daf598aac8fa339048e4ca8a0916b332e ]

Currently, HCLKDIV is written to and then completed with an mb().

mb() ensures that the write completes, but completion doesn't mean that it
isn't stored in a buffer somewhere. The recommendation for ensuring this
bit has taken effect on the device is to perform a read back to force it to
make it all the way to the device. This is documented in device-io.rst and
a talk by Will Deacon on this can be seen over here:

    https://youtu.be/i6DayghhA8Q?si=MiyxB5cKJXSaoc01&t=1678

Let's do that to ensure the bit hits the device. Because the mb()'s purpose
wasn't to add extra ordering (on top of the ordering guaranteed by
writel()/readl()), it can safely be removed.

Fixes: d90996dae8 ("scsi: ufs: Add UFS platform driver for Cadence UFS")
Reviewed-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Signed-off-by: Andrew Halaney <ahalaney@redhat.com>
Link: https://lore.kernel.org/r/20240329-ufs-reset-ensure-effect-before-delay-v5-6-181252004586@redhat.com
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-12 11:11:39 +02: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
cdns-pltfrm.c scsi: ufs: cdns-pltfrm: Perform read back after writing HCLKDIV 2024-06-12 11:11:39 +02: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
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
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: Perform read back after writing CGC enable 2024-06-12 11:11:39 +02:00
ufs-qcom.h scsi: ufs: qcom: Perform read back after writing reset bit 2024-06-12 11:11:39 +02: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
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