@@ -500,3 +500,75 @@ Description:
500500 console drivers from the device. Raw users of pci-sysfs
501501 resourceN attributes must be terminated prior to resizing.
502502 Success of the resizing operation is not guaranteed.
503+
504+ What: /sys/bus/pci/devices/.../leds/*:enclosure:*/brightness
505+ What: /sys/class/leds/*:enclosure:*/brightness
506+ Date: August 2024
507+ KernelVersion: 6.12
508+ Description:
509+ LED indications on PCIe storage enclosures which are controlled
510+ through the NPEM interface (Native PCIe Enclosure Management,
511+ PCIe r6.1 sec 6.28) are accessible as led class devices, both
512+ below /sys/class/leds and below NPEM-capable PCI devices.
513+
514+ Although these led class devices could be manipulated manually,
515+ in practice they are typically manipulated automatically by an
516+ application such as ledmon(8).
517+
518+ The name of a led class device is as follows:
519+ <bdf>:enclosure:<indication>
520+ where:
521+
522+ - <bdf> is the domain, bus, device and function number
523+ (e.g. 10000:02:05.0)
524+ - <indication> is a short description of the LED indication
525+
526+ Valid indications per PCIe r6.1 table 6-27 are:
527+
528+ - ok (drive is functioning normally)
529+ - locate (drive is being identified by an admin)
530+ - fail (drive is not functioning properly)
531+ - rebuild (drive is part of an array that is rebuilding)
532+ - pfa (drive is predicted to fail soon)
533+ - hotspare (drive is marked to be used as a replacement)
534+ - ica (drive is part of an array that is degraded)
535+ - ifa (drive is part of an array that is failed)
536+ - idt (drive is not the right type for the connector)
537+ - disabled (drive is disabled, removal is safe)
538+ - specific0 to specific7 (enclosure-specific indications)
539+
540+ Broadly, the indications fall into one of these categories:
541+
542+ - to signify drive state (ok, locate, fail, idt, disabled)
543+ - to signify drive role or state in a software RAID array
544+ (rebuild, pfa, hotspare, ica, ifa)
545+ - to signify any other role or state (specific0 to specific7)
546+
547+ Mandatory indications per PCIe r6.1 sec 7.9.19.2 comprise:
548+ ok, locate, fail, rebuild. All others are optional.
549+ A led class device is only visible if the corresponding
550+ indication is supported by the device.
551+
552+ To manipulate the indications, write 0 (LED_OFF) or 1 (LED_ON)
553+ to the "brightness" file. Note that manipulating an indication
554+ may implicitly manipulate other indications at the vendor's
555+ discretion. E.g. when the user lights up the "ok" indication,
556+ the vendor may choose to automatically turn off the "fail"
557+ indication. The current state of an indication can be
558+ retrieved by reading its "brightness" file.
559+
560+ The PCIe Base Specification allows vendors leeway to choose
561+ different colors or blinking patterns for the indications,
562+ but they typically follow the IBPI standard. E.g. the "locate"
563+ indication is usually presented as one or two LEDs blinking at
564+ 4 Hz frequency:
565+ https://en.wikipedia.org/wiki/International_Blinking_Pattern_Interpretation
566+
567+ PCI Firmware Specification r3.3 sec 4.7 defines a DSM interface
568+ to facilitate shared access by operating system and platform
569+ firmware to a device's NPEM registers. The kernel will use
570+ this DSM interface where available, instead of accessing NPEM
571+ registers directly. The DSM interface does not support the
572+ enclosure-specific indications "specific0" to "specific7",
573+ hence the corresponding led class devices are unavailable if
574+ the DSM interface is used.
0 commit comments