ufshcd_dme_c...e_power_mode(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’…πŸ’– ufshcd_dme_change_power_mode β€” NAME

Okay so bestie, welcome to the Kernel API Manual (section 9, we're fancy here) πŸŽ€ β€” this one is ufshcd_dme_change_power_mode, aka the UniPro DME Power Mode change sequence ✨. Like, it's the function that literally walks the UFS link into a whole new power mode. Main character energy fr fr. πŸ‘‘


πŸ¦‹ SYNOPSIS

int ufshcd_dme_change_power_mode (struct ufs_hba *hba , struct
ufs_pa_layer_attr *pwr_mode , enum ufshcd_pmc_policy pmc_policy );

🌸 ARGUMENTS

  • hba β€” the per-adapter instance, your one and only πŸ’…
  • pwr_mode β€” a pointer to the target power mode (gear/lane) attributes, i.e. where we're headed πŸ¦‹
  • pmc_policy β€” the Power Mode change policy, the rules of the vibe check πŸ‘‘

✨ DESCRIPTION ✨

So this function handles the low-level DME (Device Management Entity) configuration that's required to transition the UFS link over to a new power mode. It runs the steps, in order, no skipping (this is the whole itinerary bestie):

  1. Checks if the requested mode actually matches the current state. (Like, are we already there? πŸ’€)
  2. Sets the M-PHY and UniPro attributes β€” including Gear (PA_RXGEAR/TXGEAR), Lanes, Termination, and HS Series (PA_HSSERIES). Obsessed with a good attribute set 🌈
  3. Configures the default UniPro timeout values (DL_FC0, etc.) β€” unless it's explicitly skipped via quirks, iykyk πŸ™ˆ
  4. Triggers the actual hardware mode change via ufshcd_uic_change_pwr_mode. This is the moment. 🎬
  5. Updates the HBA's cached power information on success. Cache stays slay. πŸ’–

🫢 RETURN

0 on success, non-zero error code on failure. That's it, that's the whole vibe check ⭐


πŸ‘‘ SEE ALSO

The whole ufshcd family reunion, no cap β€” and the kernel file ./drivers/ufs/core/ufshcd.c is where the magic lives:


Also worth knowing: this page lives under ./drivers/ufs/core and it's dated October 2026, and the man page itself is ufshcd_dme_c...e_power_mode(9) β€” yes the title got truncated, she's mysterious like that πŸ’…

Okay that's the whole page bestie, go forth and change some power modes πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ«Ά

πŸ“¦ where this page comes from