ufshcd_scsi_add_wlus(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

okay so bestie, welcome to ufshcd_scsi_add_wlus(9) from the Kernel API Manual β€” this is the page about adding required W-LUs, and it’s lowkey iconic πŸ’…βœ¨

πŸ’… NAME πŸ’…

ufshcd_scsi_add_wlus β€” Adds required W-LUs 🫢

✨ SYNOPSIS ✨

it’s giving:

int ufshcd_scsi_add_wlus (struct ufs_hba *hba );

πŸŽ€ ARGUMENTS πŸŽ€

  • hba β€” per-adapter instance. That’s the one argument, bestie 🫢

🌸 DESCRIPTION 🌸

okay so the UFS device specification requires UFS devices to support 4 well known logical units, and they are literally:

  • "REPORT_LUNS" (address: 01h)
  • "UFS Device" (address: 50h)
  • "RPMB" (address: 44h)
  • "BOOT" (address: 30h)

UFS device’s power management needs to be controlled by the "POWER CONDITION" field of the SSU (START STOP UNIT) command. But here’s the catch, bestie: this "power condition" field will take effect only when it’s sent to the "UFS device" well known logical unit. Hence we require the scsi_device instance to represent this logical unit in order for the UFS host driver to send the SSU command for power management 😭

We also require the scsi_device instance for "RPMB" (Replay Protected Memory Block) LU so a user space process can control this LU. User space may also want to have access to BOOT LU πŸ‘€

This function adds scsi_device instances for each of all well known LUs (except "REPORT LUNS" LU). periodt πŸŽ€

πŸ”₯ RETURN πŸ”₯

zero on success (all required W-LUs are added successfully), and non-zero error value on failure (if failed to add any of the required W-LU). So yeah, zero is the slay outcome, non-zero means something went off πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘

Kernel file ./drivers/ufs/core/ufshcd.c β€” and the whole squad is here, yes every single one, no skipping bestie πŸ‘‘


mwah πŸ’‹ β€” source/version is ./drivers/ufs/core, dated October 2026, and the page is ufshcd_scsi_add_wlus(9), bestie 🫢🌈

πŸ“¦ where this page comes from