]> git.baikalelectronics.ru Git - kernel.git/commit
mlxsw: spectrum: Implement the ethtool flash_device callback
authorYotam Gigi <yotamg@mellanox.com>
Thu, 1 Jun 2017 13:26:46 +0000 (16:26 +0300)
committerDavid S. Miller <davem@davemloft.net>
Thu, 1 Jun 2017 16:25:41 +0000 (12:25 -0400)
commitd358d74b82ede5f3559a9194b326c3a6136c6cba
tree938411cbf6d3b09aa4dc466d3fc54d01af656053
parent3f6feb7b057c467270dd72e6461130aef60bcf75
mlxsw: spectrum: Implement the ethtool flash_device callback

Add callback to the ethtool flash_device op. This callback uses the mlxfw
module to flash the new firmware file to the device.

As the firmware flash process takes about 20 seconds and ethtool takes the
rtnl lock during the flash_device callback, release the rtnl lock at the
beginning of the flash process and take it again before leaving the
callback. This way, the rtnl is not held during the process. To make sure
the device does not get deleted during the flash process, take a reference
to it before releasing the rtnl lock.

Signed-off-by: Yotam Gigi <yotamg@mellanox.com>
Reviewed-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum.c