aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorUrsula Braun <ursula.braun@de.ibm.com>2009-05-19 17:38:37 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-20 20:36:49 -0400
commitf214856540f6d704e817bf6b26a6bca9e697ee72 (patch)
tree7c70c210ed6b9e67f4528cf06e3d5b372148dd1a /drivers/s390
parent04af8cf6f320031090ab6fa4600b912b0c18fb4b (diff)
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: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/net/qeth_l2_main.c4
-rw-r--r--drivers/s390/net/qeth_l3_main.c4
2 files changed, 6 insertions, 2 deletions
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c
index 172031baedc1..44c15685ab86 100644
--- a/drivers/s390/net/qeth_l2_main.c
+++ b/drivers/s390/net/qeth_l2_main.c
@@ -839,6 +839,7 @@ static void qeth_l2_remove_device(struct ccwgroup_device *cgdev)
839{ 839{
840 struct qeth_card *card = dev_get_drvdata(&cgdev->dev); 840 struct qeth_card *card = dev_get_drvdata(&cgdev->dev);
841 841
842 qeth_set_allowed_threads(card, 0, 1);
842 wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0); 843 wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0);
843 844
844 if (cgdev->state == CCWGROUP_ONLINE) { 845 if (cgdev->state == CCWGROUP_ONLINE) {
@@ -974,8 +975,9 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
974 dev_warn(&card->gdev->dev, 975 dev_warn(&card->gdev->dev,
975 "The LAN is offline\n"); 976 "The LAN is offline\n");
976 card->lan_online = 0; 977 card->lan_online = 0;
978 return 0;
977 } 979 }
978 return rc; 980 goto out_remove;
979 } else 981 } else
980 card->lan_online = 1; 982 card->lan_online = 1;
981 983
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
index 0ba3817cb6a7..5873240c3cea 100644
--- a/drivers/s390/net/qeth_l3_main.c
+++ b/drivers/s390/net/qeth_l3_main.c
@@ -3070,6 +3070,7 @@ static void qeth_l3_remove_device(struct ccwgroup_device *cgdev)
3070{ 3070{
3071 struct qeth_card *card = dev_get_drvdata(&cgdev->dev); 3071 struct qeth_card *card = dev_get_drvdata(&cgdev->dev);
3072 3072
3073 qeth_set_allowed_threads(card, 0, 1);
3073 wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0); 3074 wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0);
3074 3075
3075 if (cgdev->state == CCWGROUP_ONLINE) { 3076 if (cgdev->state == CCWGROUP_ONLINE) {
@@ -3141,8 +3142,9 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode)
3141 dev_warn(&card->gdev->dev, 3142 dev_warn(&card->gdev->dev,
3142 "The LAN is offline\n"); 3143 "The LAN is offline\n");
3143 card->lan_online = 0; 3144 card->lan_online = 0;
3145 return 0;
3144 } 3146 }
3145 return rc; 3147 goto out_remove;
3146 } else 3148 } else
3147 card->lan_online = 1; 3149 card->lan_online = 1;
3148 qeth_set_large_send(card, card->options.large_send); 3150 qeth_set_large_send(card, card->options.large_send);