diff mbox

FSP: Give up PSI link on shutdown

Message ID 20151125083107.2269.32029.stgit@thinktux.in.ibm.com
State Accepted
Headers show

Commit Message

Ananth N Mavinakayanahalli Nov. 25, 2015, 8:31 a.m. UTC
Since we are anyway on the way to standby and apparently the other
hypervisor also does this.

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

Comments

Stewart Smith Dec. 3, 2015, 5:22 a.m. UTC | #1
Ananth N Mavinakayanahalli <ananth@in.ibm.com> writes:

> Since we are anyway on the way to standby and apparently the other
> hypervisor also does this.
>
> Tested-by: Vipin K Parashar <vipin@linux.vnet.ibm.com>
> Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com>

Thanks, merged to stable as of 467c017502542b34c9cad5c79cd31b84fb1c94bd
and master as of 3ee71369bcc9c3b299586acb7f714d83c7447011
diff mbox

Patch

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;
 }