<font size=2 face="sans-serif">Seems fine (though I don't really have
the context of what function this is. (I'm not fluent in patch reviews,
not sure how you understand anything with so little context....)</font><br><font size=2 face="sans-serif"><br>--<br>Dan Crowell<br>Senior Software Engineer - Power Systems Enablement Firmware<br>IBM Rochester: t/l 553-2987<br>dcrowell@us.ibm.com</font><br><br><br><br><font size=1 color=#5f5f5f face="sans-serif">From:
</font><font size=1 face="sans-serif">Vasant Hegde <hegdevasant@linux.vnet.ibm.com></font><br><font size=1 color=#5f5f5f face="sans-serif">To:
</font><font size=1 face="sans-serif">skiboot@lists.ozlabs.org</font><br><font size=1 color=#5f5f5f face="sans-serif">Cc:
</font><font size=1 face="sans-serif">Vasant Hegde <hegdevasant@linux.vnet.ibm.com>,
Jeremy Kerr <jk@ozlabs.org>, Daniel M Crowell/Rochester/IBM@IBMUS,
Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com></font><br><font size=1 color=#5f5f5f face="sans-serif">Date:
</font><font size=1 face="sans-serif">09/21/2017 09:20 AM</font><br><font size=1 color=#5f5f5f face="sans-serif">Subject:
</font><font size=1 face="sans-serif">[PATCH 1/2]
opal-prd: Fix occ_reset call</font><br><hr noshade><br><br><br><tt><font size=2>HBRT OCC reset interface depends on service processor
type.<br> FSP -> reset_pm_complex()<br> BMC -> process_occ_reset()<br><br>This patch adds logic to detect service processor type and<br>then make appropriate occ reset call.<br><br>CC: Jeremy Kerr <jk@ozlabs.org><br>CC: Daniel M Crowell <dcrowell@us.ibm.com><br>Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com><br>Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com><br>---<br> external/opal-prd/opal-prd.c | 36 ++++++++++++++++++++++++++++++------<br> 1 file changed, 30 insertions(+), 6 deletions(-)<br><br>diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c<br>index a09a636..20ce5da 100644<br>--- a/external/opal-prd/opal-prd.c<br>+++ b/external/opal-prd/opal-prd.c<br>@@ -246,6 +246,21 @@ static void pr_log_daemon_init(void)<br> }<br> }<br> <br>+/* Check service processor type */<br>+static bool is_fsp_system(void)<br>+{<br>+
char *path;<br>+
int rc;<br>+<br>+
rc = asprintf(&path, "%s/fsps", devicetree_base);<br>+
if (rc < 0) {<br>+
pr_log(LOG_ERR,
"FW: error creating '/fsps' path %m");<br>+
return
false;<br>+
}<br>+<br>+
return access(path, F_OK) ? false : true;<br>+}<br>+<br> /**<br> * ABI check that we can't perform at build-time: we want to ensure
that the<br> * layout of struct host_interfaces matches that defined in the thunk.<br>@@ -1336,18 +1351,27 @@ static int pm_complex_reset(uint64_t chip)<br> {<br> int
rc;<br> <br>-
if (hservice_runtime->reset_pm_complex) {<br>+
/*<br>+
* FSP system -> reset_pm_complex<br>+
* BMC system -> process_occ_reset<br>+
*/<br>+
if (is_fsp_system()) {<br>+
if
(!hservice_runtime->reset_pm_complex) {<br>+
pr_log_nocall("reset_pm_complex");<br>+
return -1;<br>+
}<br>+<br>
pr_debug("PM: calling pm_complex_reset(%ld)", chip);<br>
rc = call_reset_pm_complex(chip);<br>+
} else {<br>+
if
(!hservice_runtime->process_occ_reset) {<br>+
pr_log_nocall("process_occ_reset");<br>+
return -1;<br>+
}<br> <br>-
} else if (hservice_runtime->process_occ_reset) {<br>
pr_debug("PM: calling process_occ_reset(%ld)", chip);<br>
call_process_occ_reset(chip);<br>
rc = 0;<br>-<br>-
} else {<br>-
pr_log_nocall("reset_pm_complex/process_occ_reset");<br>-
rc
= -1;<br> }<br> <br> return
rc;<br>-- <br>2.9.3<br><br></font></tt><br><br><BR>