All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] net/qlge: Avoids recursive EEH error
@ 2016-05-23  1:58 Gavin Shan
  2016-05-24 21:48 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Gavin Shan @ 2016-05-23  1:58 UTC (permalink / raw)
  To: netdev; +Cc: harish.patil, sudarsana.kalluru, davem, shriyakul, Gavin Shan

One timer, whose handler keeps reading on MMIO register for EEH
core to detect error in time, is started when the PCI device driver
is loaded. MMIO register can't be accessed during PE reset in EEH
recovery. Otherwise, the unexpected recursive error is triggered.
The timer isn't closed that time if the interface isn't brought
up. So the unexpected recursive error is seen during EEH recovery
when the interface is down.

This avoids the unexpected recursive EEH error by closing the timer
in qlge_io_error_detected() before EEH PE reset unconditionally. The
timer is started unconditionally after EEH PE reset in qlge_io_resume().
Also, the timer should be closed unconditionally when the device is
removed from the system permanently in qlge_io_error_detected().

Reported-by: Shriya R. Kulkarni <shriyakul@in.ibm.com>
Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
---
 drivers/net/ethernet/qlogic/qlge/qlge_main.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/qlogic/qlge/qlge_main.c b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
index 83d7210..fd5d1c9 100644
--- a/drivers/net/ethernet/qlogic/qlge/qlge_main.c
+++ b/drivers/net/ethernet/qlogic/qlge/qlge_main.c
@@ -4846,7 +4846,6 @@ static void ql_eeh_close(struct net_device *ndev)
 	}
 
 	/* Disabling the timer */
-	del_timer_sync(&qdev->timer);
 	ql_cancel_all_work_sync(qdev);
 
 	for (i = 0; i < qdev->rss_ring_count; i++)
@@ -4873,6 +4872,7 @@ static pci_ers_result_t qlge_io_error_detected(struct pci_dev *pdev,
 		return PCI_ERS_RESULT_CAN_RECOVER;
 	case pci_channel_io_frozen:
 		netif_device_detach(ndev);
+		del_timer_sync(&qdev->timer);
 		if (netif_running(ndev))
 			ql_eeh_close(ndev);
 		pci_disable_device(pdev);
@@ -4880,6 +4880,7 @@ static pci_ers_result_t qlge_io_error_detected(struct pci_dev *pdev,
 	case pci_channel_io_perm_failure:
 		dev_err(&pdev->dev,
 			"%s: pci_channel_io_perm_failure.\n", __func__);
+		del_timer_sync(&qdev->timer);
 		ql_eeh_close(ndev);
 		set_bit(QL_EEH_FATAL, &qdev->flags);
 		return PCI_ERS_RESULT_DISCONNECT;
-- 
2.1.0

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] net/qlge: Avoids recursive EEH error
  2016-05-23  1:58 [PATCH] net/qlge: Avoids recursive EEH error Gavin Shan
@ 2016-05-24 21:48 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2016-05-24 21:48 UTC (permalink / raw)
  To: gwshan; +Cc: netdev, harish.patil, sudarsana.kalluru, shriyakul

From: Gavin Shan <gwshan@linux.vnet.ibm.com>
Date: Mon, 23 May 2016 11:58:28 +1000

> One timer, whose handler keeps reading on MMIO register for EEH
> core to detect error in time, is started when the PCI device driver
> is loaded. MMIO register can't be accessed during PE reset in EEH
> recovery. Otherwise, the unexpected recursive error is triggered.
> The timer isn't closed that time if the interface isn't brought
> up. So the unexpected recursive error is seen during EEH recovery
> when the interface is down.
> 
> This avoids the unexpected recursive EEH error by closing the timer
> in qlge_io_error_detected() before EEH PE reset unconditionally. The
> timer is started unconditionally after EEH PE reset in qlge_io_resume().
> Also, the timer should be closed unconditionally when the device is
> removed from the system permanently in qlge_io_error_detected().
> 
> Reported-by: Shriya R. Kulkarni <shriyakul@in.ibm.com>
> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-05-24 21:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-23  1:58 [PATCH] net/qlge: Avoids recursive EEH error Gavin Shan
2016-05-24 21:48 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.