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/firmware

FieldValue
SubsystemDriver core firmware loader; drivers/base/firmware_loader/sysfs.c (class, device attrs), fallback.c (device lifecycle)
Config gateCONFIG_FW_LOADER; the class-level timeout attr and FIRMWARE/TIMEOUT/ASYNC uevent vars require CONFIG_FW_LOADER_USER_HELPER; cancel/status/error/remaining_size require CONFIG_FW_UPLOAD (drivers/base/firmware_loader/Kconfig)
ABI documentationDocumentation/ABI/testing/sysfs-class-firmware (7 What: entries)
SinceAll ABI entries dated July 2022, KernelVersion 5.19; the class predates the doc but no earlier date is stated by the sources checked
Live (5.10.134 host)none observed (class absent from the cached 46-class enumeration)
Ledger IDSYSC-firmware

What it represents

Transient devices representing in-progress firmware requests. The class serves two flows: the sysfs fallback mechanism (user space supplies an image the driver could not find on disk) and firmware upload (user space pushes an update to a device that opted in). Each device is named after the firmware image (dev_set_name(f_dev, "%s", fw_name), drivers/base/firmware_loader/sysfs.c) and carries the uevent variables FIRMWARE, TIMEOUT and ASYNC (sysfs.c firmware_uevent).

Relationship to the device model

Devices are children of the requesting device (f_dev->parent, sysfs.c fw_create_instance). The class is not the /sys/firmware tree (dmi, efi, memmap), which is a non-class firmware-nodes view and is tracked separately in the sysfs ledger.

Attributes (representative; source per row)

AttributeR/WMeaning (source: ABI testing/sysfs-class-firmware)
loading0644Echo 1 before writing data, 0 when complete (triggers transfer for uploads), -1 to abort
data0644 binFirmware image carrier for fallback and uploads
timeout0644Fallback timeout, seconds; class-level attr (0 means wait forever; sysfs.c timeout_store)
statusROOne of idle, receiving, preparing, transferring, programming
errorROFailed upload as <STATUS>:<ERROR>; error tokens include hw-error, timeout, user-abort, device-busy, invalid-file-size, read-write-error, flash-wearout
remaining_sizeROBytes left to transfer, format ā€œ%uā€
cancelWORequest cancel of an upload; rejected EBUSY (FLASH write in progress) or ENODEV (no update)

Safety and writes

The loading/data/cancel sequence drives kernel device state; reading error during a transfer fails with EBUSY. All attributes exist only while a request is being serviced by the fallback or upload path (fallback.c fw_run_sysfs_fallback, fw_create_instance). No live observation on the read-only container host.

References

  • Documentation/ABI/testing/sysfs-class-firmware
  • drivers/base/firmware_loader/sysfs.c and fallback.c (fetched from torvalds/linux master into source-cache)
  • sysfs overview, ledger, udev