Skip to contentSkip to conversation

octeontx2-pf: Fix the device state on error

PATCH In review Geetha sowjanya 1 participant 1 message Sep 30, 2020

Subsystems (3)
lore
Share & tools
lore

Geetha sowjanya

author maintainer
#0 lore raw

PATCH v2 3/4 octeontx2-pf: Fix the device state on error

From: Hariprasad Kelam <[email protected]>

Currently in otx2_open on failure of nix_lf_start transmit queues are not stopped which are already started in link_event. Since the tx queues are not stopped network stack still try's to send the packets leading to driver crash while access the device resources.

Fixes 50fe6c02e ("octeontx2-pf: Register and handle link notifications")
---
 drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +4 -1
index 75a8c40..5d620a3 100644
@@ -1560,10 +1560,13 @@ int otx2_open(struct net_device *netdev)
 
 	err = otx2_rxtx_enable(pf, true);
 	if (err)
-		goto err_free_cints;
+		goto err_tx_stop_queues;
 
 	return 0;
 
+err_tx_stop_queues:
+	netif_tx_stop_all_queues(netdev);
+	netif_carrier_off(netdev);
 err_free_cints:
 	otx2_free_cints(pf, qidx);
 	vec = pci_irq_vector(pf->pdev,
Signature · 1 line
2.7.4