discover/platform-powerpc: Use IPMI on BMC-based machines only
authorSamuel Mendoza-Jonas <sam@mendozajonas.com>
Wed, 13 Jul 2016 03:49:11 +0000 (13:49 +1000)
committerSamuel Mendoza-Jonas <sam@mendozajonas.com>
Thu, 14 Jul 2016 01:25:43 +0000 (11:25 +1000)
With a kernel that has IPMI support Petitboot will try to use direct
IPMI, however on FSP machines this is not fully functional. Use direct
IPMI only on BMC-based machines, and use sysparams otherwise.

Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
discover/platform-powerpc.c

index eb54c6dddf231d73a5f1f1965f76703f7967d471..8fca5bd4bdb60da2dce3990696b283ab9d5648f8 100644 (file)
@@ -1348,6 +1348,7 @@ static bool probe(struct platform *p, void *ctx)
 {
        struct platform_powerpc *platform;
        struct stat statbuf;
+       bool bmc_present;
        int rc;
 
        /* we need a device tree */
@@ -1363,7 +1364,9 @@ static bool probe(struct platform *p, void *ctx)
 
        p->platform_data = platform;
 
-       if (ipmi_present()) {
+       bmc_present = stat("/proc/device-tree/bmc", &statbuf) == 0;
+
+       if (ipmi_present() && bmc_present) {
                pb_debug("platform: using direct IPMI for IPMI paramters\n");
                platform->ipmi = ipmi_open(platform);
                platform->get_ipmi_bootdev = get_ipmi_bootdev_ipmi;
@@ -1378,8 +1381,7 @@ static bool probe(struct platform *p, void *ctx)
                pb_log("platform: no IPMI parameter support\n");
        }
 
-       rc = stat("/proc/device-tree/bmc", &statbuf);
-       if (!rc)
+       if (bmc_present)
                platform->get_platform_versions = hostboot_load_versions;
 
        return true;