[Skiboot] [PATCH] opal-prd: Insert powernv_flash module

Vasant Hegde hegdevasant at linux.vnet.ibm.com
Wed Apr 4 03:38:41 AEST 2018


Explictly load powernv_flash module on BMC based system so that we are sure
that flash device is created before starting opal-prd daemon.

Note that I have replaced pnor_available() check with is_fsp_system(). As we
want to load module on BMC system only. Also pnor_init has enough logic to
detect flash device. Hence pnor_available() becomes redundant check.

Signed-off-by: Vasant Hegde <hegdevasant at linux.vnet.ibm.com>
CC: Jeremy Kerr <jeremy.kerr at au1.ibm.com>
CC: Stewart Smith <stewart at linux.vnet.ibm.com>
---
 external/opal-prd/opal-prd.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c
index 5a15f1d29..bc092d186 100644
--- a/external/opal-prd/opal-prd.c
+++ b/external/opal-prd/opal-prd.c
@@ -547,6 +547,11 @@ int hservice_wakeup(u32 core, u32 mode)
 	return 0;
 }
 
+static void pnor_load_module(struct opal_prd_ctx *ctx)
+{
+	insert_module("powernv_flash");
+}
+
 static void ipmi_init(struct opal_prd_ctx *ctx)
 {
 	insert_module("ipmi_devintf");
@@ -2177,7 +2182,9 @@ static int run_prd_daemon(struct opal_prd_ctx *ctx)
 
 	fixup_hinterface_table();
 
-	if (pnor_available(&ctx->pnor)) {
+	if (!is_fsp_system()) {
+		pnor_load_module(ctx);
+
 		rc = pnor_init(&ctx->pnor);
 		if (rc) {
 			pr_log(LOG_ERR, "PNOR: Failed to open pnor: %m");
-- 
2.14.3



More information about the Skiboot mailing list