aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/firmware
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/firmware')
-rw-r--r--drivers/firmware/efi/capsule-loader.c8
-rw-r--r--drivers/firmware/efi/capsule.c6
2 files changed, 8 insertions, 6 deletions
diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c
index c99c24bc79b0..9ae6c116c474 100644
--- a/drivers/firmware/efi/capsule-loader.c
+++ b/drivers/firmware/efi/capsule-loader.c
@@ -16,6 +16,7 @@
16#include <linux/slab.h> 16#include <linux/slab.h>
17#include <linux/mutex.h> 17#include <linux/mutex.h>
18#include <linux/efi.h> 18#include <linux/efi.h>
19#include <linux/vmalloc.h>
19 20
20#define NO_FURTHER_WRITE_ACTION -1 21#define NO_FURTHER_WRITE_ACTION -1
21 22
@@ -108,14 +109,15 @@ static ssize_t efi_capsule_submit_update(struct capsule_info *cap_info)
108 int ret; 109 int ret;
109 void *cap_hdr_temp; 110 void *cap_hdr_temp;
110 111
111 cap_hdr_temp = kmap(cap_info->pages[0]); 112 cap_hdr_temp = vmap(cap_info->pages, cap_info->index,
113 VM_MAP, PAGE_KERNEL);
112 if (!cap_hdr_temp) { 114 if (!cap_hdr_temp) {
113 pr_debug("%s: kmap() failed\n", __func__); 115 pr_debug("%s: vmap() failed\n", __func__);
114 return -EFAULT; 116 return -EFAULT;
115 } 117 }
116 118
117 ret = efi_capsule_update(cap_hdr_temp, cap_info->pages); 119 ret = efi_capsule_update(cap_hdr_temp, cap_info->pages);
118 kunmap(cap_info->pages[0]); 120 vunmap(cap_hdr_temp);
119 if (ret) { 121 if (ret) {
120 pr_err("%s: efi_capsule_update() failed\n", __func__); 122 pr_err("%s: efi_capsule_update() failed\n", __func__);
121 return ret; 123 return ret;
diff --git a/drivers/firmware/efi/capsule.c b/drivers/firmware/efi/capsule.c
index 53b9fd2293ee..6eedff45e6d7 100644
--- a/drivers/firmware/efi/capsule.c
+++ b/drivers/firmware/efi/capsule.c
@@ -190,9 +190,9 @@ efi_capsule_update_locked(efi_capsule_header_t *capsule,
190 * map the capsule described by @capsule with its data in @pages and 190 * map the capsule described by @capsule with its data in @pages and
191 * send it to the firmware via the UpdateCapsule() runtime service. 191 * send it to the firmware via the UpdateCapsule() runtime service.
192 * 192 *
193 * @capsule must be a virtual mapping of the first page in @pages 193 * @capsule must be a virtual mapping of the complete capsule update in the
194 * (@pages[0]) in the kernel address space. That is, a 194 * kernel address space, as the capsule can be consumed immediately.
195 * capsule_header_t that describes the entire contents of the capsule 195 * A capsule_header_t that describes the entire contents of the capsule
196 * must be at the start of the first data page. 196 * must be at the start of the first data page.
197 * 197 *
198 * Even though this function will validate that the firmware supports 198 * Even though this function will validate that the firmware supports