[Skiboot] [PATCH] FSP: Give up PSI link on shutdown

Ananth N Mavinakayanahalli ananth at in.ibm.com
Wed Nov 25 19:31:07 AEDT 2015


Since we are anyway on the way to standby and apparently the other
hypervisor also does this.

Tested-by: Vipin K Parashar <vipin at linux.vnet.ibm.com>
Signed-off-by: Ananth N Mavinakayanahalli <ananth at in.ibm.com>
---
 hw/fsp/fsp.c               |   22 ++++++++++++++++++++++
 include/fsp.h              |    1 +
 platforms/ibm-fsp/common.c |    1 +
 3 files changed, 24 insertions(+)

diff --git a/hw/fsp/fsp.c b/hw/fsp/fsp.c
index b53c3f0..220b97e 100644
--- a/hw/fsp/fsp.c
+++ b/hw/fsp/fsp.c
@@ -569,6 +569,28 @@ static void fsp_start_rr(struct fsp *fsp)
 	 */
 }
 
+/*
+ * Called on normal/quick shutdown to give up the PSI link
+ */
+void fsp_reset_links(void)
+{
+	struct fsp *fsp = fsp_get_active();
+	struct fsp_iopath *iop;
+
+	if (!fsp)
+		return;
+
+	/* Already in one of the error states? */
+	if (fsp_in_hir(fsp) || fsp_in_reset(fsp))
+		return;
+
+	iop = &fsp->iopath[fsp->active_iopath];
+	prlog(PR_NOTICE, "FSP #%d: Host initiated shutdown."
+			" Giving up the PSI link\n", fsp->index);
+	psi_disable_link(iop->psi);
+	return;
+}
+
 static void fsp_trace_event(struct fsp *fsp, u32 evt,
 			    u32 data0, u32 data1, u32 data2, u32 data3)
 {
diff --git a/include/fsp.h b/include/fsp.h
index a61bd58..7ea162d 100644
--- a/include/fsp.h
+++ b/include/fsp.h
@@ -802,6 +802,7 @@ extern void fsp_ipmi_init(void);
 /* Reset/Reload */
 extern void fsp_reinit_fsp(void);
 extern void fsp_trigger_reset(void);
+extern void fsp_reset_links(void);
 
 /* FSP memory errors */
 extern void fsp_memory_err_init(void);
diff --git a/platforms/ibm-fsp/common.c b/platforms/ibm-fsp/common.c
index 59a890b..dc3a002 100644
--- a/platforms/ibm-fsp/common.c
+++ b/platforms/ibm-fsp/common.c
@@ -222,6 +222,7 @@ int64_t ibm_fsp_cec_power_down(uint64_t request)
 	if (fsp_sync_msg(fsp_mkmsg(FSP_CMD_POWERDOWN_NORM, 1, request), true))
 		return OPAL_INTERNAL_ERROR;
 
+	fsp_reset_links();
 	return OPAL_SUCCESS;
 }
 



More information about the Skiboot mailing list