]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
ibmvnic: Do not close unopened driver during reset
authorThomas Falcon <tlfalcon@linux.ibm.com>
Fri, 7 Jun 2019 21:03:53 +0000 (16:03 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 14 Jul 2019 06:09:39 +0000 (08:09 +0200)
[ Upstream commit 1f94608b0ce141be5286dde31270590bdf35b86a ]

Check driver state before halting it during a reset. If the driver is
not running, do nothing. Otherwise, a request to deactivate a down link
can cause an error and the reset will fail.

Signed-off-by: Thomas Falcon <tlfalcon@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/ibm/ibmvnic.c

index 3dfb2d131eb76f29c6129e8f29f477ab7be840db..71bf895409a1ecd5d6a3b5cd9259cf207c548d9b 100644 (file)
@@ -1751,7 +1751,8 @@ static int do_reset(struct ibmvnic_adapter *adapter,
 
        ibmvnic_cleanup(netdev);
 
-       if (adapter->reset_reason != VNIC_RESET_MOBILITY &&
+       if (reset_state == VNIC_OPEN &&
+           adapter->reset_reason != VNIC_RESET_MOBILITY &&
            adapter->reset_reason != VNIC_RESET_FAILOVER) {
                rc = __ibmvnic_close(netdev);
                if (rc)