mvpp2: refactor MTU change code
authorMatteo Croce <mcroce@redhat.com>
Sun, 28 Jul 2019 00:46:45 +0000 (02:46 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 9 Aug 2019 15:52:30 +0000 (17:52 +0200)
commitb3645a487373e2182bd9899a4fe3a2cbf2010e6e
treec8a43ace4549d7c9ef2b9a1a75ee94be3a78b5b7
parentffab47bf69df0f340d56ded363bac09950ae2395
mvpp2: refactor MTU change code

[ Upstream commit 230bd958c2c846ee292aa38bc6b006296c24ca01 ]

The MTU change code can call napi_disable() with the device already down,
leading to a deadlock. Also, lot of code is duplicated unnecessarily.

Rework mvpp2_change_mtu() to avoid the deadlock and remove duplicated code.

Fixes: 3f518509dedc ("ethernet: Add new driver for Marvell Armada 375 network unit")
Signed-off-by: Matteo Croce <mcroce@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c