Skip to contentSkip to conversation

driver/net/ice sleep in dev_init

PATCH New [email protected] 1 participant 1 message Sep 4, 2020 Network drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 driver/net/ice sleep in dev_init

From: FuYanX <[email protected]>

Fix a hardware issue at C0 4 port NIC via fiber.

When ice_driver send resetHW cmd, there is need to wait 100ms, then the HW functions will be completed. Otherwise, the function of the port link status will be unstable.

Solution just follow datasheet requirement.
The operating system sets the FLR bit in the Device Control register of the PF. The operating system is required by PCIe specification to wait 100 ms before it can assume that the FLR sequence is completed by hardware.

---
 drivers/net/ice/base/ice_common.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/ice/base/ice_common.c +6 -0
index 6168fb4f0..f5ea94ece 100644
@@ -705,6 +705,12 @@ enum ice_status ice_init_hw(struct ice_hw *hw)
 	if (status)
 		return status;
 
+	/* The driver e.g. vfio-pci may triggle a FLR reset.
+	 * The operating system sets the FLR bit in the Device Control register of the PF.
+	 * The operating system is required by PCIe specification to wait 100 ms
+	 * before it can assume that the FLR sequence is completed by hardware.
+	 */
+	rte_delay_ms(100);
 	hw->pf_id = (u8)(rd32(hw, PF_FUNC_RID) &
 			 PF_FUNC_RID_FUNCTION_NUMBER_M) >>
 		PF_FUNC_RID_FUNCTION_NUMBER_S;
Signature · 1 line
2.25.1