Commit 869da90b authored by Ursula Braun's avatar Ursula Braun Committed by David S. Miller

qeth: no recovery after layer mismatch (z/VM NICs)

Depending on their definition in z/VM, virtual devices for z/VM
VSWITCH or GuestLAN must be configured either in layer2 or in
layer3 mode. If qeth detects a layer mismatch, device activation
fails. Trying to recover from this error cannot help; thus
scheduling a recovery should be avoided.
In addition, since recovery is forbidden during online setting of
a qeth device, existence of its network device is guaranteed for all
dev_close() calls in qeth. The corresponding checks can be removed.
Signed-off-by: default avatarUrsula Braun <ursula.braun@de.ibm.com>
Signed-off-by: default avatarFrank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a959189a
...@@ -537,6 +537,7 @@ static void qeth_send_control_data_cb(struct qeth_channel *channel, ...@@ -537,6 +537,7 @@ static void qeth_send_control_data_cb(struct qeth_channel *channel,
dev_err(&card->gdev->dev, dev_err(&card->gdev->dev,
"The qeth device is not configured " "The qeth device is not configured "
"for the OSI layer required by z/VM\n"); "for the OSI layer required by z/VM\n");
else
qeth_schedule_recovery(card); qeth_schedule_recovery(card);
goto out; goto out;
} }
......
...@@ -1071,11 +1071,9 @@ static int qeth_l2_recover(void *ptr) ...@@ -1071,11 +1071,9 @@ static int qeth_l2_recover(void *ptr)
dev_info(&card->gdev->dev, dev_info(&card->gdev->dev,
"Device successfully recovered!\n"); "Device successfully recovered!\n");
else { else {
if (card->dev) {
rtnl_lock(); rtnl_lock();
dev_close(card->dev); dev_close(card->dev);
rtnl_unlock(); rtnl_unlock();
}
dev_warn(&card->gdev->dev, "The qeth device driver " dev_warn(&card->gdev->dev, "The qeth device driver "
"failed to recover an error on the device\n"); "failed to recover an error on the device\n");
} }
...@@ -1129,12 +1127,10 @@ static int qeth_l2_pm_resume(struct ccwgroup_device *gdev) ...@@ -1129,12 +1127,10 @@ static int qeth_l2_pm_resume(struct ccwgroup_device *gdev)
if (card->state == CARD_STATE_RECOVER) { if (card->state == CARD_STATE_RECOVER) {
rc = __qeth_l2_set_online(card->gdev, 1); rc = __qeth_l2_set_online(card->gdev, 1);
if (rc) { if (rc) {
if (card->dev) {
rtnl_lock(); rtnl_lock();
dev_close(card->dev); dev_close(card->dev);
rtnl_unlock(); rtnl_unlock();
} }
}
} else } else
rc = __qeth_l2_set_online(card->gdev, 0); rc = __qeth_l2_set_online(card->gdev, 0);
out: out:
......
...@@ -2219,12 +2219,10 @@ static int qeth_l3_stop_card(struct qeth_card *card, int recovery_mode) ...@@ -2219,12 +2219,10 @@ static int qeth_l3_stop_card(struct qeth_card *card, int recovery_mode)
if (recovery_mode) if (recovery_mode)
qeth_l3_stop(card->dev); qeth_l3_stop(card->dev);
else { else {
if (card->dev) {
rtnl_lock(); rtnl_lock();
dev_close(card->dev); dev_close(card->dev);
rtnl_unlock(); rtnl_unlock();
} }
}
if (!card->use_hard_stop) { if (!card->use_hard_stop) {
rc = qeth_send_stoplan(card); rc = qeth_send_stoplan(card);
if (rc) if (rc)
...@@ -3536,12 +3534,10 @@ static int qeth_l3_pm_resume(struct ccwgroup_device *gdev) ...@@ -3536,12 +3534,10 @@ static int qeth_l3_pm_resume(struct ccwgroup_device *gdev)
if (card->state == CARD_STATE_RECOVER) { if (card->state == CARD_STATE_RECOVER) {
rc = __qeth_l3_set_online(card->gdev, 1); rc = __qeth_l3_set_online(card->gdev, 1);
if (rc) { if (rc) {
if (card->dev) {
rtnl_lock(); rtnl_lock();
dev_close(card->dev); dev_close(card->dev);
rtnl_unlock(); rtnl_unlock();
} }
}
} else } else
rc = __qeth_l3_set_online(card->gdev, 0); rc = __qeth_l3_set_online(card->gdev, 0);
out: out:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment