Thread (47 messages) 47 messages, 2 authors, 2019-08-19

Re: [PATCH v4 12/25] powernv/fadump: define register/un-register callback functions

From: Hari Bathini <hbathini@linux.ibm.com>
Date: 2019-08-14 07:13:48


On 13/08/19 8:04 PM, Mahesh J Salgaonkar wrote:
On 2019-07-16 17:03:23 Tue, Hari Bathini wrote:
quoted
Make OPAL calls to register and un-register with firmware for MPIPL.

Signed-off-by: Hari Bathini <hbathini@linux.ibm.com>
---
 arch/powerpc/platforms/powernv/opal-fadump.c |   71 +++++++++++++++++++++++++-
 1 file changed, 69 insertions(+), 2 deletions(-)
[...]
quoted
@@ -88,12 +104,63 @@ static int opal_fadump_setup_kernel_metadata(struct fw_dump *fadump_conf)
 
 static int opal_fadump_register_fadump(struct fw_dump *fadump_conf)
 {
-	return -EIO;
+	int i, err = -EIO;
+	s64 rc;
+
+	for (i = 0; i < opal_fdm->region_cnt; i++) {
+		rc = opal_mpipl_update(OPAL_MPIPL_ADD_RANGE,
+				       opal_fdm->rgn[i].src,
+				       opal_fdm->rgn[i].dest,
+				       opal_fdm->rgn[i].size);
+		if (rc != OPAL_SUCCESS)
You may want to remove ranges which has been added so far on error and reset
opal_fdm->registered_regions.
Thanks for catching this, Mahesh.
Will update..
quoted
+			break;
+
+		opal_fdm->registered_regions++;
+	}
+
+	switch (rc) {
+	case OPAL_SUCCESS:
+		pr_info("Registration is successful!\n");
+		fadump_conf->dump_registered = 1;
+		err = 0;
+		break;
+	case OPAL_UNSUPPORTED:
+		pr_err("Support not available.\n");
+		fadump_conf->fadump_supported = 0;
+		fadump_conf->fadump_enabled = 0;
+		break;
+	case OPAL_INTERNAL_ERROR:
+		pr_err("Failed to register. Hardware Error(%lld).\n", rc);
+		break;
+	case OPAL_PARAMETER:
+		pr_err("Failed to register. Parameter Error(%lld).\n", rc);
+		break;
+	case OPAL_PERMISSION:
You may want to remove this check. With latest opal mpipl patches
opal_mpipl_update() no more returns OPAL_PERMISSION.

Even if opal does, we can not say fadump already registered just by
looking at return status of single entry addition.
Sure.

Thanks
Hari
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help