Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173248
b: refs/heads/master
c: 0c609fc
h: refs/heads/master
v: v3
  • Loading branch information
Sebastian Ott authored and Martin Schwidefsky committed Dec 7, 2009
1 parent f7262f6 commit ca0fdde
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 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: ec64333c3a9bc52e34d79cff23acf4e5764b1353
refs/heads/master: 0c609fca243d456af014e92ad1caca045072dfe8
24 changes: 22 additions & 2 deletions trunk/drivers/s390/cio/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,12 +892,27 @@ static int ccw_device_move_to_sch(struct ccw_device *cdev,
struct subchannel *sch)
{
struct subchannel *old_sch;
int rc;
int rc, old_enabled = 0;

old_sch = to_subchannel(cdev->dev.parent);
/* Obtain child reference for new parent. */
if (!get_device(&sch->dev))
return -ENODEV;

if (!sch_is_pseudo_sch(old_sch)) {
spin_lock_irq(old_sch->lock);
old_enabled = old_sch->schib.pmcw.ena;
rc = 0;
if (old_enabled)
rc = cio_disable_subchannel(old_sch);
spin_unlock_irq(old_sch->lock);
if (rc == -EBUSY) {
/* Release child reference for new parent. */
put_device(&sch->dev);
return rc;
}
}

mutex_lock(&sch->reg_mutex);
rc = device_move(&cdev->dev, &sch->dev, DPM_ORDER_PARENT_BEFORE_DEV);
mutex_unlock(&sch->reg_mutex);
Expand All @@ -906,6 +921,12 @@ static int ccw_device_move_to_sch(struct ccw_device *cdev,
cdev->private->dev_id.ssid,
cdev->private->dev_id.devno, sch->schid.ssid,
sch->schib.pmcw.dev, rc);
if (old_enabled) {
/* Try to reenable the old subchannel. */
spin_lock_irq(old_sch->lock);
cio_enable_subchannel(old_sch, (u32)(addr_t)old_sch);
spin_unlock_irq(old_sch->lock);
}
/* Release child reference for new parent. */
put_device(&sch->dev);
return rc;
Expand All @@ -914,7 +935,6 @@ static int ccw_device_move_to_sch(struct ccw_device *cdev,
if (!sch_is_pseudo_sch(old_sch)) {
spin_lock_irq(old_sch->lock);
sch_set_cdev(old_sch, NULL);
cio_disable_subchannel(old_sch);
spin_unlock_irq(old_sch->lock);
css_schedule_eval(old_sch->schid);
}
Expand Down

0 comments on commit ca0fdde

Please sign in to comment.