ice: increase maximum wait time for flash write commands
authorJacob Keller <jacob.e.keller@intel.com>
Wed, 26 Aug 2020 18:30:34 +0000 (11:30 -0700)
committerTony Nguyen <anthony.l.nguyen@intel.com>
Wed, 30 Sep 2020 15:32:35 +0000 (08:32 -0700)
commit0ec86e8e82b57cfb2f83a9de14732002816d3282
tree2150cd0f6f662bbcc10d38e3238173027180dc6e
parent2b3e981a94d876ae4f05db28b9ac6a85a80c7633
ice: increase maximum wait time for flash write commands

The ice driver needs to wait for a firmware response to each command to
write a block of data to the scratch area used to update the device
firmware. The driver currently waits for up to 1 second for this to be
returned.

It turns out that firmware might take longer than 1 second to return
a completion in some cases. If this happens, the flash update will fail
to complete.

Fix this by increasing the maximum time that the driver will wait for
both writing a block of data, and for activating the new NVM bank. The
timeout for an erase command is already several minutes, as the firmware
had to erase the entire bank which was already expected to take a minute
or more in the worst case.

In the case where firmware really won't respond, we will now take longer
to fail. However, this ensures that if the firmware is simply slow to
respond, the flash update can still complete. This new maximum timeout
should not adversely increase the update time, as the implementation for
wait_event_interruptible_timeout, and should wake very soon after we get
a completion event. It is better for a flash update be slow but still
succeed than to fail because we gave up too quickly.

Fixes: d69ea414c9b4 ("ice: implement device flash update via devlink")
Signed-off-by: Jacob Keller <jacob.e.keller@intel.com>
Tested-by: Brijesh Behera <brijeshx.behera@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
drivers/net/ethernet/intel/ice/ice_fw_update.c