linux/Documentation
Jacob Keller 399e27dbbd ice: support immediate firmware activation via devlink reload
The ice hardware contains an embedded chip with firmware which can be
updated using devlink flash. The firmware which runs on this chip is
referred to as the Embedded Management Processor firmware (EMP
firmware).

Activating the new firmware image currently requires that the system be
rebooted. This is not ideal as rebooting the system can cause unwanted
downtime.

In practical terms, activating the firmware does not always require a
full system reboot. In many cases it is possible to activate the EMP
firmware immediately. There are a couple of different scenarios to
cover.

 * The EMP firmware itself can be reloaded by issuing a special update
   to the device called an Embedded Management Processor reset (EMP
   reset). This reset causes the device to reset and reload the EMP
   firmware.

 * PCI configuration changes are only reloaded after a cold PCIe reset.
   Unfortunately there is no generic way to trigger this for a PCIe
   device without a system reboot.

When performing a flash update, firmware is capable of responding with
some information about the specific update requirements.

The driver updates the flash by programming a secondary inactive bank
with the contents of the new image, and then issuing a command to
request to switch the active bank starting from the next load.

The response to the final command for updating the inactive NVM flash
bank includes an indication of the minimum reset required to fully
update the device. This can be one of the following:

 * A full power on is required
 * A cold PCIe reset is required
 * An EMP reset is required

The response to the command to switch flash banks includes an indication
of whether or not the firmware will allow an EMP reset request.

For most updates, an EMP reset is sufficient to load the new EMP
firmware without issues. In some cases, this reset is not sufficient
because the PCI configuration space has changed. When this could cause
incompatibility with the new EMP image, the firmware is capable of
rejecting the EMP reset request.

Add logic to ice_fw_update.c to handle the response data flash update
AdminQ commands.

For the reset level, issue a devlink status notification informing the
user of how to complete the update with a simple suggestion like
"Activate new firmware by rebooting the system".

Cache the status of whether or not firmware will restrict the EMP reset
for use in implementing devlink reload.

Implement support for devlink reload with the "fw_activate" flag. This
allows user space to request the firmware be activated immediately.

For the .reload_down handler, we will issue a request for the EMP reset
using the appropriate firmware AdminQ command. If we know that the
firmware will not allow an EMP reset, simply exit with a suitable
netlink extended ACK message indicating that the EMP reset is not
available.

For the .reload_up handler, simply wait until the driver has finished
resetting. Logic to handle processing of an EMP reset already exists in
the driver as part of its reset and rebuild flows.

Implement support for the devlink reload interface with the
"fw_activate" action. This allows userspace to request activation of
firmware without a reboot.

Note that support for indicating the required reset and EMP reset
restriction is not supported on old versions of firmware. The driver can
determine if the two features are supported by checking the device
capabilities report. I confirmed support has existed since at least
version 5.5.2 as reported by the 'fw.mgmt' version. Support to issue the
EMP reset request has existed in all version of the EMP firmware for the
ice hardware.

Check the device capabilities report to determine whether or not the
indications are reported by the running firmware. If the reset
requirement indication is not supported, always assume a full power on
is necessary. If the reset restriction capability is not supported,
always assume the EMP reset is available.

Users can verify if the EMP reset has activated the firmware by using
the devlink info report to check that the 'running' firmware version has
updated. For example a user might do the following:

 # Check current version
 $ devlink dev info

 # Update the device
 $ devlink dev flash pci/0000:af:00.0 file firmware.bin

 # Confirm stored version updated
 $ devlink dev info

 # Reload to activate new firmware
 $ devlink dev reload pci/0000:af:00.0 action fw_activate

 # Confirm running version updated
 $ devlink dev info

Finally, this change does *not* implement basic driver-only reload
support. I did look into trying to do this. However, it requires
significant refactor of how the ice driver probes and loads everything.
The ice driver probe and allocation flows were not designed with such
a reload in mind. Refactoring the flow to support this is beyond the
scope of this change.

Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Gurucharan G <gurucharanx.g@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
2021-12-15 08:40:38 -08:00
..
ABI f2fs-for-5.16-rc1 2021-11-13 11:20:22 -08:00
accounting
admin-guide A few important documentation fixes, including breakage that comes with 2021-12-06 10:46:20 -08:00
arm Documentation: arm: marvell: Fix link to armada_1000_pb.pdf document 2021-11-15 02:49:56 -07:00
arm64 arm64: update PAC description for kernel 2021-12-02 10:13:35 +00:00
block This is a relatively unexciting cycle for documentation. 2021-11-02 22:11:39 -07:00
bpf bpf, docs: Split general purpose eBPF documentation out of filter.rst 2021-11-30 10:52:11 -08:00
cdrom
core-api Merge branch 'akpm' (patches from Andrew) 2021-11-06 14:08:17 -07:00
cpu-freq cpufreq: docs: Update core.rst 2021-12-01 20:02:11 +01:00
crypto crypto: engine - Add KPP Support to Crypto Engine 2021-10-29 21:04:03 +08:00
dev-tools Merge branch 'akpm' (patches from Andrew) 2021-11-09 10:11:53 -08:00
devicetree dt-bindings: net: add Vertexcom MSE102x support 2021-12-13 14:15:41 +00:00
doc-guide docs: Update Sphinx requirements 2021-11-15 02:47:22 -07:00
driver-api cxl for v5.16 2021-11-08 11:49:48 -08:00
fault-injection
fb
features parisc: Move thread_info into task struct 2021-11-01 07:35:59 +01:00
filesystems netfs: Adjust docs after foliation 2021-11-29 10:10:26 -08:00
firmware_class
firmware-guide Documentation: ACPI: Fix non-D0 probe _DSC object example 2021-11-10 13:59:12 +01:00
fpga
gpu drm-misc-next for 5.16: 2021-11-05 13:50:15 +10:00
hid
hwmon Driver core changes for 5.16-rc1 2021-11-04 08:32:38 -07:00
i2c docs: i2c: smbus-protocol: mention the repeated start condition 2021-11-23 12:59:41 +01:00
ia64
ide
iio
infiniband
input
isdn
kbuild Kbuild updates for v5.16 2021-11-08 09:15:45 -08:00
kernel-hacking docs: futex: Fix kernel-doc references 2021-10-19 17:27:05 +02:00
leds leds: add new LED_FUNCTION_PLAYER for player LEDs for game controllers. 2021-10-27 09:49:29 +02:00
litmus-tests
livepatch
locking Documentation/locking/locktypes: Update migrate_disable() bits. 2021-11-30 15:40:31 +01:00
m68k
maintainer docs: use the lore redirector everywhere 2021-10-12 13:58:19 -06:00
mhi
mips
misc-devices
netlabel
networking ice: support immediate firmware activation via devlink reload 2021-12-15 08:40:38 -08:00
nios2
nvdimm
openrisc
parisc
PCI
pcmcia
power Documentation: power: Describe 'advanced' and 'simple' EM models 2021-11-10 21:26:34 +01:00
powerpc
process Documentation: Add minimum pahole version 2021-11-29 14:48:00 -07:00
RCU
riscv
s390
scheduler
scsi
security net,lsm,selinux: revert the security_sctp_assoc_established() hook 2021-11-14 12:21:53 +00:00
sh
sound ASoC: doc: update codec example code 2021-10-25 12:36:14 +01:00
sparc
sphinx
sphinx-static
spi
staging
target
timers
trace docs: ftrace: fix the wrong path of tracefs 2021-11-15 02:50:39 -07:00
translations doc/zh_CN: fix a translation error in management-style 2021-11-15 02:53:30 -07:00
usb
userspace-api Char/Misc driver update for 5.16-rc1 2021-11-04 08:21:47 -07:00
virt Merge branch 'kvm-sev-move-context' into kvm-master 2021-11-11 11:02:58 -05:00
vm mm/migrate.c: remove MIGRATE_PFN_LOCKED 2021-11-11 09:34:35 -08:00
w1
watchdog
x86 - Add the model number of a new, Raptor Lake CPU, to intel-family.h 2021-11-14 09:29:03 -08:00
xtensa
.gitignore
arch.rst
asm-annotations.rst docs: use the lore redirector everywhere 2021-10-12 13:58:19 -06:00
atomic_bitops.txt
atomic_t.txt
Changes
CodingStyle
conf.py docs: conf.py: fix support for Readthedocs v 1.0.0 2021-11-29 14:27:52 -07:00
COPYING-logo
docutils.conf
dontdiff
index.rst
Kconfig
logo.gif
Makefile
memory-barriers.txt
SubmittingPatches
watch_queue.rst