bnxt_en: Disable bus master during PCI shutdown and driver unload.
authorMichael Chan <michael.chan@broadcom.com>
Sat, 29 Jun 2019 15:16:44 +0000 (11:16 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 26 Jul 2019 07:10:42 +0000 (09:10 +0200)
commit9935cc5df1c52a194d76acc1c3e8880e359a3268
tree584cf5cc4fc0749794b9a160a7ddc1ef31435512
parent6ea320766c8be9f50694a97ae3dbfa86b7739476
bnxt_en: Disable bus master during PCI shutdown and driver unload.

[ Upstream commit c20dc142dd7b2884b8570eeab323bcd4a84294fa ]

Some chips with older firmware can continue to perform DMA read from
context memory even after the memory has been freed.  In the PCI shutdown
method, we need to call pci_disable_device() to shutdown DMA to prevent
this DMA before we put the device into D3hot.  DMA memory request in
D3hot state will generate PCI fatal error.  Similarly, in the driver
remove method, the context memory should only be freed after DMA has
been shutdown for correctness.

Fixes: 98f04cf0f1fc ("bnxt_en: Check context memory requirements from firmware.")
Signed-off-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/broadcom/bnxt/bnxt.c