qeth: synchronize configuration interface
Synchronize access to the drivers configuration interface. Also do not allow configuration changes during online/offline transition. Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:

committed by
David S. Miller

parent
65a1f898ef
commit
c4949f0743
@@ -924,6 +924,7 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
|
||||
enum qeth_card_states recover_flag;
|
||||
|
||||
BUG_ON(!card);
|
||||
mutex_lock(&card->conf_mutex);
|
||||
QETH_DBF_TEXT(SETUP, 2, "setonlin");
|
||||
QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *));
|
||||
|
||||
@@ -956,7 +957,7 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
|
||||
dev_warn(&card->gdev->dev,
|
||||
"The LAN is offline\n");
|
||||
card->lan_online = 0;
|
||||
return 0;
|
||||
goto out;
|
||||
}
|
||||
rc = -ENODEV;
|
||||
goto out_remove;
|
||||
@@ -995,6 +996,8 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode)
|
||||
}
|
||||
/* let user_space know that device is online */
|
||||
kobject_uevent(&gdev->dev.kobj, KOBJ_CHANGE);
|
||||
out:
|
||||
mutex_unlock(&card->conf_mutex);
|
||||
return 0;
|
||||
|
||||
out_remove:
|
||||
@@ -1007,6 +1010,7 @@ out_remove:
|
||||
card->state = CARD_STATE_RECOVER;
|
||||
else
|
||||
card->state = CARD_STATE_DOWN;
|
||||
mutex_unlock(&card->conf_mutex);
|
||||
return rc;
|
||||
}
|
||||
|
||||
@@ -1022,6 +1026,7 @@ static int __qeth_l2_set_offline(struct ccwgroup_device *cgdev,
|
||||
int rc = 0, rc2 = 0, rc3 = 0;
|
||||
enum qeth_card_states recover_flag;
|
||||
|
||||
mutex_lock(&card->conf_mutex);
|
||||
QETH_DBF_TEXT(SETUP, 3, "setoffl");
|
||||
QETH_DBF_HEX(SETUP, 3, &card, sizeof(void *));
|
||||
|
||||
@@ -1040,6 +1045,7 @@ static int __qeth_l2_set_offline(struct ccwgroup_device *cgdev,
|
||||
card->state = CARD_STATE_RECOVER;
|
||||
/* let user_space know that device is offline */
|
||||
kobject_uevent(&cgdev->dev.kobj, KOBJ_CHANGE);
|
||||
mutex_unlock(&card->conf_mutex);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user