Add UFS host controller support for NVIDIA Tegra264
v3 cover Add UFS host controller support for NVIDIA Tegra264
Add UFS host controller support for NVIDIA Tegra264 SoCs. The controller supports UFS 3.1 up to HS-G4B on two data lanes.
Changes in v3:
- Rework the Kconfig entry:
- Depend on ARCH_TEGRA instead of ARCH_TEGRA_264_SOC.
- Limit the driver to 64-bit architectures, not just compile testing, because ARCH_TEGRA also covers 32-bit SoCs and the high-speed link clock rate exceeds the range of unsigned long on 32-bit systems.
- Select GENERIC_PHY instead of PHY_TEGRA_MPHY, and drop the claimed dependency on the M-PHY series: the driver only uses the generic
PHY API.
- Drop the Tegra264 references from the prompt and help text.
- Drop the Tegra264 reference from the driver header.
- Use ufshcd_is_hs_mode() instead of checking hs_rate to decide when to program the high-speed link clock rate.
- Widen the DMA mask from 32 to 39 bits.
- Read back the auxiliary device-control register before the delays
that follow writes to it.
- Use the kernel multi-line comment style, and "hibern8" instead of
"H8".
- Link to v2: https://lore.kernel.org/r/[email protected]
Changes in v2:
- Rename the UFS functional clock to "core" and the host-consumed UPHY
PLL clock to "hs" in the binding and driver.
- Use raw M-PHY cell values in the binding example so it can be checked independently of the prerequisite series.
- Drop the unnecessary mod_devicetable.h include and clean up the OF
match table initializers.
- Limit compile testing to 64-bit architectures because the high-speed
link clock rate exceeds the range of unsigned long on 32-bit systems.
- Tear down the M-PHY lanes in reverse initialization order.
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Kartik Rajput (4):
dt-bindings: ufs: Add nvidia,tegra264-ufs
scsi: ufs: Add UIC DEBUGSAVECONFIGTIME attribute and its field masks
scsi: ufs: hisi: Use VS_DEBUGSAVECONFIGTIME instead of a literal address
scsi: ufs: tegra: Add Tegra264 UFS host controller driver
.../bindings/ufs/nvidia,tegra264-ufs.yaml | 120 ++++ drivers/ufs/host/Kconfig | 13 + drivers/ufs/host/Makefile | 1 + drivers/ufs/host/ufs-hisi.c | 6 +- drivers/ufs/host/ufs-tegra.c | 696 +++++++++++++++++++++ include/ufs/unipro.h | 6 + 6 files changed, 838 insertions(+), 4 deletions(-)
---
base-commit: a9c48428cbd8d96b26f92631d0db6f8519c5fcc5
change-id: 20260909-tegra264-ufs-92edda57c75a
Best regards,
Signature · 1 line
Kartik Rajput <[email protected]>
PATCH v3 1/4 dt-bindings: ufs: Add nvidia,tegra264-ufs
Add binding for the UFS host controller on NVIDIA Tegra264 SoCs. The controller supports UFS 3.1 up to HS-G4B on two data lanes.
--- .../bindings/ufs/nvidia,tegra264-ufs.yaml | 120 +++++++++++++++++++++ 1 file changed, 120 insertions(+)
Documentation/devicetree/bindings/ufs/nvidia,tegra264-ufs.yaml new file +120 -0
@@ -0,0 +1,120 @@ +# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/ufs/nvidia,tegra264-ufs.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NVIDIA Tegra264 UFS Host Controller + +maintainers: + - Kartik Rajput <[email protected]> + - Thierry Reding <[email protected]> + +properties: + compatible: + const: nvidia,tegra264-ufs + + reg: + items: + - description: UFS Host Controller registers + - description: UFS auxiliary registers + + reg-names: + items: + - const: ufs + - const: aux + + clocks: + items: + - description: UFS host controller core clock + - description: UFS host controller divider clock + - description: UFS reference clock (PLLREFUFS output) + - description: UFS device-side reference clock + - description: UFS high-speed link clock (UPHY0 PLL4 digital output) + + clock-names: + items: + - const: core + - const: div + - const: ref + - const: ref-dev + - const: hs + + resets: + items: + - description: UFS host controller reset + - description: UFS host controller AXI-master reset + - description: UFS host controller low-power sequencer reset + + reset-names: + items: + - const: ufs + - const: axi + - const: lp + + phys: + items: + - description: M-PHY lane 0 transmit + - description: M-PHY lane 0 receive + - description: M-PHY lane 1 transmit + - description: M-PHY lane 1 receive + + phy-names: + items: + - const: mphy-l0-tx + - const: mphy-l0-rx + - const: mphy-l1-tx + - const: mphy-l1-rx + + iommus: + maxItems: 1 + + dma-coherent: true + +required: + - compatible + - reg + - reg-names + - clocks + - clock-names + - resets + - reset-names + - phys + - phy-names + - iommus + - dma-coherent + +allOf: + - $ref: ufs-common.yaml + +unevaluatedProperties: false + +examples: + - | + #include <dt-bindings/clock/nvidia,tegra264.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/reset/nvidia,tegra264.h> + + ufs@b8d0000 { + compatible = "nvidia,tegra264-ufs"; + reg = <0xb8d0000 0x10000>, + <0xb8e0000 0x8000>; + reg-names = "ufs", "aux"; + interrupts = <GIC_SPI 951 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&bpmp TEGRA264_CLK_UFSHC_CG_SYS>, + <&bpmp TEGRA264_CLK_UFSHC_CG_SYS_DIV>, + <&bpmp TEGRA264_CLK_PLLREFUFS_CLKOUT624>, + <&bpmp TEGRA264_CLK_PLLREFUFS_UFSDEV_REFCLKOUT>, + <&bpmp TEGRA264_CLK_UPHY0_PLL4_XDIG>; + clock-names = "core", "div", "ref", "ref-dev", "hs"; + resets = <&bpmp TEGRA264_RESET_UFSHC>, + <&bpmp TEGRA264_RESET_UFSHC_AXI_M>, + <&bpmp TEGRA264_RESET_UFSHC_LP_SEQ>; + reset-names = "ufs", "axi", "lp"; + phys = <&mphy 0>, <&mphy 1>, <&mphy 2>, <&mphy 3>; + phy-names = "mphy-l0-tx", "mphy-l0-rx", + "mphy-l1-tx", "mphy-l1-rx"; + iommus = <&smmu 0x20>; + dma-coherent; + }; +...
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH v3 1/4] dt-bindings: ufs: Add nvidia,tegra264-ufs
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider: - [Low] dt-bindings: ufs: interrupts listed before clocks in example node --
Thank you for your contribution! Sashiko AI review found 1 potential issue to consider:
- [Low] dt-bindings: ufs: interrupts listed before clocks in example node
--
commit ba03cccc4a9efdc7b6ef7b9d0b43471ef317f03f
Author: Kartik Rajput <[email protected]>
dt-bindings: ufs: Add nvidia,tegra264-ufs
This commit adds the Device Tree binding schema for the UFS host controller on NVIDIA Tegra264 SoCs.
Quoted 6 lines
Documentation/devicetree/bindings/ufs/nvidia,tegra264-ufs.yaml new file +0
-0@@ -0,0 +1,120 @@
[ ... ]
Quoted 8 lines
Documentation/devicetree/bindings/ufs/nvidia,tegra264-ufs.yaml new file +8
-0+examples: + - | + #include <dt-bindings/clock/nvidia,tegra264.h> + #include <dt-bindings/interrupt-controller/arm-gic.h> + #include <dt-bindings/reset/nvidia,tegra264.h> + + ufs@b8d0000 { + compatible = "nvidia,tegra264-ufs";
Documentation/devicetree/bindings/ufs/nvidia,tegra264-ufs.yaml line 109
Quoted 10 lines
Documentation/devicetree/bindings/ufs/nvidia,tegra264-ufs.yaml new file +10
-0+ reg = <0xb8d0000 0x10000>, + <0xb8e0000 0x8000>; + reg-names = "ufs", "aux"; + interrupts = <GIC_SPI 951 IRQ_TYPE_LEVEL_HIGH>; + clocks = <&bpmp TEGRA264_CLK_UFSHC_CG_SYS>, + <&bpmp TEGRA264_CLK_UFSHC_CG_SYS_DIV>, + <&bpmp TEGRA264_CLK_PLLREFUFS_CLKOUT624>, + <&bpmp TEGRA264_CLK_PLLREFUFS_UFSDEV_REFCLKOUT>, + <&bpmp TEGRA264_CLK_UPHY0_PLL4_XDIG>; + clock-names = "core", "div", "ref", "ref-dev", "hs";
[Severity: Low]
This isn't a bug, but in the ufs@b8d0000 example node, should interrupts be placed after clock-names to follow canonical DT property ordering?
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
PATCH v3 2/4 scsi: ufs: Add UIC DEBUGSAVECONFIGTIME attribute and its field masks
In reply to Kartik RajputAdd the UniPro vendor-specific save-config-time attribute and masks for the two fields within it:
VS_DEBUGSAVECONFIGTIME Save-config-time attribute (0xD0A0) VS_DEBUGSAVECONFIGTIME_TREF Field masks within that attribute, for VS_DEBUGSAVECONFIGTIME_SCT use with FIELD_PREP()
ufs-hisi already writes this attribute by its literal address, so name it in the shared header rather than in the driver. Add it here in preparation for the Tegra264 UFS host controller driver, which also programs the two fields.
--- include/ufs/unipro.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/ufs/unipro.h +6 -0
@@ -6,6 +6,8 @@#ifndef _UNIPRO_H_#define _UNIPRO_H_ +#include <linux/bits.h> +/* * M-TX Configuration Attributes */
@@ -237,8 +239,12 @@#define VS_POWERSTATE 0xD083#define VS_MPHYCFGUPDT 0xD085#define VS_DEBUGOMC 0xD09E +#define VS_DEBUGSAVECONFIGTIME 0xD0A0#define VS_MPHYDISABLE 0xD0C1 +#define VS_DEBUGSAVECONFIGTIME_TREF GENMASK(4, 2) +#define VS_DEBUGSAVECONFIGTIME_SCT GENMASK(1, 0) +#define PA_GRANULARITY_MIN_VAL 1#define PA_GRANULARITY_MAX_VAL 6
Signature · 1 line
2.43.0
Re: [PATCH v3 2/4] scsi: ufs: Add UIC DEBUGSAVECONFIGTIME attribute and its field masks
Re: [PATCH v3 2/4] scsi: ufs: Add UIC DEBUGSAVECONFIGTIME attribute and its field masks
In reply to Kartik RajputQuoted 6 lines · Kartik Rajput
Add the UniPro vendor-specific save-config-time attribute and masks for the two fields within it:
VS_DEBUGSAVECONFIGTIME Save-config-time attribute (
0xD0A0) VS_DEBUGSAVECONFIGTIME_TREF Field masks within that attribute, for VS_DEBUGSAVECONFIGTIME_SCT use withFIELD_PREP()
could you please explain what each field is, provide more info for these two:
for example:
VS_DEBUGSAVECONFIGTIME_TREF bits [4:2], <what this field means>
VS_DEBUGSAVECONFIGTIME_SCT bits [1:0], <what this field means>
kind regards,
Bean
PATCH v3 3/4 scsi: ufs: hisi: Use VS_DEBUGSAVECONFIGTIME instead of a literal address
In reply to Kartik Rajputufs-hisi writes the VS_DebugSaveConfigTime UIC attribute twice by its literal address, with a comment naming it each time. The attribute now has a name in the shared UniPro header, so use it and drop the comments and the redundant (u32) cast.
No functional change.
--- drivers/ufs/host/ufs-hisi.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/ufs/host/ufs-hisi.c +2 -4
@@ -318,8 +318,7 @@ static void ufs_hisi_pwr_change_pre_change(struct ufs_hba *hba)* Boston platform need to set SaveConfigTime to 0x13, * and change sync length to maximum value */ -/* VS_DebugSaveConfigTime */ -ufshcd_dme_set (hba,UIC_ARG_MIB ((u32 )0xD0A0 ),0x13 ); +ufshcd_dme_set (hba,UIC_ARG_MIB (VS_DEBUGSAVECONFIGTIME ),0x13 );/* g1 sync length */ ufshcd_dme_set (hba,UIC_ARG_MIB ((u32 )0x1552 ),0x4f );/* g2 sync length */
@@ -335,8 +334,7 @@ static void ufs_hisi_pwr_change_pre_change(struct ufs_hba *hba)if (hba->dev_quirks &UFS_DEVICE_QUIRK_HOST_VS_DEBUGSAVECONFIGTIME ) {pr_info ("ufs flash device must set VS_DebugSaveConfigTime 0x10\n" ); -/* VS_DebugSaveConfigTime */ -ufshcd_dme_set (hba,UIC_ARG_MIB (0xD0A0 ),0x10 ); +ufshcd_dme_set (hba,UIC_ARG_MIB (VS_DEBUGSAVECONFIGTIME ),0x10 );/* sync length */ ufshcd_dme_set (hba,UIC_ARG_MIB (0x1556 ),0x48 ); }
Signature · 1 line
2.43.0
PATCH v3 4/4 scsi: ufs: tegra: Add Tegra264 UFS host controller driver
In reply to Kartik RajputAdd a driver for the UFS host controller found on NVIDIA Tegra264 SoCs. The controller has Tegra-specific auxiliary registers, clocks and resets, and it drives the four M-PHY lane directions exposed by the Tegra264 M-PHY driver.
--- drivers/ufs/host/Kconfig | 13 + drivers/ufs/host/Makefile | 1 + drivers/ufs/host/ufs-tegra.c | 696 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 710 insertions(+)
drivers/ufs/host/Kconfig +13 -0
@@ -181,3 +181,16 @@ config SCSI_UFS_STARFIVE Select this if you have UFS controller on StarFive chipset. If unsure, say N. + +config SCSI_UFS_TEGRA + tristate "NVIDIA Tegra UFS controller platform driver" + depends on SCSI_UFSHCD_PLATFORM + depends on ARCH_TEGRA || COMPILE_TEST + depends on 64BIT + select GENERIC_PHY + help + Enable support for the UFS host controller on NVIDIA Tegra SoCs. + The driver implements the vendor register programming required + for HS-mode transitions and system suspend/resume. + + If unsure, say N.
drivers/ufs/host/Makefile +1 -0
@@ -14,6 +14,7 @@ obj-$(CONFIG_SCSI_UFS_MEDIATEK) += ufs-mediatek.o obj-$(CONFIG_SCSI_UFS_RENESAS) += ufs-renesas.o obj-$(CONFIG_SCSI_UFS_ROCKCHIP) += ufs-rockchip.o obj-$(CONFIG_SCSI_UFS_SPRD) += ufs-sprd.o +obj-$(CONFIG_SCSI_UFS_TEGRA) += ufs-tegra.o ufshcd-dwc.o obj-$(CONFIG_SCSI_UFS_TI_J721E) += ti-j721e-ufs.o obj-$(CONFIG_SCSI_UFS_AMD_VERSAL2) += ufs-amd-versal2.o ufshcd-dwc.o obj-$(CONFIG_SCSI_UFS_STARFIVE) += ufs-starfive.o ufshcd-dwc.o
drivers/ufs/host/ufs-tegra.c new file +696 -0
696 lines not on this page · raw message
Signature · 1 line
2.43.0
[email protected]
AI reviewRe: [PATCH v3 4/4] scsi: ufs: tegra: Add Tegra264 UFS host controller driver
Thank you for your contribution! Sashiko AI review found 4 potential issues to consider: - [High] scsi: ufs: tegra: probe fails with -ENODEV in ufs_tegra_parse_clock_info() - [High] scsi: ufs…
Thank you for your contribution! Sashiko AI review found 4 potential issues to consider:
- [High] scsi: ufs: tegra: probe fails with -ENODEV in ufs_tegra_parse_clock_info()
- [High] scsi: ufs: tegra: missing prepare and complete callbacks in ufs_tegra_pm_ops
- [Medium] scsi: ufs: tegra: missing device_reset op leaves WriteBooster state stale
- [Medium] scsi: ufs: tegra: missing reset assertion and aux cleanup in ufs_tegra_exit()
--
commit 9955cb7a8be25d99221a19b3ca6c4dc209b70aaf
Author: Kartik Rajput <[email protected]>
scsi: ufs: tegra: Add Tegra264 UFS host controller driver
This commit adds a platform driver for the UFS host controller on NVIDIA Tegra264 SoCs, handling Tegra-specific auxiliary registers, clocks, resets, and M-PHY lane operations.
Quoted 6 lines
drivers/ufs/host/ufs-tegra.c new file +0
-0@@ -0,0 +1,696 @@
[ ... ]
Quoted 8 lines
drivers/ufs/host/ufs-tegra.c new file +8
-0+static int ufs_tegra_parse_clock_info (struct ufs_hba *hba) +{ +struct ufs_tegra *ufs =ufshcd_get_variant (hba); +struct ufs_clk_info *clki; + +list_for_each_entry (clki, &hba->clk_list_head, list) { +if (!strcmp (clki->name,"core" )) + ufs->core_clk = clki->clk;
drivers/ufs/host/ufs-tegra.c line 120
Quoted 10 lines
drivers/ufs/host/ufs-tegra.c new file +10
-0+ +if (!strcmp (clki->name,"hs" )) + ufs->hs_clk = clki->clk; + } + +if (!ufs->core_clk || !ufs->hs_clk) +return -ENODEV ; + +return 0 ; +}
[Severity: High]
Does ufs_tegra_parse_clock_info() always fail probe with -ENODEV on a Device Tree node matching Documentation/devicetree/bindings/ufs/nvidia,tegra264-ufs.yaml?
In drivers/ufs/host/ufshcd-pltfrm.c, ufshcd_parse_clock_info() returns early without populating hba->clk_list_head unless the node specifies freq-table-hz, and ufshcd_parse_operating_points() does the same unless operating-points-v2 is present. Neither property is defined in the Tegra264 UFS binding (and UFS_TEGRA_HS_CLK_RATE_HZ at 5840000000UL does not fit in a 32-bit freq-table-hz cell or u32 clki->max_freq), so hba->clk_list_head stays empty, the controller clocks are never acquired or enabled by UFSHCD, and ufs->core_clk and ufs->hs_clk remain NULL.
[ ... ]
Quoted 2 lines
drivers/ufs/host/ufs-tegra.c new file +2
-0+static int ufs_tegra_init (struct ufs_hba *hba) +{
[ ... ]
Quoted 9 lines
drivers/ufs/host/ufs-tegra.c new file +9
-0+ err =reset_control_bulk_deassert (ufs->num_resets, ufs->resets); +if (err) +return err; + +ufs_tegra_aux_init (hba); +ufs_tegra_update_hclk_div (hba); + +return 0 ; +}
[ ... ]
drivers/ufs/host/ufs-tegra.c line 431
Quoted 4 lines
drivers/ufs/host/ufs-tegra.c new file +4
-0+static void ufs_tegra_exit (struct ufs_hba *hba) +{ +ufs_tegra_mphy_disable (hba); +}
[Severity: Medium]
Should ufs_tegra_exit() also clear DEV_CTRL_CLK_EN | DEV_CTRL_RESET in UFSHC_AUX_DEV_CTRL and assert ufs->resets?
ufs_tegra_init() deasserts the exclusive bulk resets and enables the auxiliary device clock and reset line via ufs_tegra_aux_init(). When ufshcd_init() fails after ufshcd_hba_init() or the driver is unbound, ufshcd_hba_exit() calls ufs_tegra_exit() and then turns off the clocks and regulators while UFSHC_AUX_DEV_CTRL remains enabled and the controller resets remain deasserted.
[ ... ]
Quoted 33 lines
drivers/ufs/host/ufs-tegra.c new file +33
-0+static int ufs_tegra_hce_enable_notify (struct ufs_hba *hba,enum ufs_notify_change_status status) +{ +struct ufs_tegra *ufs =ufshcd_get_variant (hba); +u32 value; +int err; + +switch (status) { +case PRE_CHANGE : + err =ufs_tegra_power_up_sequence (hba); +if (err) +return err; + +/* +* Assert device reset; POST_CHANGE releases it via +* ufs_tegra_configure_aux() so the HCE toggle pulses it. +*/ + value =readl (ufs->aux +UFSHC_AUX_DEV_CTRL ); + value &= ~DEV_CTRL_RESET ; +writel (value, ufs->aux +UFSHC_AUX_DEV_CTRL ); +break ; +case POST_CHANGE : + value =readl (ufs->aux +UFSHC_AUX_SW_EN_CLK_SLCG ); + value &= ~CLK_OVR_ON ; +writel (value, ufs->aux +UFSHC_AUX_SW_EN_CLK_SLCG ); + +ufs_tegra_setup (hba); +break ; +default : +return -EINVAL ; + } + +return 0 ; +}
[ ... ]
drivers/ufs/host/ufs-tegra.c line 652
Quoted 12 lines
drivers/ufs/host/ufs-tegra.c new file +12
-0+static const struct ufs_hba_variant_ops ufs_tegra_vops = { + .name ="ufs-tegra" , + .init = ufs_tegra_init, + .exit = ufs_tegra_exit, + .suspend = ufs_tegra_suspend, + .resume = ufs_tegra_resume, + .hce_enable_notify = ufs_tegra_hce_enable_notify, + .negotiate_pwr_mode = ufs_tegra_negotiate_pwr_mode, + .pwr_change_notify = ufs_tegra_pwr_change_notify, + .link_startup_notify = ufs_tegra_link_startup_notify, + .set_dma_mask = ufs_tegra_set_dma_mask, +};
[Severity: Medium]
Does pulsing DEV_CTRL_RESET in ufs_tegra_hce_enable_notify() without implementing .device_reset in ufs_tegra_vops leave WriteBooster disabled after system resume or host error recovery?
ufs_tegra_set_caps() enables UFSHCD_CAP_WB_EN and sets hba->spm_lvl to UFS_PM_LVL_5. On resume from UFS_PM_LVL_5 (or during error recovery), ufshcd_reset_and_restore() calls ufshcd_device_reset(), which only clears hba->dev_info.wb_enabled and hba->dev_info.wb_buf_flush_enabled and marks the device active when vops->device_reset is implemented:
drivers/ufs/core/ufshcd.c:ufshcd_device_reset() {
...
err = ufshcd_vops_device_reset(hba);
if (!err) {
ufshcd_set_ufs_dev_active(hba);
if (ufshcd_is_wb_allowed(hba)) {
hba->dev_info.wb_enabled = false;
hba->dev_info.wb_buf_flush_enabled = false;
}
...
}Because ufs_tegra_hce_enable_notify() then hardware-resets the UFS device via DEV_CTRL_RESET, the volatile WriteBooster flags on the device are cleared while hba->dev_info.wb_enabled stays true in software, causing ufshcd_wb_toggle() to return early without re-enabling WriteBooster. Leaving hba->curr_dev_pwr_mode at UFS_POWERDOWN_PWR_MODE also makes ufshcd_link_startup() set link_startup_again = true and run link startup twice.
[ ... ]
drivers/ufs/host/ufs-tegra.c line 674
Quoted 4 lines
drivers/ufs/host/ufs-tegra.c new file +4
-0+static const struct dev_pm_ops ufs_tegra_pm_ops = { + SET_SYSTEM_SLEEP_PM_OPS(ufshcd_system_suspend, ufshcd_system_resume) +SET_RUNTIME_PM_OPS (ufshcd_runtime_suspend, ufshcd_runtime_resume,NULL ) +};
[Severity: High]
Does omitting .prepare = ufshcd_suspend_prepare and .complete = ufshcd_resume_complete from ufs_tegra_pm_ops break system suspend when the controller is already runtime-suspended?
ufs_tegra_set_caps() sets hba->spm_lvl = UFS_PM_LVL_5 (UIC_LINK_OFF_STATE) while hba->rpm_lvl stays at the default UFS_PM_LVL_3 (UIC_LINK_HIBERN8_STATE), where ufs_tegra_suspend() leaves the M-PHY powered on during runtime suspend. When the UFS device W-LUN is already runtime-suspended, ufshcd_wl_system_suspend() and ufshcd_system_suspend() both return early without running __ufshcd_wl_suspend(hba, UFS_SYSTEM_PM) unless ufshcd_suspend_prepare() first runtime-resumes the W-LUN because rpm_lvl and spm_lvl differ. As a result, ufs_tegra_suspend() is never called for UFS_SYSTEM_PM, the M-PHY stays powered on during system sleep, and hba->uic_link_state remains UIC_LINK_HIBERN8_STATE instead of UIC_LINK_OFF_STATE.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=4