Lines Matching +full:out +full:- +full:of +full:- +full:reset
1 // SPDX-License-Identifier: GPL-2.0
25 static int efi_reset_type = -1;
34 * efi_capsule_pending - has a capsule been passed to the firmware?
35 * @reset_type: store the type of EFI reset if capsule is pending
38 * firmware we need to perform a specific type of reset. If a capsule is
39 * pending return the reset type in @reset_type.
41 * This function will race with callers of efi_capsule_update(), for
47 * A non-racy use is from platform reboot code because we use
63 * Whitelist of EFI capsule flags that we support.
74 * efi_capsule_supported - does the firmware support the capsule?
75 * @guid: vendor guid of capsule
77 * @size: size of capsule data
78 * @reset: the reset type required for this capsule
83 * No attempt is made to check @reset against the reset type required
84 * by any pending capsules because of the races involved.
86 int efi_capsule_supported(efi_guid_t guid, u32 flags, size_t size, int *reset) in efi_capsule_supported() argument
94 return -EINVAL; in efi_capsule_supported()
100 status = efi.query_capsule_caps(cap_list, 1, &max_size, reset); in efi_capsule_supported()
105 return -ENOSPC; in efi_capsule_supported()
113 * continuation pointer. The last continuation pointer of the last
114 * page must be zero to mark the end of the chain.
116 #define SGLIST_PER_PAGE ((PAGE_SIZE / sizeof(efi_capsule_block_desc_t)) - 1)
128 * efi_capsule_update_locked - pass a single capsule to the firmware
130 * @sg_pages: array of scatter gather (block descriptor) pages
131 * @reset: the reset type required for @capsule
134 * whether efi_reset_type will conflict with @reset, and atomically
144 struct page **sg_pages, int reset) in efi_capsule_update_locked() argument
153 * different reset type, we're out of luck and must abort. in efi_capsule_update_locked()
155 if (efi_reset_type >= 0 && efi_reset_type != reset) { in efi_capsule_update_locked()
156 pr_err("Conflicting capsule reset type %d (%d).\n", in efi_capsule_update_locked()
157 reset, efi_reset_type); in efi_capsule_update_locked()
158 return -EINVAL; in efi_capsule_update_locked()
169 return -EINVAL; in efi_capsule_update_locked()
177 efi_reset_type = reset; in efi_capsule_update_locked()
184 * efi_capsule_update - send a capsule to the firmware
186 * @pages: an array of capsule data pages
192 * @capsule must be a virtual mapping of the complete capsule update in the
194 * A capsule_header_t that describes the entire contents of the capsule
195 * must be at the start of the first data page.
209 * pending capsule that has a reset type that conflicts with the one
218 u32 imagesize = capsule->imagesize; in efi_capsule_update()
219 efi_guid_t guid = capsule->guid; in efi_capsule_update()
221 u32 flags = capsule->flags; in efi_capsule_update()
235 return -ENOMEM; in efi_capsule_update()
240 rv = -ENOMEM; in efi_capsule_update()
241 goto out; in efi_capsule_update()
252 PAGE_SIZE - (u64)*pages % PAGE_SIZE); in efi_capsule_update()
257 imagesize -= sz; in efi_capsule_update()
258 count--; in efi_capsule_update()
271 * At runtime, the firmware has no way to find out where the in efi_capsule_update()
287 out: in efi_capsule_update()