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

qeth: avoid crash after detach of replugged device

If a qeth device is plugged off, setting the device online stops in
state HARDSETUP and a failure is reported to the base cio-layer
causing halt/clear to be invoked. Replugging the device again triggers
a qeth recovery without notification of the cio-layer. If a device
is ungrouped in this state, the qeth set_offline function is not
invoked, because the corresponding ccwgroup device is not in state
ONLINE. Then incoming traffic is still handled by the qdio layer
resulting in a crash in qeth_l<x>_qdio_input_handler, because (part
of) the qeth data structures for this device are already removed.
Solution: After replugging the device qeth recovery should lead to a
working net device. Thus a "LAN offline" result when setting a qeth
device online must not report a failure to the base cio-layer.
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 04af8cf6
...@@ -839,6 +839,7 @@ static void qeth_l2_remove_device(struct ccwgroup_device *cgdev) ...@@ -839,6 +839,7 @@ static void qeth_l2_remove_device(struct ccwgroup_device *cgdev)
{ {
struct qeth_card *card = dev_get_drvdata(&cgdev->dev); struct qeth_card *card = dev_get_drvdata(&cgdev->dev);
qeth_set_allowed_threads(card, 0, 1);
wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0); wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0);
if (cgdev->state == CCWGROUP_ONLINE) { if (cgdev->state == CCWGROUP_ONLINE) {
...@@ -974,8 +975,9 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode) ...@@ -974,8 +975,9 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
dev_warn(&card->gdev->dev, dev_warn(&card->gdev->dev,
"The LAN is offline\n"); "The LAN is offline\n");
card->lan_online = 0; card->lan_online = 0;
return 0;
} }
return rc; goto out_remove;
} else } else
card->lan_online = 1; card->lan_online = 1;
......
...@@ -3070,6 +3070,7 @@ static void qeth_l3_remove_device(struct ccwgroup_device *cgdev) ...@@ -3070,6 +3070,7 @@ static void qeth_l3_remove_device(struct ccwgroup_device *cgdev)
{ {
struct qeth_card *card = dev_get_drvdata(&cgdev->dev); struct qeth_card *card = dev_get_drvdata(&cgdev->dev);
qeth_set_allowed_threads(card, 0, 1);
wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0); wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0);
if (cgdev->state == CCWGROUP_ONLINE) { if (cgdev->state == CCWGROUP_ONLINE) {
...@@ -3141,8 +3142,9 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode) ...@@ -3141,8 +3142,9 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode)
dev_warn(&card->gdev->dev, dev_warn(&card->gdev->dev,
"The LAN is offline\n"); "The LAN is offline\n");
card->lan_online = 0; card->lan_online = 0;
return 0;
} }
return rc; goto out_remove;
} else } else
card->lan_online = 1; card->lan_online = 1;
qeth_set_large_send(card, card->options.large_send); qeth_set_large_send(card, card->options.large_send);
......
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