Skip to content

Commit

Permalink
tg3: driver sleeps indefinitely when EEH errors exceed eeh_max_freezes
Browse files Browse the repository at this point in the history
[ Upstream commit 3a2656a ]

The driver function tg3_io_error_detected() calls napi_disable twice,
without an intervening napi_enable, when the number of EEH errors exceeds
eeh_max_freezes, resulting in an indefinite sleep while holding rtnl_lock.

Add check for pcierr_recovery which skips code already executed for the
"Frozen" state.

Signed-off-by: David Christensen <drc@linux.vnet.ibm.com>
Reviewed-by: Michael Chan <michael.chan@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
drchristensen authored and 0x011011110 committed Jul 4, 2020
1 parent ff41192 commit 5aa1a02
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/broadcom/tg3.c
Original file line number Diff line number Diff line change
Expand Up @@ -18170,8 +18170,8 @@ static pci_ers_result_t tg3_io_error_detected(struct pci_dev *pdev,

rtnl_lock();

/* We probably don't have netdev yet */
if (!netdev || !netif_running(netdev))
/* Could be second call or maybe we don't have netdev yet */
if (!netdev || tp->pcierr_recovery || !netif_running(netdev))
goto done;

/* We needn't recover from permanent error */
Expand Down

0 comments on commit 5aa1a02

Please sign in to comment.