Blob Blame History Raw
commit cb16e55a234b91fd42112904cff15094fbae680d
Author: Vasant Hegde <hegdevasant@linux.vnet.ibm.com>
Date:   Tue Apr 3 23:08:41 2018 +0530

    opal-prd: Insert powernv_flash module
    
    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@linux.vnet.ibm.com>
    CC: Jeremy Kerr <jeremy.kerr@au1.ibm.com>
    CC: Stewart Smith <stewart@linux.vnet.ibm.com>
    Signed-off-by: Stewart Smith <stewart@linux.ibm.com>

diff --git a/external/opal-prd/opal-prd.c b/external/opal-prd/opal-prd.c
index 5a15f1d2..bc092d18 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");