<feed xmlns='http://www.w3.org/2005/Atom'>
<title>talos-skiboot/doc/opal-api/return-codes.rst, branch master</title>
<subtitle>Talos™ II skiboot sources</subtitle>
<id>https://git.raptorcs.com/git/talos-skiboot/atom?h=master</id>
<link rel='self' href='https://git.raptorcs.com/git/talos-skiboot/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-skiboot/'/>
<updated>2017-10-11T05:45:34+00:00</updated>
<entry>
<title>fsp: return OPAL_BUSY_EVENT on failure sending FSP_CMD_POWERDOWN_NORM</title>
<updated>2017-10-11T05:45:34+00:00</updated>
<author>
<name>Stewart Smith</name>
<email>stewart@linux.vnet.ibm.com</email>
</author>
<published>2017-10-02T01:08:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-skiboot/commit/?id=696d378d7b7295366e115e89a785640bf72a5043'/>
<id>urn:sha1:696d378d7b7295366e115e89a785640bf72a5043</id>
<content type='text'>
We had a race condition between FSP Reset/Reload and powering down
the system from the host:

Roughly:

  FSP                Host
  ---                ----
  Power on
                     Power on
  (inject EPOW)
  (trigger FSP R/R)
                     Processes EPOW event, starts shutting down
                     calls OPAL_CEC_POWER_DOWN
  (is still in R/R)
                     gets OPAL_INTERNAL_ERROR, spins in opal_poll_events
  (FSP comes back)
                     spinning in opal_poll_events
  (thinks host is running)

The call to OPAL_CEC_POWER_DOWN is only made once as the reset/reload
error path for fsp_sync_msg() is to return -1, which means we give
the OS OPAL_INTERNAL_ERROR, which is fine, except that our own API
docs give us the opportunity to return OPAL_BUSY when trying again
later may be successful, and we're ambiguous as to if you should retry
on OPAL_INTERNAL_ERROR.

For reference, the linux code looks like this:
&gt;static void __noreturn pnv_power_off(void)
&gt;{
&gt;        long rc = OPAL_BUSY;
&gt;
&gt;        pnv_prepare_going_down();
&gt;
&gt;        while (rc == OPAL_BUSY || rc == OPAL_BUSY_EVENT) {
&gt;                rc = opal_cec_power_down(0);
&gt;                if (rc == OPAL_BUSY_EVENT)
&gt;                        opal_poll_events(NULL);
&gt;                else
&gt;                        mdelay(10);
&gt;        }
&gt;        for (;;)
&gt;                opal_poll_events(NULL);
&gt;}

Which means that *practically* our only option is to return OPAL_BUSY
or OPAL_BUSY_EVENT.

We choose OPAL_BUSY_EVENT for FSP systems as we do want to ensure we're
running pollers to communicate with the FSP and do the final bits of
Reset/Reload handling before we power off the system.

Additionally, we really should update our documentation to point all
of these return codes and what action an OS should take.

CC: stable
Reported-by: Pridhiviraj Paidipeddi &lt;ppaidipe@linux.vnet.ibm.com&gt;
Signed-off-by: Stewart Smith &lt;stewart@linux.vnet.ibm.com&gt;
Reviewed-by: Vasant Hegde &lt;hegdevasant@linux.vnet.ibm.com&gt;
Acked-by: Ananth N Mavinakayanahalli &lt;ananth@linux.vnet.ibm.com&gt;
Signed-off-by: Stewart Smith &lt;stewart@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>opal-api/: Fix ReStructured Text syntax</title>
<updated>2016-08-02T08:12:48+00:00</updated>
<author>
<name>Stewart Smith</name>
<email>stewart@linux.vnet.ibm.com</email>
</author>
<published>2016-07-27T07:43:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-skiboot/commit/?id=24e7fd3aa79697c019f215e1dd1a270b1b014e89'/>
<id>urn:sha1:24e7fd3aa79697c019f215e1dd1a270b1b014e89</id>
<content type='text'>
Signed-off-by: Stewart Smith &lt;stewart@linux.vnet.ibm.com&gt;
</content>
</entry>
<entry>
<title>doc/opal-api: rename .txt to .rst</title>
<updated>2016-08-02T08:12:48+00:00</updated>
<author>
<name>Stewart Smith</name>
<email>stewart@linux.vnet.ibm.com</email>
</author>
<published>2016-07-27T07:43:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-skiboot/commit/?id=925dff3660f9993e655ce45320ec294f8826f7cf'/>
<id>urn:sha1:925dff3660f9993e655ce45320ec294f8826f7cf</id>
<content type='text'>
Signed-off-by: Stewart Smith &lt;stewart@linux.vnet.ibm.com&gt;
</content>
</entry>
</feed>
