Lines Matching +full:out +full:- +full:of +full:- +full:reset
1 // SPDX-License-Identifier: GPL-2.0
24 static int efi_reset_type = -1;
33 * efi_capsule_pending - has a capsule been passed to the firmware?
34 * @reset_type: store the type of EFI reset if capsule is pending
37 * firmware we need to perform a specific type of reset. If a capsule is
38 * pending return the reset type in @reset_type.
40 * This function will race with callers of efi_capsule_update(), for
46 * A non-racy use is from platform reboot code because we use
62 * Whitelist of EFI capsule flags that we support.
73 * efi_capsule_supported - does the firmware support the capsule?
74 * @guid: vendor guid of capsule
76 * @size: size of capsule data
77 * @reset: the reset type required for this capsule
82 * No attempt is made to check @reset against the reset type required
83 * by any pending capsules because of the races involved.
85 int efi_capsule_supported(efi_guid_t guid, u32 flags, size_t size, int *reset) in efi_capsule_supported() argument
93 return -EINVAL; in efi_capsule_supported()
99 status = efi.query_capsule_caps(cap_list, 1, &max_size, reset); in efi_capsule_supported()
104 return -ENOSPC; in efi_capsule_supported()
112 * continuation pointer. The last continuation pointer of the last
113 * page must be zero to mark the end of the chain.
115 #define SGLIST_PER_PAGE ((PAGE_SIZE / sizeof(efi_capsule_block_desc_t)) - 1)
127 * efi_capsule_update_locked - pass a single capsule to the firmware
129 * @sg_pages: array of scatter gather (block descriptor) pages
130 * @reset: the reset type required for @capsule
133 * whether efi_reset_type will conflict with @reset, and atomically
143 struct page **sg_pages, int reset) in efi_capsule_update_locked() argument
152 * different reset type, we're out of luck and must abort. in efi_capsule_update_locked()
154 if (efi_reset_type >= 0 && efi_reset_type != reset) { in efi_capsule_update_locked()
155 pr_err("Conflicting capsule reset type %d (%d).\n", in efi_capsule_update_locked()
156 reset, efi_reset_type); in efi_capsule_update_locked()
157 return -EINVAL; in efi_capsule_update_locked()
168 return -EINVAL; in efi_capsule_update_locked()
176 efi_reset_type = reset; in efi_capsule_update_locked()
183 * efi_capsule_update - send a capsule to the firmware
185 * @pages: an array of capsule data pages
191 * @capsule must be a virtual mapping of the complete capsule update in the
193 * A capsule_header_t that describes the entire contents of the capsule
194 * must be at the start of the first data page.
208 * pending capsule that has a reset type that conflicts with the one
217 u32 imagesize = capsule->imagesize; in efi_capsule_update()
218 efi_guid_t guid = capsule->guid; in efi_capsule_update()
220 u32 flags = capsule->flags; in efi_capsule_update()
234 return -ENOMEM; in efi_capsule_update()
239 rv = -ENOMEM; in efi_capsule_update()
240 goto out; in efi_capsule_update()
251 PAGE_SIZE - (u64)*pages % PAGE_SIZE); in efi_capsule_update()
256 imagesize -= sz; in efi_capsule_update()
257 count--; in efi_capsule_update()
275 out: in efi_capsule_update()