Skip to contentSkip to conversation

mlxbf_gige: clear valid_polarity upon open

PATCH Superseded David Thompson 2 participants 2 messages Sep 13, 2021

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mlxbf_gige: clear valid_polarity upon open

This patch ensures that the driver's valid_polarity is cleared during the open() method so that it always matches the receive polarity used by hardware.

---
 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 7 +++++++
 1 file changed, 7 insertions(+)
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c +7 -0
index 3e85b17f5857..6704f5c1aa32 100644
@@ -142,6 +142,13 @@ static int mlxbf_gige_open(struct net_device *netdev)
 	err = mlxbf_gige_clean_port(priv);
 	if (err)
 		goto free_irqs;
+
+	/* Clear driver's valid_polarity to match hardware,
+	 * since the above call to clean_port() resets the
+	 * receive polarity used by hardware.
+	 */
+	priv->valid_polarity = 0;
+
 	err = mlxbf_gige_rx_init(priv);
 	if (err)
 		goto free_irqs;
Signature · 1 line
2.30.1
maintainer
#1 lore raw
Quoted 6 lines · On Mon, 13 Sep 2021 11:57:11 -0400 David Thompson wrote:

This patch ensures that the driver's valid_polarity is cleared during the open() method so that it always matches the receive polarity used by hardware.

This looks like a fix, it should have a Fixes tag and target the net tree instead of net-next.