]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Enable batch mode when using HWRM_NVM_MODIFY to flash packages.
authorMichael Chan <michael.chan@broadcom.com>
Sun, 13 Dec 2020 11:51:46 +0000 (06:51 -0500)
committerJakub Kicinski <kuba@kernel.org>
Tue, 15 Dec 2020 02:52:44 +0000 (18:52 -0800)
commita2bc10f298e78cb910207060368ca065740a73aa
tree80aa07110e872daac1a41d57d09d5b925c9c858a
parent1c8c94c78fea2ce47e3b99ccb40a8ab265a83397
bnxt_en: Enable batch mode when using HWRM_NVM_MODIFY to flash packages.

The current scheme allocates a DMA buffer as big as the requested
firmware package file and DMAs the contents to firmware in one
operation.  The buffer size can be several hundred kilo bytes and
the driver may not be able to allocate the memory.  This will cause
firmware upgrade to fail.

Improve the scheme by using smaller DMA blocks and calling firmware to
DMA each block in a batch mode.  Older firmware can cause excessive
NVRAM erases if the block size is too small so we try to allocate a
256K buffer to begin with and size it down successively if we cannot
allocate the memory.

Reviewed-by: Edwin Peer <edwin.peer@broadcom.com>
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c