Merge branch 'ionic-add-devlink-dev-flash-support'
authorDavid S. Miller <davem@davemloft.net>
Fri, 18 Sep 2020 20:54:23 +0000 (13:54 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 18 Sep 2020 20:54:23 +0000 (13:54 -0700)
Shannon Nelson says:

====================
ionic: add devlink dev flash support

Add support for using devlink's dev flash facility to update the
firmware on an ionic device, and add a new timeout parameter to the
devlink flash netlink message.

For long-running flash commands, we add a timeout element to the dev
flash notify message in order for a userland utility to display a timeout
deadline to the user.  This allows the userland utility to display a
count down to the user when a firmware update action is otherwise going
to go for ahile without any updates.  An example use is added to the
netdevsim module.

The ionic driver uses this timeout element in its new flash function.
The driver uses a simple model of pushing the firmware file to the NIC,
asking the NIC to unpack and install the file into the device, and then
selecting it for the next boot.  If any of these steps fail, the whole
transaction is failed.  A couple of the steps can take a long time,
so we use the timeout status message rather than faking it with bogus
done/total messages.

The driver doesn't currently support doing these steps individually.
In the future we want to be able to list the FW that is installed and
selectable but we don't yet have the API to fully support that.

v5: pulled the cmd field back out of the new params struct
    changed netdevsim example message to "Flash select"

v4: Added a new devlink status notify message for showing timeout
    information, and modified the ionic fw update to use it for its long
    running firmware commands.

v3: Changed long dev_cmd timeout on status check calls to a loop around
    calls with a normal timeout, which allows for more intermediate log
    messaging when in a long wait, and for letting other threads run
    dev_cmds if waiting.

v2: Changed "Activate" to "Select" in status messages.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>

Trivial merge