Lines Matching +full:firmware +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.
47 * A non-racy use is from platform reboot code because we use
48 * system_state to ensure no capsules can be sent to the firmware once
74 * efi_capsule_supported - does the firmware support the capsule?
78 * @reset: the reset type required for this capsule
80 * Check whether a capsule with @flags is supported by the firmware
83 * No attempt is made to check @reset against the reset type required
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()
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
129 * @capsule: capsule to send to the firmware
131 * @reset: the reset type required for @capsule
134 * whether efi_reset_type will conflict with @reset, and atomically
136 * the firmware.
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
185 * @capsule: capsule to send to firmware
190 * send it to the firmware via the UpdateCapsule() runtime service.
197 * Even though this function will validate that the firmware supports
202 * If the capsule is successfully submitted to the firmware, any
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()
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()
274 * cache maintenance by virtual address, the firmware is unable in efi_capsule_update()