aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390/net/qeth_l2_main.c
diff options
context:
space:
mode:
authorUrsula Braun <ursula.braun@de.ibm.com>2009-03-24 16:57:18 -0400
committerDavid S. Miller <davem@davemloft.net>2009-03-25 03:06:23 -0400
commit8e98ac48d06068470f1b954e599cf7b706cfceba (patch)
tree9daa2f185da51c7d4ce2bd52f1a54d2683c1564c /drivers/s390/net/qeth_l2_main.c
parent932e1583c1e52de6757122b92511e69ee0da1c78 (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/s390/net/qeth_l2_main.c')
-rw-r--r--drivers/s390/net/qeth_l2_main.c15
1 files changed, 15 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)