[Skiboot] [PATCH 032/110] doc: Add example to OPAL_CEC_POWER_DOWN
Stewart Smith
stewart at linux.ibm.com
Fri May 31 16:12:33 AEST 2019
Signed-off-by: Stewart Smith <stewart at linux.ibm.com>
---
doc/opal-api/opal-cec-power-down-5.rst | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/doc/opal-api/opal-cec-power-down-5.rst b/doc/opal-api/opal-cec-power-down-5.rst
index b4b236e2467c..7a84fce891f9 100644
--- a/doc/opal-api/opal-cec-power-down-5.rst
+++ b/doc/opal-api/opal-cec-power-down-5.rst
@@ -9,6 +9,24 @@ OPAL_CEC_POWER_DOWN
int64 opal_cec_power_down(uint64 request)
+As powering down the system is likely an asynchronous operation that we
+have to wait for a service processor to do, :ref:`OPAL_CEC_POWER_DOWN`
+should be called like the example code below:
+
+.. code-block:: c
+
+ int rc = OPAL_BUSY;
+
+ do {
+ rc = opal_cec_power_down(0);
+ if (rc == OPAL_BUSY_EVENT)
+ opal_poll_events(NULL);
+ } while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT);
+
+ for (;;)
+ opal_poll_events(NULL);
+
+
Arguments
---------
--
2.21.0
More information about the Skiboot
mailing list