diff options
author | Ursula Braun <ursula.braun@de.ibm.com> | 2010-07-22 19:15:05 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-07-23 15:36:23 -0400 |
commit | 9dc48ccc68b9dfc01c2beee2d4317fb3df3fdce9 (patch) | |
tree | 83d101e637385276ca40af1bb70ecc14ab24e33f /drivers/s390/net/qeth_l3_main.c | |
parent | 75e0de13631e115768a97131a2d7f5259217512d (diff) |
qeth: serialize sysfs-triggered device configurations
This patch serializes device removal and other sysfs-triggered
configurations by moving removal of sysfs-attributes to the beginning
of the remove functions. And it serializes online/offline setting
and discipline-switching (causing reestablishing of the net_device)
by making use of a new discipline mutex.
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_l3_main.c')
-rw-r--r-- | drivers/s390/net/qeth_l3_main.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index 15b5ca82bd26..e22ae248f613 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c | |||
@@ -3354,6 +3354,8 @@ static void qeth_l3_remove_device(struct ccwgroup_device *cgdev) | |||
3354 | { | 3354 | { |
3355 | struct qeth_card *card = dev_get_drvdata(&cgdev->dev); | 3355 | struct qeth_card *card = dev_get_drvdata(&cgdev->dev); |
3356 | 3356 | ||
3357 | qeth_l3_remove_device_attributes(&cgdev->dev); | ||
3358 | |||
3357 | qeth_set_allowed_threads(card, 0, 1); | 3359 | qeth_set_allowed_threads(card, 0, 1); |
3358 | wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0); | 3360 | wait_event(card->wait_q, qeth_threads_running(card, 0xffffffff) == 0); |
3359 | 3361 | ||
@@ -3367,7 +3369,6 @@ static void qeth_l3_remove_device(struct ccwgroup_device *cgdev) | |||
3367 | card->dev = NULL; | 3369 | card->dev = NULL; |
3368 | } | 3370 | } |
3369 | 3371 | ||
3370 | qeth_l3_remove_device_attributes(&cgdev->dev); | ||
3371 | qeth_l3_clear_ip_list(card, 0, 0); | 3372 | qeth_l3_clear_ip_list(card, 0, 0); |
3372 | qeth_l3_clear_ipato_list(card); | 3373 | qeth_l3_clear_ipato_list(card); |
3373 | return; | 3374 | return; |
@@ -3380,6 +3381,7 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode) | |||
3380 | enum qeth_card_states recover_flag; | 3381 | enum qeth_card_states recover_flag; |
3381 | 3382 | ||
3382 | BUG_ON(!card); | 3383 | BUG_ON(!card); |
3384 | mutex_lock(&card->discipline_mutex); | ||
3383 | mutex_lock(&card->conf_mutex); | 3385 | mutex_lock(&card->conf_mutex); |
3384 | QETH_DBF_TEXT(SETUP, 2, "setonlin"); | 3386 | QETH_DBF_TEXT(SETUP, 2, "setonlin"); |
3385 | QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *)); | 3387 | QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *)); |
@@ -3461,6 +3463,7 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode) | |||
3461 | kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE); | 3463 | kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE); |
3462 | out: | 3464 | out: |
3463 | mutex_unlock(&card->conf_mutex); | 3465 | mutex_unlock(&card->conf_mutex); |
3466 | mutex_unlock(&card->discipline_mutex); | ||
3464 | return 0; | 3467 | return 0; |
3465 | out_remove: | 3468 | out_remove: |
3466 | card->use_hard_stop = 1; | 3469 | card->use_hard_stop = 1; |
@@ -3473,6 +3476,7 @@ out_remove: | |||
3473 | else | 3476 | else |
3474 | card->state = CARD_STATE_DOWN; | 3477 | card->state = CARD_STATE_DOWN; |
3475 | mutex_unlock(&card->conf_mutex); | 3478 | mutex_unlock(&card->conf_mutex); |
3479 | mutex_unlock(&card->discipline_mutex); | ||
3476 | return rc; | 3480 | return rc; |
3477 | } | 3481 | } |
3478 | 3482 | ||
@@ -3488,6 +3492,7 @@ static int __qeth_l3_set_offline(struct ccwgroup_device *cgdev, | |||
3488 | int rc = 0, rc2 = 0, rc3 = 0; | 3492 | int rc = 0, rc2 = 0, rc3 = 0; |
3489 | enum qeth_card_states recover_flag; | 3493 | enum qeth_card_states recover_flag; |
3490 | 3494 | ||
3495 | mutex_lock(&card->discipline_mutex); | ||
3491 | mutex_lock(&card->conf_mutex); | 3496 | mutex_lock(&card->conf_mutex); |
3492 | QETH_DBF_TEXT(SETUP, 3, "setoffl"); | 3497 | QETH_DBF_TEXT(SETUP, 3, "setoffl"); |
3493 | QETH_DBF_HEX(SETUP, 3, &card, sizeof(void *)); | 3498 | QETH_DBF_HEX(SETUP, 3, &card, sizeof(void *)); |
@@ -3508,6 +3513,7 @@ static int __qeth_l3_set_offline(struct ccwgroup_device *cgdev, | |||
3508 | /* let user_space know that device is offline */ | 3513 | /* let user_space know that device is offline */ |
3509 | kobject_uevent(&cgdev->dev.kobj, KOBJ_CHANGE); | 3514 | kobject_uevent(&cgdev->dev.kobj, KOBJ_CHANGE); |
3510 | mutex_unlock(&card->conf_mutex); | 3515 | mutex_unlock(&card->conf_mutex); |
3516 | mutex_unlock(&card->discipline_mutex); | ||
3511 | return 0; | 3517 | return 0; |
3512 | } | 3518 | } |
3513 | 3519 | ||