Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bnx2: Try to recover from PCI block reset

If the PCI block has reset, the memory enable bit will be reset and
the device will not respond to MMIO access. bnx2_reset_task() currently
will not recover when this happens. Add code to detect this condition
and restore the PCI state. This scenario has been reported by some
users.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Michael Chan and committed by
David S. Miller
efdfad32 aed93e0b

+7
+7
drivers/net/ethernet/broadcom/bnx2.c
··· 6388 6388 { 6389 6389 struct bnx2 *bp = container_of(work, struct bnx2, reset_task); 6390 6390 int rc; 6391 + u16 pcicmd; 6391 6392 6392 6393 rtnl_lock(); 6393 6394 if (!netif_running(bp->dev)) { ··· 6398 6397 6399 6398 bnx2_netif_stop(bp, true); 6400 6399 6400 + pci_read_config_word(bp->pdev, PCI_COMMAND, &pcicmd); 6401 + if (!(pcicmd & PCI_COMMAND_MEMORY)) { 6402 + /* in case PCI block has reset */ 6403 + pci_restore_state(bp->pdev); 6404 + pci_save_state(bp->pdev); 6405 + } 6401 6406 rc = bnx2_init_nic(bp, 1); 6402 6407 if (rc) { 6403 6408 netdev_err(bp->dev, "failed to reset NIC, closing\n");