Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

/sys/class/scsi_device

FieldValue
SubsystemSCSI midlayer per-device class; the only cached attributes are UFS driver additions documented in sysfs-driver-ufs; core implementation file not in cached tree
Config gatenot verifiable from the cached tree: no SCSI Kconfig is cached and the ABI entries name no config symbol (not verified); the documented attributes additionally require a UFS device (ufshcd driver)
ABI documentationDocumentation/ABI/testing/sysfs-driver-ufs (the only ABI file with class/scsi_device What: paths)
SinceFebruary 2018 for all documented attributes (entries dated February 2018; dyn_cap_needed entry dated March 2018)
Live (5.10.134 host)class present with 0 entries: directories exist but no SCSI device is attached in the container
Ledger IDSYSC-scsi_device

What it represents

The per-SCSI-device (logical unit) class of the SCSI midlayer. Each entry corresponds to one LUN seen through one SCSI host/target/lun path. The cached ABI documentation does not describe the generic midlayer attributes; it documents only the UFS-specific extensions that the UFS driver hangs off device/: the dyn_cap_needed counter and a unit_descriptor/ subdirectory mirroring the UFS 2.1 unit descriptor parameters (block geometry, provisioning, queue depth, write protection, boot LUN information). For non-UFS disks those files simply do not exist.

Relationship to the device model

SCSI devices are the third level of the SCSI object hierarchy (host -> target -> device); the same objects are reachable under /sys/bus/scsi/devices/H:C:I:L, with the class directory providing a flat view. Block devices (sd, sr, st) are children of these scsi_device objects; the UFS unit_descriptor files live on the scsi_device side, while the UFS host controller attributes live under /sys/bus/platform/drivers/ufshcd per the same ABI file.

Attributes

All documented attributes are read-only; presence is conditional on UFS hardware.

AttributeR/WUnit/formatConditional?Source
*/device/dyn_cap_neededROamount of physical memory needed to be removed from the physical memory resources pool of the LUNUFS devicesABI testing sysfs-driver-ufs
*/device/unit_descriptor/logical_block_sizeROsize of addressable logical blocks, exponent base 2UFS devicesABI testing sysfs-driver-ufs
*/device/unit_descriptor/logical_block_countROtotal number of addressable logical blocksUFS devicesABI testing sysfs-driver-ufs
*/device/unit_descriptor/{erase_block_size,provisioning_type,large_unit_granularity}ROerase block size; thin provisioning type; LUN granularityUFS devicesABI testing sysfs-driver-ufs
*/device/unit_descriptor/{lun_queue_depth,lun_write_protect,lun_memory_type,data_reliability}ROqueue depth; write protection status; memory type; power-failure write behaviorUFS devicesABI testing sysfs-driver-ufs
*/device/unit_descriptor/{boot_lun_id,psa_sensitive,context_capabilities,physical_memory_resource_count,wb_buf_alloc_units}ROboot LUN info; PSA sensitivity; context capabilities; total physical memory resources; write booster buffer allocationUFS devicesABI testing sysfs-driver-ufs

Every description defers to “UFS specifications 2.1” for the full parameter semantics.

Safety and writes

All documented attributes are read-only, per the ABI file’s repeated “The file is read only.” sentence. No writes are defined for this class in the cached tree; the writable UFS controls (power levels, flags) belong to the ufshcd platform device, not the scsi_device. The generic per-device attributes of the midlayer are not covered by any cached ABI file and are deliberately not listed.

References