]> git.baikalelectronics.ru Git - kernel.git/commit
bnxt_en: Fix logic that disables Bus Master during firmware reset.
authorVasundhara Volam <vasundhara-v.volam@broadcom.com>
Sun, 2 Feb 2020 07:41:37 +0000 (02:41 -0500)
committerJakub Kicinski <kuba@kernel.org>
Mon, 3 Feb 2020 23:06:45 +0000 (15:06 -0800)
commit0c3017ff8032c8628f47483830319e126cbcbced
tree5e0730752b564b950334245964ea9ad3a95db9bc
parent5bcd7cbb1479180a1eda05a0db4de733b279fb33
bnxt_en: Fix logic that disables Bus Master during firmware reset.

The current logic that calls pci_disable_device() in __bnxt_close_nic()
during firmware reset is flawed.  If firmware is still alive, we're
disabling the device too early, causing some firmware commands to
not reach the firmware.

Fix it by moving the logic to bnxt_reset_close().  If firmware is
in fatal condition, we call pci_disable_device() before we free
any of the rings to prevent DMA corruption of the freed rings.  If
firmware is still alive, we call pci_disable_device() after the
last firmware message has been sent.

Fixes: e2bc378ede3a ("bnxt_en: Add BNXT_STATE_IN_FW_RESET state.")
Signed-off-by: Vasundhara Volam <vasundhara-v.volam@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.c