[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210913155711.8732-1-davthompson@nvidia.com>
Date: Mon, 13 Sep 2021 11:57:11 -0400
From: David Thompson <davthompson@...dia.com>
To: <davem@...emloft.net>, <kuba@...nel.org>
CC: <netdev@...r.kernel.org>, David Thompson <davthompson@...dia.com>,
"Asmaa Mnebhi" <asmaa@...dia.com>
Subject: [PATCH net-next v1] 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.
Reviewed-by: Asmaa Mnebhi <asmaa@...dia.com>
Signed-off-by: David Thompson <davthompson@...dia.com>
---
drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
index 3e85b17f5857..6704f5c1aa32 100644
--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
@@ -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;
--
2.30.1
Powered by blists - more mailing lists