aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnshuman Khandual <khandual@linux.vnet.ibm.com>2014-09-29 20:15:36 +0530
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2014-09-30 14:44:55 +1000
commit32765e19a22f8366e562d7649cd726dc415600e1 (patch)
treeebd67924112fc18cbeee62c9a7c3e130e2297759
parent81189ede6374149931419405d87bba75275cc6e7 (diff)
downloadskiboot-32765e19a22f8366e562d7649cd726dc415600e1.zip
skiboot-32765e19a22f8366e562d7649cd726dc415600e1.tar.gz
skiboot-32765e19a22f8366e562d7649cd726dc415600e1.tar.bz2
dpo: Return OPAL_WRONG_STATE when not in DPO pending state
This patch changes fsp_opal_get_dpo_status function to return OPAL_WRONG_STATE when not in DPO pending state. This will help the host to differentiate whether the system is in DPO pending state or not and then analyse the returned timeout value correctly. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
-rw-r--r--hw/fsp/fsp-dpo.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/hw/fsp/fsp-dpo.c b/hw/fsp/fsp-dpo.c
index 788c6c4..08d2ef2 100644
--- a/hw/fsp/fsp-dpo.c
+++ b/hw/fsp/fsp-dpo.c
@@ -43,13 +43,13 @@ unsigned long fsp_dpo_init_tb = 0;
*/
static int64_t fsp_opal_get_dpo_status(int64_t *dpo_timeout)
{
- int64_t timeout = 0;
-
- if (fsp_dpo_init_tb && fsp_dpo_pending)
- timeout = DPO_TIMEOUT - tb_to_secs(mftb() - fsp_dpo_init_tb);
-
- *dpo_timeout = timeout;
- return OPAL_SUCCESS;
+ if (fsp_dpo_init_tb && fsp_dpo_pending) {
+ *dpo_timeout = DPO_TIMEOUT - tb_to_secs(mftb() - fsp_dpo_init_tb);
+ return OPAL_SUCCESS;
+ } else {
+ *dpo_timeout = 0;
+ return OPAL_WRONG_STATE;
+ }
}
/* Process FSP DPO init message */