diff options
author | Ursula Braun <ursula.braun@de.ibm.com> | 2009-03-24 16:57:18 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-25 03:06:23 -0400 |
commit | 8e98ac48d06068470f1b954e599cf7b706cfceba (patch) | |
tree | 9daa2f185da51c7d4ce2bd52f1a54d2683c1564c /drivers | |
parent | 932e1583c1e52de6757122b92511e69ee0da1c78 (diff) |
qeth: check for completion of a running recovery
When a recovery is started for a qeth device, additional invocations
to change a mac address, to configure a VLAN interface on top, or to
add multicast addresses should wait till recovery is finished,
otherwise recovery might fail.
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')
-rw-r--r-- | drivers/s390/net/qeth_l2_main.c | 15 | ||||
-rw-r--r-- | drivers/s390/net/qeth_l3_main.c | 7 |
2 files changed, 22 insertions, 0 deletions
diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index ecd7efc5e315..172031baedc1 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c | |||
@@ -327,6 +327,10 @@ static void qeth_l2_vlan_rx_add_vid(struct net_device *dev, unsigned short vid) | |||
327 | struct qeth_vlan_vid *id; | 327 | struct qeth_vlan_vid *id; |
328 | 328 | ||
329 | QETH_DBF_TEXT_(TRACE, 4, "aid:%d", vid); | 329 | QETH_DBF_TEXT_(TRACE, 4, "aid:%d", vid); |
330 | if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { | ||
331 | QETH_DBF_TEXT(TRACE, 3, "aidREC"); | ||
332 | return; | ||
333 | } | ||
330 | id = kmalloc(sizeof(struct qeth_vlan_vid), GFP_ATOMIC); | 334 | id = kmalloc(sizeof(struct qeth_vlan_vid), GFP_ATOMIC); |
331 | if (id) { | 335 | if (id) { |
332 | id->vid = vid; | 336 | id->vid = vid; |
@@ -343,6 +347,10 @@ static void qeth_l2_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
343 | struct qeth_card *card = dev->ml_priv; | 347 | struct qeth_card *card = dev->ml_priv; |
344 | 348 | ||
345 | QETH_DBF_TEXT_(TRACE, 4, "kid:%d", vid); | 349 | QETH_DBF_TEXT_(TRACE, 4, "kid:%d", vid); |
350 | if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { | ||
351 | QETH_DBF_TEXT(TRACE, 3, "kidREC"); | ||
352 | return; | ||
353 | } | ||
346 | spin_lock_bh(&card->vlanlock); | 354 | spin_lock_bh(&card->vlanlock); |
347 | list_for_each_entry(id, &card->vid_list, list) { | 355 | list_for_each_entry(id, &card->vid_list, list) { |
348 | if (id->vid == vid) { | 356 | if (id->vid == vid) { |
@@ -594,6 +602,10 @@ static int qeth_l2_set_mac_address(struct net_device *dev, void *p) | |||
594 | } | 602 | } |
595 | QETH_DBF_TEXT_(TRACE, 3, "%s", CARD_BUS_ID(card)); | 603 | QETH_DBF_TEXT_(TRACE, 3, "%s", CARD_BUS_ID(card)); |
596 | QETH_DBF_HEX(TRACE, 3, addr->sa_data, OSA_ADDR_LEN); | 604 | QETH_DBF_HEX(TRACE, 3, addr->sa_data, OSA_ADDR_LEN); |
605 | if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { | ||
606 | QETH_DBF_TEXT(TRACE, 3, "setmcREC"); | ||
607 | return -ERESTARTSYS; | ||
608 | } | ||
597 | rc = qeth_l2_send_delmac(card, &card->dev->dev_addr[0]); | 609 | rc = qeth_l2_send_delmac(card, &card->dev->dev_addr[0]); |
598 | if (!rc) | 610 | if (!rc) |
599 | rc = qeth_l2_send_setmac(card, addr->sa_data); | 611 | rc = qeth_l2_send_setmac(card, addr->sa_data); |
@@ -609,6 +621,9 @@ static void qeth_l2_set_multicast_list(struct net_device *dev) | |||
609 | return ; | 621 | return ; |
610 | 622 | ||
611 | QETH_DBF_TEXT(TRACE, 3, "setmulti"); | 623 | QETH_DBF_TEXT(TRACE, 3, "setmulti"); |
624 | if (qeth_threads_running(card, QETH_RECOVER_THREAD) && | ||
625 | (card->state != CARD_STATE_UP)) | ||
626 | return; | ||
612 | qeth_l2_del_all_mc(card); | 627 | qeth_l2_del_all_mc(card); |
613 | spin_lock_bh(&card->mclock); | 628 | spin_lock_bh(&card->mclock); |
614 | for (dm = dev->mc_list; dm; dm = dm->next) | 629 | for (dm = dev->mc_list; dm; dm = dm->next) |
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 38071a0e0c31..0ba3817cb6a7 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -1838,6 +1838,10 @@ static void qeth_l3_vlan_rx_kill_vid(struct net_device *dev, unsigned short vid) | |||
1838 | unsigned long flags; | 1838 | unsigned long flags; |
1839 | 1839 | ||
1840 | QETH_DBF_TEXT_(TRACE, 4, "kid:%d", vid); | 1840 | QETH_DBF_TEXT_(TRACE, 4, "kid:%d", vid); |
1841 | if (qeth_wait_for_threads(card, QETH_RECOVER_THREAD)) { | ||
1842 | QETH_DBF_TEXT(TRACE, 3, "kidREC"); | ||
1843 | return; | ||
1844 | } | ||
1841 | spin_lock_irqsave(&card->vlanlock, flags); | 1845 | spin_lock_irqsave(&card->vlanlock, flags); |
1842 | /* unregister IP addresses of vlan device */ | 1846 | /* unregister IP addresses of vlan device */ |
1843 | qeth_l3_free_vlan_addresses(card, vid); | 1847 | qeth_l3_free_vlan_addresses(card, vid); |
@@ -2101,6 +2105,9 @@ static void qeth_l3_set_multicast_list(struct net_device *dev) | |||
2101 | struct qeth_card *card = dev->ml_priv; | 2105 | struct qeth_card *card = dev->ml_priv; |
2102 | 2106 | ||
2103 | QETH_DBF_TEXT(TRACE, 3, "setmulti"); | 2107 | QETH_DBF_TEXT(TRACE, 3, "setmulti"); |
2108 | if (qeth_threads_running(card, QETH_RECOVER_THREAD) && | ||
2109 | (card->state != CARD_STATE_UP)) | ||
2110 | return; | ||
2104 | qeth_l3_delete_mc_addresses(card); | 2111 | qeth_l3_delete_mc_addresses(card); |
2105 | qeth_l3_add_multicast_ipv4(card); | 2112 | qeth_l3_add_multicast_ipv4(card); |
2106 | #ifdef CONFIG_QETH_IPV6 | 2113 | #ifdef CONFIG_QETH_IPV6 |