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>
This commit is contained in:
Ursula Braun
2010-07-22 23:15:05 +00:00
committed by David S. Miller
parent 75e0de1363
commit 9dc48ccc68
5 changed files with 22 additions and 7 deletions

View File

@@ -411,7 +411,7 @@ static ssize_t qeth_dev_layer2_store(struct device *dev,
if (!card)
return -EINVAL;
mutex_lock(&card->conf_mutex);
mutex_lock(&card->discipline_mutex);
if (card->state != CARD_STATE_DOWN) {
rc = -EPERM;
goto out;
@@ -446,7 +446,7 @@ static ssize_t qeth_dev_layer2_store(struct device *dev,
rc = card->discipline.ccwgdriver->probe(card->gdev);
out:
mutex_unlock(&card->conf_mutex);
mutex_unlock(&card->discipline_mutex);
return rc ? rc : count;
}