Skip to contentSkip to conversation

cxgb4: fix error recovery when t4_fw_hello returns a positive value

PATCH Applied Thadeu Lima de Souza Cascardo 2 participants 2 messages May 3, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cxgb4: fix error recovery when t4_fw_hello returns a positive value

Since commit 636f9d371f70f22961fd598fe18380057518ca31 ("cxgb4: Add support for T4 configuration file"), t4_fw_hello may return a positive value instead of 0 for success. The recovery code tests only for zero and fails recovery for any other value.

This fix tests for negative error values and fails only on those cases. Error recovery after an error injection works after this change.

---
 drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +1 -1
index c306df7..bb4ad38 100644
@@ -4538,7 +4538,7 @@ static pci_ers_result_t eeh_slot_reset(struct pci_dev *pdev)
 
 	if (t4_wait_dev_ready(adap) < 0)
 		return PCI_ERS_RESULT_DISCONNECT;
-	if (t4_fw_hello(adap, adap->fn, adap->fn, MASTER_MUST, NULL))
+	if (t4_fw_hello(adap, adap->fn, adap->fn, MASTER_MUST, NULL) < 0)
 		return PCI_ERS_RESULT_DISCONNECT;
 	adap->flags |= FW_OK;
 	if (adap_init1(adap, &c))
Signature · 1 line
1.7.1
maintainer Applied
#1 lore raw

From: Thadeu Lima de Souza Cascardo <[email protected]>
Date: Fri, 3 May 2013 15:11:04 -0300

Quoted 9 lines

Since commit 636f9d371f70f22961fd598fe18380057518ca31 ("cxgb4: Add support for T4 configuration file"), t4_fw_hello may return a positive value instead of 0 for success. The recovery code tests only for zero and fails recovery for any other value.

This fix tests for negative error values and fails only on those cases. Error recovery after an error injection works after this change.

Applied.