ufs-exynos driver enables the shareability option for gs101 which means the descriptors need to be allocated as cacheable.
Fix the DT node and update bindings to add the dma-coherent property.
This fixes the UFS stability issues we have seen with the upstream UFS driver.
Note this DT fix can go in independently of the other UFS fixes series I sent recently [1], as the bootloader already leaves the sharability bits enabled.
regards,
Peter
[1] https://lore.kernel.org/linux-scsi/20250226220414.343659-1-peter.griffin@lin...
To: André Draszik andre.draszik@linaro.org To: Tudor Ambarus tudor.ambarus@linaro.org To: Rob Herring robh@kernel.org To: Krzysztof Kozlowski krzk+dt@kernel.org To: Conor Dooley conor+dt@kernel.org To: Alim Akhtar alim.akhtar@samsung.com To: Avri Altman avri.altman@wdc.com To: Bart Van Assche bvanassche@acm.org To: Martin K. Petersen martin.petersen@oracle.com Cc: Krzysztof Kozlowski krzysztof.kozlowski@linaro.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Cc: devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-scsi@vger.kernel.org Cc: kernel-team@android.com Cc: willmcvicker@google.com
Signed-off-by: Peter Griffin peter.griffin@linaro.org --- Peter Griffin (2): arm64: dts: exynos: gs101: ufs: add dma-coherent property scsi: ufs: dt-bindings: exynos: add dma-coherent property for gs101
Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml | 2 ++ arch/arm64/boot/dts/exynos/google/gs101.dtsi | 1 + 2 files changed, 3 insertions(+) --- base-commit: b323d8e7bc03d27dec646bfdccb7d1a92411f189 change-id: 20250314-ufs-dma-coherent-980f2467690d
Best regards,
ufs-exynos driver configures the sysreg shareability as cacheable for gs101 so we need to set the dma-coherent property so the descriptors are also allocated cacheable.
This fixes the UFS stability issues we have seen with the upstream UFS driver on gs101.
Fixes: 4c65d7054b4c ("arm64: dts: exynos: gs101: Add ufs and ufs-phy dt nodes") Cc: stable@vger.kernel.org Suggested-by: Will McVicker willmcvicker@google.com Signed-off-by: Peter Griffin peter.griffin@linaro.org --- arch/arm64/boot/dts/exynos/google/gs101.dtsi | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/exynos/google/gs101.dtsi b/arch/arm64/boot/dts/exynos/google/gs101.dtsi index c5335dd59dfe9fcf8c64d66a466799600f8447b0..cf30128ef004568f01b1c7150c5585ba267d64bc 100644 --- a/arch/arm64/boot/dts/exynos/google/gs101.dtsi +++ b/arch/arm64/boot/dts/exynos/google/gs101.dtsi @@ -1360,6 +1360,7 @@ ufs_0: ufs@14700000 { <&cmu_hsi2 CLK_GOUT_HSI2_SYSREG_HSI2_PCLK>; clock-names = "core_clk", "sclk_unipro_main", "fmp", "aclk", "pclk", "sysreg"; + dma-coherent; freq-table-hz = <0 0>, <0 0>, <0 0>, <0 0>, <0 0>, <0 0>; pinctrl-0 = <&ufs_rst_n &ufs_refclk_out>; pinctrl-names = "default";
On Fri, 2025-03-14 at 15:38 +0000, Peter Griffin wrote:
ufs-exynos driver configures the sysreg shareability as cacheable for gs101 so we need to set the dma-coherent property so the descriptors are also allocated cacheable.
This fixes the UFS stability issues we have seen with the upstream UFS driver on gs101.
Fixes: 4c65d7054b4c ("arm64: dts: exynos: gs101: Add ufs and ufs-phy dt nodes") Cc: stable@vger.kernel.org Suggested-by: Will McVicker willmcvicker@google.com Signed-off-by: Peter Griffin peter.griffin@linaro.org
Tested-by: André Draszik andre.draszik@linaro.org Reviewed-by: André Draszik andre.draszik@linaro.org
On 03/14/2025, Peter Griffin wrote:
ufs-exynos driver configures the sysreg shareability as cacheable for gs101 so we need to set the dma-coherent property so the descriptors are also allocated cacheable.
This fixes the UFS stability issues we have seen with the upstream UFS driver on gs101.
Fixes: 4c65d7054b4c ("arm64: dts: exynos: gs101: Add ufs and ufs-phy dt nodes") Cc: stable@vger.kernel.org Suggested-by: Will McVicker willmcvicker@google.com Signed-off-by: Peter Griffin peter.griffin@linaro.org
Tested-by: Will McVicker willmcvicker@google.com
Verified I can properly boot to Android recovery with UFS probing and mounting the partitions in the fstab.
Can you send this to 6.12 stable as well since this is fixing booting issues with Android?
Thanks, Will
arch/arm64/boot/dts/exynos/google/gs101.dtsi | 1 + 1 file changed, 1 insertion(+)
diff --git a/arch/arm64/boot/dts/exynos/google/gs101.dtsi b/arch/arm64/boot/dts/exynos/google/gs101.dtsi index c5335dd59dfe9fcf8c64d66a466799600f8447b0..cf30128ef004568f01b1c7150c5585ba267d64bc 100644 --- a/arch/arm64/boot/dts/exynos/google/gs101.dtsi +++ b/arch/arm64/boot/dts/exynos/google/gs101.dtsi @@ -1360,6 +1360,7 @@ ufs_0: ufs@14700000 { <&cmu_hsi2 CLK_GOUT_HSI2_SYSREG_HSI2_PCLK>; clock-names = "core_clk", "sclk_unipro_main", "fmp", "aclk", "pclk", "sysreg";
dma-coherent; freq-table-hz = <0 0>, <0 0>, <0 0>, <0 0>, <0 0>, <0 0>; pinctrl-0 = <&ufs_rst_n &ufs_refclk_out>; pinctrl-names = "default";
-- 2.49.0.rc1.451.g8f38331e32-goog
dma-coherent property is required for gs101 as ufs-exynos enables sharability.
Fixes: 438e23b61cd4 ("scsi: ufs: dt-bindings: exynos: Add gs101 compatible") Cc: stable@vger.kernel.org Signed-off-by: Peter Griffin peter.griffin@linaro.org --- Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml b/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml index 720879820f6616a30cae2db3d4d2d22e847666c4..5dbb7f6a8c354b82685c521e70655e106f702a8d 100644 --- a/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml @@ -96,6 +96,8 @@ allOf: clock-names: minItems: 6
+ dma-coherent: true + else: properties: clocks:
Hi Pete,
On Fri, 2025-03-14 at 15:38 +0000, Peter Griffin wrote:
dma-coherent property is required for gs101 as ufs-exynos enables sharability.
Fixes: 438e23b61cd4 ("scsi: ufs: dt-bindings: exynos: Add gs101 compatible") Cc: stable@vger.kernel.org Signed-off-by: Peter Griffin peter.griffin@linaro.org
Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml b/Documentation/devicetree/bindings/ufs/samsung,exynos- ufs.yaml index 720879820f6616a30cae2db3d4d2d22e847666c4..5dbb7f6a8c354b82685c521e70655e106f702a8d 100644 --- a/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml @@ -96,6 +96,8 @@ allOf: clock-names: minItems: 6 + dma-coherent: true
This is allowed globally already in this file. Did you meant to make it 'required'?
Cheers, Andre'
else: properties: clocks:
Hi André
On Fri, 14 Mar 2025 at 15:59, André Draszik andre.draszik@linaro.org wrote:
Hi Pete,
On Fri, 2025-03-14 at 15:38 +0000, Peter Griffin wrote:
dma-coherent property is required for gs101 as ufs-exynos enables sharability.
Fixes: 438e23b61cd4 ("scsi: ufs: dt-bindings: exynos: Add gs101 compatible") Cc: stable@vger.kernel.org Signed-off-by: Peter Griffin peter.griffin@linaro.org
Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml b/Documentation/devicetree/bindings/ufs/samsung,exynos- ufs.yaml index 720879820f6616a30cae2db3d4d2d22e847666c4..5dbb7f6a8c354b82685c521e70655e106f702a8d 100644 --- a/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml +++ b/Documentation/devicetree/bindings/ufs/samsung,exynos-ufs.yaml @@ -96,6 +96,8 @@ allOf: clock-names: minItems: 6
dma-coherent: true
This is allowed globally already in this file. Did you meant to make it 'required'?
I hadn't noticed it was already handled further up in the yaml. In which case this patch can be dropped entirely.
Thanks,
Peter
On Fri, Mar 14, 2025 at 03:38:03PM +0000, Peter Griffin wrote:
dma-coherent property is required for gs101 as ufs-exynos enables sharability.
Fixes: 438e23b61cd4 ("scsi: ufs: dt-bindings: exynos: Add gs101 compatible") Cc: stable@vger.kernel.org
This change is a noop and fixes nothing, which you can test by testing your DTS without and with this patch.
Best regards, Krzysztof
On 3/14/25 8:38 AM, Peter Griffin wrote:
ufs-exynos driver enables the shareability option for gs101 which means the descriptors need to be allocated as cacheable.
Shouldn't that code be modified such that the shareability option is only set if the dma-coherent property is present in the device tree?
Thanks,
Bart.
On 03/14/2025, Bart Van Assche wrote:
On 3/14/25 8:38 AM, Peter Griffin wrote:
ufs-exynos driver enables the shareability option for gs101 which means the descriptors need to be allocated as cacheable.
Shouldn't that code be modified such that the shareability option is only set if the dma-coherent property is present in the device tree?
That's what we do downstream and would fix any issues when booting with an older DT that doesn't have the `dma-coherent` property set. So I agree that would be a worthy fix (which I did verify fixes the stability issues).
Regards, Will
Thanks,
Bart.
Hi Bart,
Thanks for the review.
On Fri, 14 Mar 2025 at 16:01, Bart Van Assche bvanassche@acm.org wrote:
On 3/14/25 8:38 AM, Peter Griffin wrote:
ufs-exynos driver enables the shareability option for gs101 which means the descriptors need to be allocated as cacheable.
Shouldn't that code be modified such that the shareability option is only set if the dma-coherent property is present in the device tree?
Yes, I plan to add an extra patch that does what you describe into the v2 of the UFS fixes series [1] likely later today.
I sent this out separately for Krzysztof's Exynos DT tree in the hope he will pick it up in the next -rc as this patch fixes how the driver is configured today, and is also still the configuration we want once the driver changes land. I should have made that a bit clearer in the cover letter :)
Thanks,
Peter
[1] https://lore.kernel.org/linux-scsi/20250226220414.343659-1-peter.griffin@lin...
linux-stable-mirror@lists.linaro.org