diff mbox series

opal-prd: Insert powernv_flash module

Message ID 20180403173841.31869-1-hegdevasant@linux.vnet.ibm.com
State Accepted
Headers show
Series opal-prd: Insert powernv_flash module | expand

Commit Message

Vasant Hegde April 3, 2018, 5:38 p.m. UTC
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>
---
 external/opal-prd/opal-prd.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Comments

Stewart Smith April 10, 2018, 6:27 a.m. UTC | #1
Vasant Hegde <hegdevasant@linux.vnet.ibm.com> writes:
> 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>
> ---
>  external/opal-prd/opal-prd.c | 9 ++++++++-
>  1 file changed, 8 insertions(+), 1 deletion(-)

Thanks! Merged to master as of cb16e55a234b91fd42112904cff15094fbae680d.

I'm not sure if we should backport this to stable@ though? Probably should?
diff mbox series

Patch

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");