s390/qeth: unconditionally clear MAC_REGISTERED flag
authorJulian Wiedmann <jwi@linux.ibm.com>
Thu, 28 Feb 2019 17:59:38 +0000 (18:59 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 28 Feb 2019 20:55:25 +0000 (12:55 -0800)
In its attempt to run only the minimal amount of tear down steps,
qeth_l2_stop_card() fails to reset the "is dev_addr registered?" flag
in some rare scenarios. But a future change to the tear down sequence
would cause us to _always_ hit this issue, so patch it up before that
code lands.

Fix it by unconditionally clearing the flag bit. This also allows us to
remove the additional cleanup step in qeth_dev_layer2_store().

Signed-off-by: Julian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_core_sys.c
drivers/s390/net/qeth_l2_main.c

index e24d204b780adf8af71d2a8543b54f5fe20520e5..fa575549d28851700c6bdf69615acb7d305308b0 100644 (file)
@@ -416,7 +416,6 @@ static ssize_t qeth_dev_layer2_store(struct device *dev,
                goto out;
        }
 
-       card->info.mac_bits = 0;
        if (card->discipline) {
                /* start with a new, pristine netdevice: */
                ndev = qeth_clone_netdev(card->dev);
index 72e6d08444a74a94186a9cefebc069bd5180e9d2..f71d45ea30dae43ee0c3e1ffb2a785c2d6426b7c 100644 (file)
@@ -301,7 +301,6 @@ static void qeth_l2_stop_card(struct qeth_card *card, int recovery_mode)
                        dev_close(card->dev);
                        rtnl_unlock();
                }
-               card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED;
                card->state = CARD_STATE_SOFTSETUP;
        }
        if (card->state == CARD_STATE_SOFTSETUP) {
@@ -321,6 +320,7 @@ static void qeth_l2_stop_card(struct qeth_card *card, int recovery_mode)
        }
 
        flush_workqueue(card->event_wq);
+       card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED;
 }
 
 static int qeth_l2_process_inbound_buffer(struct qeth_card *card,