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

FieldValue
SubsystemCharacter device core; drivers/char/misc.c (misc_class, misc_register)
Config gatemisc.o is obj-y in drivers/char/Makefile (no Kconfig gate for the class itself; each member driver has its own)
ABI documentationDocumentation/ABI/testing/sysfs-driver-xdata only (2 What: entries: dw-xdata-pcie.<device>/read, /write, KernelVersion 5.13)
SinceSource-established for the class (MISC_MAJOR 10); per-device attrs date from their drivers
Live (5.10.134 host)75 entries: cpu_dma_latency, dbom_virtio_tool, device-mapper, fuse, hw_random, ioasid_user, loop-control, tun, uinput, virtfuse0-63, vsock, vvu
Ledger IDSYSC-misc

What it represents

The misc catch-all class for character drivers that do not warrant a major number of their own: each driver calls misc_register() with a struct miscdevice and gets a directory named after misc->name, under MISC_MAJOR 10 with either a fixed minor or MISC_DYNAMIC_MINOR. The class core creates no attributes; device_create_with_groups() attaches whatever attribute group the registering driver supplied. What a directory contains therefore varies wildly: fuse and tun have empty dev dirs here, while driver-specific files like the dw-xdata-pcie traffic-generator controls (the only two entries documented in Documentation/ABI) appear on hardware that has that driver.

Relationship to the device model

misc_class carries a devnode callback (misc_devnode) so devtmpfs can apply per-driver node modes. The /proc/misc file is the procfs twin listing registered minors and names. Member devices parent under their real device when misc->parent is set. The live population shows how kernel config drives the class: all 75 entries are built into this host’s kernel (the 64 virtfuseN instances are an Alibaba kangaroo in-tree-style driver family, live-verified here but not part of mainline ABI documentation).

Attributes (representative)

AttributeR/WValue and unitSource
cpu_dma_latency/devRO10:60live check (5.10.134)
device-mapper/devRO10:236live check
fuse/devRO10:229live check
hw_random/devRO10:183live check
loop-control/devRO10:237live check
tun/devRO10:200live check
uinput/devRO10:223live check
vsock/devRO10:61live check
vvu/devRO10:63live check
dbom_virtio_tool/devRO10:62live check (host-specific driver)
dw-xdata-pcie.<device>/read, /writeWOtrigger PCIe traffic generator in read or write directionABI sysfs-driver-xdata, 5.13; driver-specific, absent on this host

Fixed minors for the named devices come from their drivers’ miscdevice declarations; the class assigns dynamic minors where MISC_DYNAMIC_MINOR is used, so numbers can differ across kernels and module load order.

Safety and writes

The class directory itself exposes only dev/uevent style files: nothing to write. Every real interface belongs to the member driver and lives in its /dev node or its driver-provided sysfs files (the ABI-documented dw-xdata files are write-only triggers). Do not infer behavior from the class: tun, fuse, uinput and loop-control are ioctl-driven, and cpu_dma_latency is a PM QoS parameter file documented outside ABI. Treat unexplained entries (here virtfuseN, dbom_virtio_tool) as vendor drivers: identify them via /proc/misc and uevent MODALIAS, not by ABI docs that do not exist.

References

  • drivers/char/misc.c, include/uapi/linux/major.h (MISC_MAJOR 10), fetched from raw.githubusercontent.com/torvalds/linux/master
  • Documentation/ABI/testing/sysfs-driver-xdata (cached at source-cache/linux-sparse)
  • Live enumeration /sys/class/misc with per-entry dev reads (read-only, kernel 5.10.134)
  • Sibling pages: mem, cpuid; coverage: ledger