87 lines · plain
1.. SPDX-License-Identifier: GPL-2.02 3==================================4NVDIMM Runtime Firmware Activation5==================================6 7Some persistent memory devices run a firmware locally on the device /8"DIMM" to perform tasks like media management, capacity provisioning,9and health monitoring. The process of updating that firmware typically10involves a reboot because it has implications for in-flight memory11transactions. However, reboots are disruptive and at least the Intel12persistent memory platform implementation, described by the Intel ACPI13DSM specification [1], has added support for activating firmware at14runtime.15 16A native sysfs interface is implemented in libnvdimm to allow platform17to advertise and control their local runtime firmware activation18capability.19 20The libnvdimm bus object, ndbusX, implements an ndbusX/firmware/activate21attribute that shows the state of the firmware activation as one of 'idle',22'armed', 'overflow', and 'busy'.23 24- idle:25 No devices are set / armed to activate firmware26 27- armed:28 At least one device is armed29 30- busy:31 In the busy state armed devices are in the process of transitioning32 back to idle and completing an activation cycle.33 34- overflow:35 If the platform has a concept of incremental work needed to perform36 the activation it could be the case that too many DIMMs are armed for37 activation. In that scenario the potential for firmware activation to38 timeout is indicated by the 'overflow' state.39 40The 'ndbusX/firmware/activate' property can be written with a value of41either 'live', or 'quiesce'. A value of 'quiesce' triggers the kernel to42run firmware activation from within the equivalent of the hibernation43'freeze' state where drivers and applications are notified to stop their44modifications of system memory. A value of 'live' attempts45firmware activation without this hibernation cycle. The46'ndbusX/firmware/activate' property will be elided completely if no47firmware activation capability is detected.48 49Another property 'ndbusX/firmware/capability' indicates a value of50'live' or 'quiesce', where 'live' indicates that the firmware51does not require or inflict any quiesce period on the system to update52firmware. A capability value of 'quiesce' indicates that firmware does53expect and injects a quiet period for the memory controller, but 'live'54may still be written to 'ndbusX/firmware/activate' as an override to55assume the risk of racing firmware update with in-flight device and56application activity. The 'ndbusX/firmware/capability' property will be57elided completely if no firmware activation capability is detected.58 59The libnvdimm memory-device / DIMM object, nmemX, implements60'nmemX/firmware/activate' and 'nmemX/firmware/result' attributes to61communicate the per-device firmware activation state. Similar to the62'ndbusX/firmware/activate' attribute, the 'nmemX/firmware/activate'63attribute indicates 'idle', 'armed', or 'busy'. The state transitions64from 'armed' to 'idle' when the system is prepared to activate firmware,65firmware staged + state set to armed, and 'ndbusX/firmware/activate' is66triggered. After that activation event the nmemX/firmware/result67attribute reflects the state of the last activation as one of:68 69- none:70 No runtime activation triggered since the last time the device was reset71 72- success:73 The last runtime activation completed successfully.74 75- fail:76 The last runtime activation failed for device-specific reasons.77 78- not_staged:79 The last runtime activation failed due to a sequencing error of the80 firmware image not being staged.81 82- need_reset:83 Runtime firmware activation failed, but the firmware can still be84 activated via the legacy method of power-cycling the system.85 86[1]: https://docs.pmem.io/persistent-memory/87