Patrick Rudolph has uploaded this change for review. ( https://review.coreboot.org/25398
Change subject: util/intelmetool: Fix crash on strict devmem kernels ......................................................................
util/intelmetool: Fix crash on strict devmem kernels
Don't crash if mapping MEI PCI memory fails. This can happen if CONFIG_STRICT_DEVMEM is enabled.
Change-Id: I33c75a7cccb4cefaa26f70aed4bdc4bd620cdad0 Signed-off-by: Patrick Rudolph patrick.rudolph@9elements.com --- M util/intelmetool/intelmetool.c M util/intelmetool/me.c 2 files changed, 9 insertions(+), 4 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/98/25398/1
diff --git a/util/intelmetool/intelmetool.c b/util/intelmetool/intelmetool.c index 0b0e509..9de6bb5 100644 --- a/util/intelmetool/intelmetool.c +++ b/util/intelmetool/intelmetool.c @@ -287,17 +287,21 @@ printf("ME: has a broken implementation on your board with" "this firmware\n");
- intel_mei_setup(dev); + if (intel_mei_setup(dev)) + goto out; usleep(ME_COMMAND_DELAY); mei_reset(); usleep(ME_COMMAND_DELAY); - mkhi_get_fw_version(&ME_major_ver, &ME_minor_ver); + if (mkhi_get_fw_version(&ME_major_ver, &ME_minor_ver)) + goto out; usleep(ME_COMMAND_DELAY); mei_reset(); usleep(ME_COMMAND_DELAY); - mkhi_get_fwcaps(); + if (mkhi_get_fwcaps()) + goto out; usleep(ME_COMMAND_DELAY);
+out: rehide_me(); }
diff --git a/util/intelmetool/me.c b/util/intelmetool/me.c index 6517022..f14f4cd 100644 --- a/util/intelmetool/me.c +++ b/util/intelmetool/me.c @@ -582,7 +582,8 @@ mei_mmap = map_physical(pagerounded, 0x2000); mei_mmap += mei_base_address - pagerounded; if (mei_mmap == NULL) { - printf("Could not map ME setup memory\n"); + printf("Could not map ME setup memory.\n" + "Do you have cmdline argument 'iomem=relaxed' set ?\n"); return 1; }