diff mbox series

[SRU,F:linux-bluefield,v2,1/1] UBUNTU: SAUCE: mlxbf_gige: clear valid_polarity upon open

Message ID 7d6c9f94bcf9d4b7b690fae8daaf382abca77476.1631113390.git.davthompson@nvidia.com
State New
Headers show
Series UBUNTU: SAUCE: mlxbf_gige: clear valid_polarity upon open | expand

Commit Message

David Thompson Sept. 8, 2021, 3:57 p.m. UTC
BugLink: https://bugs.launchpad.net/bugs/1942932

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@nvidia.com>
Signed-off-by: David Thompson <davthompson@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Kleber Sacilotto de Souza Sept. 9, 2021, 8:07 a.m. UTC | #1
On 08.09.21 17:57, David Thompson wrote:
> BugLink: https://bugs.launchpad.net/bugs/1942932
> 
> 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@nvidia.com>
> Signed-off-by: David Thompson <davthompson@nvidia.com>

Thanks for the updated patch.

Acked-by: Kleber Sacilotto de Souza <kleber.souza@canonical.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 7caa1ca4461f..4ba0b0951ba2 100644
> --- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
> +++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
> @@ -148,6 +148,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;
>
diff mbox series

Patch

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 7caa1ca4461f..4ba0b0951ba2 100644
--- a/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
+++ b/drivers/net/ethernet/mellanox/mlxbf_gige/mlxbf_gige_main.c
@@ -148,6 +148,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;