From 8c6e049228018e986e3b30556296b49d3a48d344 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 9 Nov 2026 09:00:51 -0643 Subject: [PATCH 1/2] scsi: ufs: exynos: re-apply the UFS pin state when resuming with the link down On the Pixel 9a (zumapro) the UFS pads, gph5-0 (the device's reference clock) and gph5-1 (its reset), came back from a system suspend as plain inputs (CON 0) on about one wake in a hundred. The device then gets no clock and no reset, the host reports no device present through every link startup (HCS 0x8, no DP), and the resume fails with the root filesystem read-only until a reboot reprograms the pads. No host-side retry reaches a device whose pads are disconnected: a host reset, a longer reset pulse, a PHY power cycle, waits of up to 1.6 s between tries and a real VCC power cycle were each tried and each failed the same way. pinctrl-samsung's own save and restore of the bank is not enough here: its restore wrote the pads' CON back as 0x22 at every wake, and on the failing wakes the pads still read as inputs afterwards, so whatever takes their function away does it after that restore. Select the UFS node's pin state again in the resume callback whenever the link is down (hibern8 included, so at rpm_lvl 3 every runtime resume does it too), once the host's clocks are on. The node needs a "sleep" pin state for this, selected in the suspend callback, because pinctrl_select_state() is a no-op for an unchanged state; the zumapro device tree gets it in the next commit. With this change 300 RTC-woken s2idle cycles completed on a Pixel 9a, on the integration tree with the cores kept out of C2 for the sleep, with no storage failure (2026-11-07/08); before it one wake in 15 to 215 lost the storage. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com> --- drivers/ufs/host/ufs-exynos.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/ufs/host/ufs-exynos.c b/drivers/ufs/host/ufs-exynos.c index 4eadca2fe3..49d0ce212a 100644 --- a/drivers/ufs/host/ufs-exynos.c +++ b/drivers/ufs/host/ufs-exynos.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -1886,8 +1887,10 @@ static int exynos_ufs_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op, if (ufs->drv_data->suspend) ufs->drv_data->suspend(ufs); - if (!ufshcd_is_link_active(hba)) + if (!ufshcd_is_link_active(hba)) { phy_power_off(ufs->phy); + pinctrl_pm_select_sleep_state(hba->dev); + } return 0; } @@ -1896,8 +1899,19 @@ static int exynos_ufs_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op) { struct exynos_ufs *ufs = ufshcd_get_variant(hba); - if (!ufshcd_is_link_active(hba)) + if (!ufshcd_is_link_active(hba)) { + /* + * On zumapro the UFS pads (the device's reference clock and + * reset) came back from a system suspend as plain inputs on + * about one wake in a hundred, and the host then saw no device + * however often it reset it. Select the pin state again now + * that the link is down and the host's clocks are on (at + * rpm_lvl 3 this runs on every runtime resume too); the + * "sleep" state exists so the default is really written again. + */ + pinctrl_pm_select_default_state(hba->dev); phy_power_on(ufs->phy); + } exynos_ufs_config_smu(ufs); exynos_ufs_fmp_resume(hba); From 73016ba94ac831fb9fd32f83b3ca9ef5f337ccd7 Mon Sep 17 00:00:00 2001 From: W4HO <87742609+W4HO-ham@users.noreply.github.com> Date: Mon, 9 Nov 2026 09:00:51 -0643 Subject: [PATCH 2/2] arm64: dts: exynos: google: zumapro: give the UFS node a sleep pin state The UFS host re-applies its pin state when it resumes with the link down, so that the pads come back as the UFS function after a system suspend (on the Pixel 9a they read as plain inputs on about one wake in a hundred). pinctrl_select_state() does nothing for an unchanged state, so the node needs a second state to switch away to: the "sleep" state names the same pin groups as the default. Signed-off-by: W4HO <87742609+W4HO-ham@users.noreply.github.com> --- arch/arm64/boot/dts/exynos/google/zumapro.dtsi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/exynos/google/zumapro.dtsi b/arch/arm64/boot/dts/exynos/google/zumapro.dtsi index f8be1721dd..671580dbde 100644 --- a/arch/arm64/boot/dts/exynos/google/zumapro.dtsi +++ b/arch/arm64/boot/dts/exynos/google/zumapro.dtsi @@ -1232,8 +1232,9 @@ phys = <&ufs_phy>; phy-names = "ufs-phy"; samsung,sysreg = <&sysreg_ufs 0x710>; - pinctrl-names = "default"; + pinctrl-names = "default", "sleep"; pinctrl-0 = <&ufs_reset>, <&ufs_refclk>; + pinctrl-1 = <&ufs_reset>, <&ufs_refclk>; lanes-per-direction = <2>; dma-coherent; status = "disabled";