Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 121386
b: refs/heads/master
c: c619d42
h: refs/heads/master
v: v3
  • Loading branch information
Peter Oberparleiter authored and Martin Schwidefsky committed Dec 25, 2008
1 parent 034e722 commit c1aa11a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 111e95a4cae01d6dadbbd1d8ab28dcd10fa5619c
refs/heads/master: c619d4223eaa063dd15ce44235b04487235f8cb7
18 changes: 13 additions & 5 deletions trunk/drivers/s390/cio/ccwgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,23 @@ ccwgroup_ungroup_store(struct device *dev, struct device_attribute *attr, const

gdev = to_ccwgroupdev(dev);

if (gdev->state != CCWGROUP_OFFLINE)
return -EINVAL;

/* Prevent concurrent online/offline processing and ungrouping. */
if (atomic_cmpxchg(&gdev->onoff, 0, 1) != 0)
return -EAGAIN;
if (gdev->state != CCWGROUP_OFFLINE) {
rc = -EINVAL;
goto out;
}
/* Note that we cannot unregister the device from one of its
* attribute methods, so we have to use this roundabout approach.
*/
rc = device_schedule_callback(dev, ccwgroup_ungroup_callback);
if (rc)
count = rc;
out:
if (rc) {
/* Release onoff "lock" when ungrouping failed. */
atomic_set(&gdev->onoff, 0);
return rc;
}
return count;
}

Expand Down

0 comments on commit c1aa11a

Please sign in to comment.