]> git.baikalelectronics.ru Git - kernel.git/commit
net/ethernet/freescale: rework quiesce/activate for ucc_geth
authorValentin Longchamp <valentin@longchamp.me>
Wed, 20 May 2020 15:53:50 +0000 (17:53 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 22 May 2020 22:50:34 +0000 (15:50 -0700)
commit93f38e6efa2627ccfac81d0662b3ac0a2da76c72
tree293dd8aac7ff1ad1d16cb314825389e0ebd8acda
parentf4b41ba281875d2f6b83a2c12ef606d69fba852f
net/ethernet/freescale: rework quiesce/activate for ucc_geth

ugeth_quiesce/activate are used to halt the controller when there is a
link change that requires to reconfigure the mac.

The previous implementation called netif_device_detach(). This however
causes the initial activation of the netdevice to fail precisely because
it's detached. For details, see [1].

A possible workaround was the revert of commit
net: linkwatch: add check for netdevice being present to linkwatch_do_dev
However, the check introduced in the above commit is correct and shall be
kept.

The netif_device_detach() is thus replaced with
netif_tx_stop_all_queues() that prevents any tranmission. This allows to
perform mac config change required by the link change, without detaching
the corresponding netdevice and thus not preventing its initial
activation.

[1] https://lists.openwall.net/netdev/2020/01/08/201

Signed-off-by: Valentin Longchamp <valentin@longchamp.me>
Acked-by: Matteo Ghidoni <matteo.ghidoni@ch.abb.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/ucc_geth.c