1 // SPDX-License-Identifier: GPL-2.0
2 /* Copyright (C) 2018-2019, Intel Corporation. */
4 #include <asm/unaligned.h>
5 #include <linux/uuid.h>
6 #include <linux/crc32.h>
7 #include <linux/pldmfw.h>
9 #include "ice_fw_update.h"
12 struct pldmfw context;
15 struct netlink_ext_ack *extack;
17 /* Track which NVM banks to activate at the end of the update */
22 * ice_send_package_data - Send record package data to firmware
23 * @context: PLDM fw update structure
24 * @data: pointer to the package data
25 * @length: length of the package data
27 * Send a copy of the package data associated with the PLDM record matching
28 * this device to the firmware.
30 * Note that this function sends an AdminQ command that will fail unless the
31 * NVM resource has been acquired.
33 * Returns: zero on success, or a negative error code on failure.
36 ice_send_package_data(struct pldmfw *context, const u8 *data, u16 length)
38 struct ice_fwu_priv *priv = container_of(context, struct ice_fwu_priv, context);
39 struct netlink_ext_ack *extack = priv->extack;
40 struct device *dev = context->dev;
41 struct ice_pf *pf = priv->pf;
42 struct ice_hw *hw = &pf->hw;
43 enum ice_status status;
46 package_data = kmemdup(data, length, GFP_KERNEL);
50 status = ice_nvm_set_pkg_data(hw, false, package_data, length, NULL);
55 dev_err(dev, "Failed to send record package data to firmware, err %s aq_err %s\n",
57 ice_aq_str(hw->adminq.sq_last_status));
58 NL_SET_ERR_MSG_MOD(extack, "Failed to record package data to firmware");
66 * ice_check_component_response - Report firmware response to a component
67 * @pf: device private data structure
68 * @id: component id being checked
69 * @response: indicates whether this component can be updated
70 * @code: code indicating reason for response
71 * @extack: netlink extended ACK structure
73 * Check whether firmware indicates if this component can be updated. Report
74 * a suitable error message over the netlink extended ACK if the component
77 * Returns: zero if the component can be updated, or -ECANCELED of the
78 * firmware indicates the component cannot be updated.
81 ice_check_component_response(struct ice_pf *pf, u16 id, u8 response, u8 code,
82 struct netlink_ext_ack *extack)
84 struct device *dev = ice_pf_to_dev(pf);
85 const char *component;
88 case NVM_COMP_ID_OROM:
89 component = "fw.undi";
92 component = "fw.mgmt";
94 case NVM_COMP_ID_NETLIST:
95 component = "fw.netlist";
98 WARN(1, "Unexpected unknown component identifier 0x%02x", id);
102 dev_dbg(dev, "%s: firmware response 0x%x, code 0x%x\n",
103 component, response, code);
106 case ICE_AQ_NVM_PASS_COMP_CAN_BE_UPDATED:
107 /* firmware indicated this update is good to proceed */
109 case ICE_AQ_NVM_PASS_COMP_CAN_MAY_BE_UPDATEABLE:
110 dev_warn(dev, "firmware recommends not updating %s, as it may result in a downgrade. continuing anyways\n", component);
112 case ICE_AQ_NVM_PASS_COMP_CAN_NOT_BE_UPDATED:
113 dev_info(dev, "firmware has rejected updating %s\n", component);
118 case ICE_AQ_NVM_PASS_COMP_STAMP_IDENTICAL_CODE:
119 dev_err(dev, "Component comparison stamp for %s is identical to the running image\n",
121 NL_SET_ERR_MSG_MOD(extack, "Component comparison stamp is identical to running image");
123 case ICE_AQ_NVM_PASS_COMP_STAMP_LOWER:
124 dev_err(dev, "Component comparison stamp for %s is lower than the running image\n",
126 NL_SET_ERR_MSG_MOD(extack, "Component comparison stamp is lower than running image");
128 case ICE_AQ_NVM_PASS_COMP_INVALID_STAMP_CODE:
129 dev_err(dev, "Component comparison stamp for %s is invalid\n",
131 NL_SET_ERR_MSG_MOD(extack, "Component comparison stamp is invalid");
133 case ICE_AQ_NVM_PASS_COMP_CONFLICT_CODE:
134 dev_err(dev, "%s conflicts with a previous component table\n",
136 NL_SET_ERR_MSG_MOD(extack, "Component table conflict occurred");
138 case ICE_AQ_NVM_PASS_COMP_PRE_REQ_NOT_MET_CODE:
139 dev_err(dev, "Pre-requisites for component %s have not been met\n",
141 NL_SET_ERR_MSG_MOD(extack, "Component pre-requisites not met");
143 case ICE_AQ_NVM_PASS_COMP_NOT_SUPPORTED_CODE:
144 dev_err(dev, "%s is not a supported component\n",
146 NL_SET_ERR_MSG_MOD(extack, "Component not supported");
148 case ICE_AQ_NVM_PASS_COMP_CANNOT_DOWNGRADE_CODE:
149 dev_err(dev, "Security restrictions prevent %s from being downgraded\n",
151 NL_SET_ERR_MSG_MOD(extack, "Component cannot be downgraded");
153 case ICE_AQ_NVM_PASS_COMP_INCOMPLETE_IMAGE_CODE:
154 dev_err(dev, "Received an incomplete component image for %s\n",
156 NL_SET_ERR_MSG_MOD(extack, "Incomplete component image");
158 case ICE_AQ_NVM_PASS_COMP_VER_STR_IDENTICAL_CODE:
159 dev_err(dev, "Component version for %s is identical to the running image\n",
161 NL_SET_ERR_MSG_MOD(extack, "Component version is identical to running image");
163 case ICE_AQ_NVM_PASS_COMP_VER_STR_LOWER_CODE:
164 dev_err(dev, "Component version for %s is lower than the running image\n",
166 NL_SET_ERR_MSG_MOD(extack, "Component version is lower than the running image");
169 dev_err(dev, "Unexpected response code 0x02%x for %s\n",
171 NL_SET_ERR_MSG_MOD(extack, "Received unexpected response code from firmware");
179 * ice_send_component_table - Send PLDM component table to firmware
180 * @context: PLDM fw update structure
181 * @component: the component to process
182 * @transfer_flag: relative transfer order of this component
184 * Read relevant data from the component and forward it to the device
185 * firmware. Check the response to determine if the firmware indicates that
186 * the update can proceed.
188 * This function sends AdminQ commands related to the NVM, and assumes that
189 * the NVM resource has been acquired.
191 * Returns: zero on success, or a negative error code on failure.
194 ice_send_component_table(struct pldmfw *context, struct pldmfw_component *component,
197 struct ice_fwu_priv *priv = container_of(context, struct ice_fwu_priv, context);
198 struct netlink_ext_ack *extack = priv->extack;
199 struct ice_aqc_nvm_comp_tbl *comp_tbl;
200 u8 comp_response, comp_response_code;
201 struct device *dev = context->dev;
202 struct ice_pf *pf = priv->pf;
203 struct ice_hw *hw = &pf->hw;
204 enum ice_status status;
207 switch (component->identifier) {
208 case NVM_COMP_ID_OROM:
209 case NVM_COMP_ID_NVM:
210 case NVM_COMP_ID_NETLIST:
213 dev_err(dev, "Unable to update due to a firmware component with unknown ID %u\n",
214 component->identifier);
215 NL_SET_ERR_MSG_MOD(extack, "Unable to update due to unknown firmware component");
219 length = struct_size(comp_tbl, cvs, component->version_len);
220 comp_tbl = kzalloc(length, GFP_KERNEL);
224 comp_tbl->comp_class = cpu_to_le16(component->classification);
225 comp_tbl->comp_id = cpu_to_le16(component->identifier);
226 comp_tbl->comp_class_idx = FWU_COMP_CLASS_IDX_NOT_USE;
227 comp_tbl->comp_cmp_stamp = cpu_to_le32(component->comparison_stamp);
228 comp_tbl->cvs_type = component->version_type;
229 comp_tbl->cvs_len = component->version_len;
230 memcpy(comp_tbl->cvs, component->version_string, component->version_len);
232 status = ice_nvm_pass_component_tbl(hw, (u8 *)comp_tbl, length,
233 transfer_flag, &comp_response,
234 &comp_response_code, NULL);
239 dev_err(dev, "Failed to transfer component table to firmware, err %s aq_err %s\n",
240 ice_stat_str(status),
241 ice_aq_str(hw->adminq.sq_last_status));
242 NL_SET_ERR_MSG_MOD(extack, "Failed to transfer component table to firmware");
246 return ice_check_component_response(pf, component->identifier, comp_response,
247 comp_response_code, extack);
251 * ice_write_one_nvm_block - Write an NVM block and await completion response
252 * @pf: the PF data structure
253 * @module: the module to write to
254 * @offset: offset in bytes
255 * @block_size: size of the block to write, up to 4k
256 * @block: pointer to block of data to write
257 * @last_cmd: whether this is the last command
258 * @extack: netlink extended ACK structure
260 * Write a block of data to a flash module, and await for the completion
261 * response message from firmware.
263 * Note this function assumes the caller has acquired the NVM resource.
265 * Returns: zero on success, or a negative error code on failure.
268 ice_write_one_nvm_block(struct ice_pf *pf, u16 module, u32 offset,
269 u16 block_size, u8 *block, bool last_cmd,
270 struct netlink_ext_ack *extack)
272 u16 completion_module, completion_retval;
273 struct device *dev = ice_pf_to_dev(pf);
274 struct ice_rq_event_info event;
275 struct ice_hw *hw = &pf->hw;
276 enum ice_status status;
277 u32 completion_offset;
280 memset(&event, 0, sizeof(event));
282 status = ice_aq_update_nvm(hw, module, offset, block_size, block,
285 dev_err(dev, "Failed to program flash module 0x%02x at offset %u, err %s aq_err %s\n",
286 module, offset, ice_stat_str(status),
287 ice_aq_str(hw->adminq.sq_last_status));
288 NL_SET_ERR_MSG_MOD(extack, "Failed to program flash module");
292 /* In most cases, firmware reports a write completion within a few
293 * milliseconds. However, it has been observed that a completion might
294 * take more than a second to complete in some cases. The timeout here
295 * is conservative and is intended to prevent failure to update when
296 * firmware is slow to respond.
298 err = ice_aq_wait_for_event(pf, ice_aqc_opc_nvm_write, 15 * HZ, &event);
300 dev_err(dev, "Timed out waiting for firmware write completion for module 0x%02x, err %d\n",
302 NL_SET_ERR_MSG_MOD(extack, "Timed out waiting for firmware");
306 completion_module = le16_to_cpu(event.desc.params.nvm.module_typeid);
307 completion_retval = le16_to_cpu(event.desc.retval);
309 completion_offset = le16_to_cpu(event.desc.params.nvm.offset_low);
310 completion_offset |= event.desc.params.nvm.offset_high << 16;
312 if (completion_module != module) {
313 dev_err(dev, "Unexpected module_typeid in write completion: got 0x%x, expected 0x%x\n",
314 completion_module, module);
315 NL_SET_ERR_MSG_MOD(extack, "Unexpected firmware response");
319 if (completion_offset != offset) {
320 dev_err(dev, "Unexpected offset in write completion: got %u, expected %u\n",
321 completion_offset, offset);
322 NL_SET_ERR_MSG_MOD(extack, "Unexpected firmware response");
326 if (completion_retval) {
327 dev_err(dev, "Firmware failed to program flash module 0x%02x at offset %u, completion err %s\n",
329 ice_aq_str((enum ice_aq_err)completion_retval));
330 NL_SET_ERR_MSG_MOD(extack, "Firmware failed to program flash module");
338 * ice_write_nvm_module - Write data to an NVM module
339 * @pf: the PF driver structure
340 * @module: the module id to program
341 * @component: the name of the component being updated
342 * @image: buffer of image data to write to the NVM
343 * @length: length of the buffer
344 * @extack: netlink extended ACK structure
346 * Loop over the data for a given NVM module and program it in 4 Kb
347 * blocks. Notify devlink core of progress after each block is programmed.
348 * Loops over a block of data and programs the NVM in 4k block chunks.
350 * Note this function assumes the caller has acquired the NVM resource.
352 * Returns: zero on success, or a negative error code on failure.
355 ice_write_nvm_module(struct ice_pf *pf, u16 module, const char *component,
356 const u8 *image, u32 length,
357 struct netlink_ext_ack *extack)
359 struct devlink *devlink;
365 devlink = priv_to_devlink(pf);
367 devlink_flash_update_status_notify(devlink, "Flashing",
368 component, 0, length);
370 block = kzalloc(ICE_AQ_MAX_BUF_LEN, GFP_KERNEL);
377 block_size = min_t(u32, ICE_AQ_MAX_BUF_LEN, length - offset);
378 last_cmd = !(offset + block_size < length);
380 /* ice_aq_update_nvm may copy the firmware response into the
381 * buffer, so we must make a copy since the source data is
384 memcpy(block, image + offset, block_size);
386 err = ice_write_one_nvm_block(pf, module, offset, block_size,
387 block, last_cmd, extack);
391 offset += block_size;
393 devlink_flash_update_status_notify(devlink, "Flashing",
394 component, offset, length);
398 devlink_flash_update_status_notify(devlink, "Flashing failed",
399 component, length, length);
401 devlink_flash_update_status_notify(devlink, "Flashing done",
402 component, length, length);
409 * ice_erase_nvm_module - Erase an NVM module and await firmware completion
410 * @pf: the PF data structure
411 * @module: the module to erase
412 * @component: name of the component being updated
413 * @extack: netlink extended ACK structure
415 * Erase the inactive NVM bank associated with this module, and await for
416 * a completion response message from firmware.
418 * Note this function assumes the caller has acquired the NVM resource.
420 * Returns: zero on success, or a negative error code on failure.
423 ice_erase_nvm_module(struct ice_pf *pf, u16 module, const char *component,
424 struct netlink_ext_ack *extack)
426 u16 completion_module, completion_retval;
427 struct device *dev = ice_pf_to_dev(pf);
428 struct ice_rq_event_info event;
429 struct ice_hw *hw = &pf->hw;
430 struct devlink *devlink;
431 enum ice_status status;
434 memset(&event, 0, sizeof(event));
436 devlink = priv_to_devlink(pf);
438 devlink_flash_update_status_notify(devlink, "Erasing", component, 0, 0);
440 status = ice_aq_erase_nvm(hw, module, NULL);
442 dev_err(dev, "Failed to erase %s (module 0x%02x), err %s aq_err %s\n",
443 component, module, ice_stat_str(status),
444 ice_aq_str(hw->adminq.sq_last_status));
445 NL_SET_ERR_MSG_MOD(extack, "Failed to erase flash module");
447 goto out_notify_devlink;
450 /* Yes, this really can take minutes to complete */
451 err = ice_aq_wait_for_event(pf, ice_aqc_opc_nvm_erase, 300 * HZ, &event);
453 dev_err(dev, "Timed out waiting for firmware to respond with erase completion for %s (module 0x%02x), err %d\n",
454 component, module, err);
455 NL_SET_ERR_MSG_MOD(extack, "Timed out waiting for firmware");
456 goto out_notify_devlink;
459 completion_module = le16_to_cpu(event.desc.params.nvm.module_typeid);
460 completion_retval = le16_to_cpu(event.desc.retval);
462 if (completion_module != module) {
463 dev_err(dev, "Unexpected module_typeid in erase completion for %s: got 0x%x, expected 0x%x\n",
464 component, completion_module, module);
465 NL_SET_ERR_MSG_MOD(extack, "Unexpected firmware response");
467 goto out_notify_devlink;
470 if (completion_retval) {
471 dev_err(dev, "Firmware failed to erase %s (module 0x02%x), aq_err %s\n",
473 ice_aq_str((enum ice_aq_err)completion_retval));
474 NL_SET_ERR_MSG_MOD(extack, "Firmware failed to erase flash");
476 goto out_notify_devlink;
481 devlink_flash_update_status_notify(devlink, "Erasing failed",
484 devlink_flash_update_status_notify(devlink, "Erasing done",
491 * ice_switch_flash_banks - Tell firmware to switch NVM banks
492 * @pf: Pointer to the PF data structure
493 * @activate_flags: flags used for the activation command
494 * @extack: netlink extended ACK structure
496 * Notify firmware to activate the newly written flash banks, and wait for the
499 * Returns: zero on success or an error code on failure.
501 static int ice_switch_flash_banks(struct ice_pf *pf, u8 activate_flags,
502 struct netlink_ext_ack *extack)
504 struct device *dev = ice_pf_to_dev(pf);
505 struct ice_rq_event_info event;
506 struct ice_hw *hw = &pf->hw;
507 enum ice_status status;
508 u16 completion_retval;
511 memset(&event, 0, sizeof(event));
513 status = ice_nvm_write_activate(hw, activate_flags);
515 dev_err(dev, "Failed to switch active flash banks, err %s aq_err %s\n",
516 ice_stat_str(status),
517 ice_aq_str(hw->adminq.sq_last_status));
518 NL_SET_ERR_MSG_MOD(extack, "Failed to switch active flash banks");
522 err = ice_aq_wait_for_event(pf, ice_aqc_opc_nvm_write_activate, 30 * HZ,
525 dev_err(dev, "Timed out waiting for firmware to switch active flash banks, err %d\n",
527 NL_SET_ERR_MSG_MOD(extack, "Timed out waiting for firmware");
531 completion_retval = le16_to_cpu(event.desc.retval);
532 if (completion_retval) {
533 dev_err(dev, "Firmware failed to switch active flash banks aq_err %s\n",
534 ice_aq_str((enum ice_aq_err)completion_retval));
535 NL_SET_ERR_MSG_MOD(extack, "Firmware failed to switch active flash banks");
543 * ice_flash_component - Flash a component of the NVM
544 * @context: PLDM fw update structure
545 * @component: the component table to program
547 * Program the flash contents for a given component. First, determine the
548 * module id. Then, erase the secondary bank for this module. Finally, write
549 * the contents of the component to the NVM.
551 * Note this function assumes the caller has acquired the NVM resource.
553 * Returns: zero on success, or a negative error code on failure.
556 ice_flash_component(struct pldmfw *context, struct pldmfw_component *component)
558 struct ice_fwu_priv *priv = container_of(context, struct ice_fwu_priv, context);
559 struct netlink_ext_ack *extack = priv->extack;
560 struct ice_pf *pf = priv->pf;
566 switch (component->identifier) {
567 case NVM_COMP_ID_OROM:
568 module = ICE_SR_1ST_OROM_BANK_PTR;
569 flag = ICE_AQC_NVM_ACTIV_SEL_OROM;
572 case NVM_COMP_ID_NVM:
573 module = ICE_SR_1ST_NVM_BANK_PTR;
574 flag = ICE_AQC_NVM_ACTIV_SEL_NVM;
577 case NVM_COMP_ID_NETLIST:
578 module = ICE_SR_NETLIST_BANK_PTR;
579 flag = ICE_AQC_NVM_ACTIV_SEL_NETLIST;
583 /* This should not trigger, since we check the id before
584 * sending the component table to firmware.
586 WARN(1, "Unexpected unknown component identifier 0x%02x",
587 component->identifier);
591 /* Mark this component for activating at the end */
592 priv->activate_flags |= flag;
594 err = ice_erase_nvm_module(pf, module, name, extack);
598 return ice_write_nvm_module(pf, module, name, component->component_data,
599 component->component_size, extack);
603 * ice_finalize_update - Perform last steps to complete device update
604 * @context: PLDM fw update structure
606 * Called as the last step of the update process. Complete the update by
607 * telling the firmware to switch active banks, and perform a reset of
610 * Returns: 0 on success, or an error code on failure.
612 static int ice_finalize_update(struct pldmfw *context)
614 struct ice_fwu_priv *priv = container_of(context, struct ice_fwu_priv, context);
615 struct netlink_ext_ack *extack = priv->extack;
616 struct ice_pf *pf = priv->pf;
619 /* Finally, notify firmware to activate the written NVM banks */
620 err = ice_switch_flash_banks(pf, priv->activate_flags, extack);
627 static const struct pldmfw_ops ice_fwu_ops = {
628 .match_record = &pldmfw_op_pci_match_record,
629 .send_package_data = &ice_send_package_data,
630 .send_component_table = &ice_send_component_table,
631 .flash_component = &ice_flash_component,
632 .finalize_update = &ice_finalize_update,
636 * ice_flash_pldm_image - Write a PLDM-formatted firmware image to the device
637 * @pf: private device driver structure
638 * @fw: firmware object pointing to the relevant firmware file
639 * @extack: netlink extended ACK structure
641 * Parse the data for a given firmware file, verifying that it is a valid PLDM
642 * formatted image that matches this device.
644 * Extract the device record Package Data and Component Tables and send them
645 * to the firmware. Extract and write the flash data for each of the three
646 * main flash components, "fw.mgmt", "fw.undi", and "fw.netlist". Notify
647 * firmware once the data is written to the inactive banks.
649 * Returns: zero on success or a negative error code on failure.
651 int ice_flash_pldm_image(struct ice_pf *pf, const struct firmware *fw,
652 struct netlink_ext_ack *extack)
654 struct device *dev = ice_pf_to_dev(pf);
655 struct ice_hw *hw = &pf->hw;
656 struct ice_fwu_priv priv;
657 enum ice_status status;
660 memset(&priv, 0, sizeof(priv));
662 priv.context.ops = &ice_fwu_ops;
663 priv.context.dev = dev;
664 priv.extack = extack;
666 priv.activate_flags = ICE_AQC_NVM_PRESERVE_ALL;
668 status = ice_acquire_nvm(hw, ICE_RES_WRITE);
670 dev_err(dev, "Failed to acquire device flash lock, err %s aq_err %s\n",
671 ice_stat_str(status),
672 ice_aq_str(hw->adminq.sq_last_status));
673 NL_SET_ERR_MSG_MOD(extack, "Failed to acquire device flash lock");
677 err = pldmfw_flash_image(&priv.context, fw);
685 * ice_check_for_pending_update - Check for a pending flash update
686 * @pf: the PF driver structure
687 * @component: if not NULL, the name of the component being updated
688 * @extack: Netlink extended ACK structure
690 * Check whether the device already has a pending flash update. If such an
691 * update is found, cancel it so that the requested update may proceed.
693 * Returns: zero on success, or a negative error code on failure.
695 int ice_check_for_pending_update(struct ice_pf *pf, const char *component,
696 struct netlink_ext_ack *extack)
698 struct devlink *devlink = priv_to_devlink(pf);
699 struct device *dev = ice_pf_to_dev(pf);
700 struct ice_hw_dev_caps *dev_caps;
701 struct ice_hw *hw = &pf->hw;
702 enum ice_status status;
706 dev_caps = kzalloc(sizeof(*dev_caps), GFP_KERNEL);
710 /* Read the most recent device capabilities from firmware. Do not use
711 * the cached values in hw->dev_caps, because the pending update flag
712 * may have changed, e.g. if an update was previously completed and
713 * the system has not yet rebooted.
715 status = ice_discover_dev_caps(hw, dev_caps);
717 NL_SET_ERR_MSG_MOD(extack, "Unable to read device capabilities");
722 if (dev_caps->common_cap.nvm_update_pending_nvm) {
723 dev_info(dev, "The fw.mgmt flash component has a pending update\n");
724 pending |= ICE_AQC_NVM_ACTIV_SEL_NVM;
727 if (dev_caps->common_cap.nvm_update_pending_orom) {
728 dev_info(dev, "The fw.undi flash component has a pending update\n");
729 pending |= ICE_AQC_NVM_ACTIV_SEL_OROM;
732 if (dev_caps->common_cap.nvm_update_pending_netlist) {
733 dev_info(dev, "The fw.netlist flash component has a pending update\n");
734 pending |= ICE_AQC_NVM_ACTIV_SEL_NETLIST;
739 /* If the flash_update request is for a specific component, ignore all
740 * of the other components.
743 if (strcmp(component, "fw.mgmt") == 0)
744 pending &= ICE_AQC_NVM_ACTIV_SEL_NVM;
745 else if (strcmp(component, "fw.undi") == 0)
746 pending &= ICE_AQC_NVM_ACTIV_SEL_OROM;
747 else if (strcmp(component, "fw.netlist") == 0)
748 pending &= ICE_AQC_NVM_ACTIV_SEL_NETLIST;
750 WARN(1, "Unexpected flash component %s", component);
753 /* There is no previous pending update, so this request may continue */
757 /* In order to allow overwriting a previous pending update, notify
758 * firmware to cancel that update by issuing the appropriate command.
760 devlink_flash_update_status_notify(devlink,
761 "Canceling previous pending update",
764 status = ice_acquire_nvm(hw, ICE_RES_WRITE);
766 dev_err(dev, "Failed to acquire device flash lock, err %s aq_err %s\n",
767 ice_stat_str(status),
768 ice_aq_str(hw->adminq.sq_last_status));
769 NL_SET_ERR_MSG_MOD(extack, "Failed to acquire device flash lock");
773 pending |= ICE_AQC_NVM_REVERT_LAST_ACTIV;
774 err = ice_switch_flash_banks(pf, pending, extack);