]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: atlantic: loopback configuration in improper place
authorIgor Russkikh <irusskikh@marvell.com>
Mon, 6 Jan 2020 11:22:29 +0000 (14:22 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 6 Jan 2020 22:06:11 +0000 (14:06 -0800)
Initial loopback configuration should be called earlier, before
starting traffic on HW blocks. Otherwise depending on race conditions
it could be kept disabled.

Fixes: 286f3f2a5fb9 ("net: atlantic: loopback tests via private flags")
Signed-off-by: Igor Russkikh <irusskikh@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/aquantia/atlantic/aq_nic.c

index a17a4da7bc158466082c5dd2591a0f9ff26bf05a..c85e3e29012c0be813dde299aa8731653362a791 100644 (file)
@@ -403,6 +403,8 @@ int aq_nic_start(struct aq_nic_s *self)
        if (err < 0)
                goto err_exit;
 
+       aq_nic_set_loopback(self);
+
        err = self->aq_hw_ops->hw_start(self->aq_hw);
        if (err < 0)
                goto err_exit;
@@ -413,8 +415,6 @@ int aq_nic_start(struct aq_nic_s *self)
 
        INIT_WORK(&self->service_task, aq_nic_service_task);
 
-       aq_nic_set_loopback(self);
-
        timer_setup(&self->service_timer, aq_nic_service_timer_cb, 0);
        aq_nic_service_timer_cb(&self->service_timer);