Lines Matching +full:firmware +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.
46 * A non-racy use is from platform reboot code because we use
47 * system_state to ensure no capsules can be sent to the firmware once
73 * efi_capsule_supported - does the firmware support the capsule?
77 * @reset: the reset type required for this capsule
79 * Check whether a capsule with @flags is supported by the firmware
82 * No attempt is made to check @reset against the reset type required
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()
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
128 * @capsule: capsule to send to the firmware
130 * @reset: the reset type required for @capsule
133 * whether efi_reset_type will conflict with @reset, and atomically
135 * the firmware.
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
184 * @capsule: capsule to send to firmware
189 * send it to the firmware via the UpdateCapsule() runtime service.
196 * Even though this function will validate that the firmware supports
201 * If the capsule is successfully submitted to the firmware, any
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()
251 PAGE_SIZE - (u64)*pages % PAGE_SIZE); in efi_capsule_update()
256 imagesize -= sz; in efi_capsule_update()
257 count--; in efi_capsule_update()