octeontx2-pf: Unregister netdev at driver remove
authorSubbaraya Sundeep <sbhatta@marvell.com>
Sat, 25 Jul 2020 04:43:54 +0000 (10:13 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 5 Aug 2020 07:58:44 +0000 (09:58 +0200)
commit9e387a01b5a2544bc4d54a814b47ab0b8f7f4ecd
treea2182323c2d32b67728c8fd5ec66b94eefc6f619
parent5e58cb2408ffc34841e4bca58e4409642256c590
octeontx2-pf: Unregister netdev at driver remove

[ Upstream commit ed543f5c6a988d8a863d2436794230cef2c82389 ]

Added unregister_netdev in the driver remove
function. Generally unregister_netdev is called
after disabling all the device interrupts but here
it is called before disabling device mailbox
interrupts. The reason behind this is VF needs
mailbox interrupt to communicate with its PF to
clean up its resources during otx2_stop.
otx2_stop disables packet I/O and queue interrupts
first and by using mailbox interrupt communicates
to PF to free VF resources. Hence this patch
calls unregister_device just before
disabling mailbox interrupts.

Fixes: 3184fb5ba96e ("octeontx2-vf: Virtual function driver support")
Signed-off-by: Subbaraya Sundeep <sbhatta@marvell.com>
Signed-off-by: Sunil Goutham <sgoutham@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/marvell/octeontx2/nic/otx2_vf.c