]> Pileus Git - ~andy/linux/commit
tg3: Prevent system hang during repeated EEH errors.
authorMichael Chan <mchan@broadcom.com>
Mon, 17 Jun 2013 20:47:25 +0000 (13:47 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 17 Jun 2013 23:02:19 +0000 (16:02 -0700)
commit72bb72b0d98847d22c6fae4e170121f3640f0f60
treea9fe45e7b5e65c86d4b9ad8299eae2cc40ebac15
parentc7b67aef0fa5f665ca47f45d254e806e919d01ac
tg3: Prevent system hang during repeated EEH errors.

The current tg3 code assumes the pci_error_handlers to be always called
in sequence.  In particular, during ->error_detected(), NAPI is disabled
and the device is shutdown.  The device is later reset and NAPI
re-enabled in ->slot_reset() and ->resume().

In EEH, if more than 6 errors are detected in a hour, only
->error_detected() will be called.  This will leave the driver in an
inconsistent state as NAPI is disabled but netif_running state is still
true.  When the device is later closed, we'll try to disable NAPI again
and it will loop forever.

We fix this by closing the device if we encounter any error conditions
during the normal sequence of the pci_error_handlers.

v2: Remove the changes in tg3_io_resume() based on Benjamin Poirier's
    feedback.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/broadcom/tg3.c