firmware-activate.rst 3.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. .. SPDX-License-Identifier: GPL-2.0
  2. ==================================
  3. NVDIMM Runtime Firmware Activation
  4. ==================================
  5. Some persistent memory devices run a firmware locally on the device /
  6. "DIMM" to perform tasks like media management, capacity provisioning,
  7. and health monitoring. The process of updating that firmware typically
  8. involves a reboot because it has implications for in-flight memory
  9. transactions. However, reboots are disruptive and at least the Intel
  10. persistent memory platform implementation, described by the Intel ACPI
  11. DSM specification [1], has added support for activating firmware at
  12. runtime.
  13. A native sysfs interface is implemented in libnvdimm to allow platform
  14. to advertise and control their local runtime firmware activation
  15. capability.
  16. The libnvdimm bus object, ndbusX, implements an ndbusX/firmware/activate
  17. attribute that shows the state of the firmware activation as one of 'idle',
  18. 'armed', 'overflow', and 'busy'.
  19. - idle:
  20. No devices are set / armed to activate firmware
  21. - armed:
  22. At least one device is armed
  23. - busy:
  24. In the busy state armed devices are in the process of transitioning
  25. back to idle and completing an activation cycle.
  26. - overflow:
  27. If the platform has a concept of incremental work needed to perform
  28. the activation it could be the case that too many DIMMs are armed for
  29. activation. In that scenario the potential for firmware activation to
  30. timeout is indicated by the 'overflow' state.
  31. The 'ndbusX/firmware/activate' property can be written with a value of
  32. either 'live', or 'quiesce'. A value of 'quiesce' triggers the kernel to
  33. run firmware activation from within the equivalent of the hibernation
  34. 'freeze' state where drivers and applications are notified to stop their
  35. modifications of system memory. A value of 'live' attempts
  36. firmware activation without this hibernation cycle. The
  37. 'ndbusX/firmware/activate' property will be elided completely if no
  38. firmware activation capability is detected.
  39. Another property 'ndbusX/firmware/capability' indicates a value of
  40. 'live' or 'quiesce', where 'live' indicates that the firmware
  41. does not require or inflict any quiesce period on the system to update
  42. firmware. A capability value of 'quiesce' indicates that firmware does
  43. expect and injects a quiet period for the memory controller, but 'live'
  44. may still be written to 'ndbusX/firmware/activate' as an override to
  45. assume the risk of racing firmware update with in-flight device and
  46. application activity. The 'ndbusX/firmware/capability' property will be
  47. elided completely if no firmware activation capability is detected.
  48. The libnvdimm memory-device / DIMM object, nmemX, implements
  49. 'nmemX/firmware/activate' and 'nmemX/firmware/result' attributes to
  50. communicate the per-device firmware activation state. Similar to the
  51. 'ndbusX/firmware/activate' attribute, the 'nmemX/firmware/activate'
  52. attribute indicates 'idle', 'armed', or 'busy'. The state transitions
  53. from 'armed' to 'idle' when the system is prepared to activate firmware,
  54. firmware staged + state set to armed, and 'ndbusX/firmware/activate' is
  55. triggered. After that activation event the nmemX/firmware/result
  56. attribute reflects the state of the last activation as one of:
  57. - none:
  58. No runtime activation triggered since the last time the device was reset
  59. - success:
  60. The last runtime activation completed successfully.
  61. - fail:
  62. The last runtime activation failed for device-specific reasons.
  63. - not_staged:
  64. The last runtime activation failed due to a sequencing error of the
  65. firmware image not being staged.
  66. - need_reset:
  67. Runtime firmware activation failed, but the firmware can still be
  68. activated via the legacy method of power-cycling the system.
  69. [1]: https://docs.pmem.io/persistent-memory/