Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173246
b: refs/heads/master
c: 56e6b79
h: refs/heads/master
v: v3
  • Loading branch information
Sebastian Ott authored and Martin Schwidefsky committed Dec 7, 2009
1 parent dd48f61 commit 373994c
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 30 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: 24a1872d6411c7cce82c0888a4fbea23e993e051
refs/heads/master: 56e6b796fe9b99287648fc5686aae00106b37bab
35 changes: 19 additions & 16 deletions trunk/drivers/s390/cio/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1130,33 +1130,36 @@ static int io_subchannel_chp_event(struct subchannel *sch,
return 0;
}

static void
io_subchannel_shutdown(struct subchannel *sch)
static void io_subchannel_shutdown(struct subchannel *sch)
{
struct ccw_device *cdev;
int ret;

spin_lock_irq(sch->lock);
cdev = sch_get_cdev(sch);

if (cio_is_console(sch->schid))
return;
goto out_unlock;
if (!sch->schib.pmcw.ena)
/* Nothing to do. */
return;
goto out_unlock;
ret = cio_disable_subchannel(sch);
if (ret != -EBUSY)
/* Subchannel is disabled, we're done. */
return;
cdev->private->state = DEV_STATE_QUIESCE;
goto out_unlock;
if (cdev->handler)
cdev->handler(cdev, cdev->private->intparm,
ERR_PTR(-EIO));
ret = ccw_device_cancel_halt_clear(cdev);
if (ret == -EBUSY) {
ccw_device_set_timeout(cdev, HZ/10);
wait_event(cdev->private->wait_q, dev_fsm_final_state(cdev));
cdev->handler(cdev, cdev->private->intparm, ERR_PTR(-EIO));
while (ret == -EBUSY) {
cdev->private->state = DEV_STATE_QUIESCE;
ret = ccw_device_cancel_halt_clear(cdev);
if (ret == -EBUSY) {
ccw_device_set_timeout(cdev, HZ/10);
spin_unlock_irq(sch->lock);
wait_event(cdev->private->wait_q,
cdev->private->state != DEV_STATE_QUIESCE);
spin_lock_irq(sch->lock);
}
ret = cio_disable_subchannel(sch);
}
cio_disable_subchannel(sch);
out_unlock:
spin_unlock_irq(sch->lock);
}

static int device_is_disconnected(struct ccw_device *cdev)
Expand Down
17 changes: 4 additions & 13 deletions trunk/drivers/s390/cio/device_fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -911,10 +911,7 @@ static void
ccw_device_quiesce_done(struct ccw_device *cdev, enum dev_event dev_event)
{
ccw_device_set_timeout(cdev, 0);
if (dev_event == DEV_EVENT_NOTOPER)
cdev->private->state = DEV_STATE_NOT_OPER;
else
cdev->private->state = DEV_STATE_OFFLINE;
cdev->private->state = DEV_STATE_NOT_OPER;
wake_up(&cdev->private->wait_q);
}

Expand All @@ -924,17 +921,11 @@ ccw_device_quiesce_timeout(struct ccw_device *cdev, enum dev_event dev_event)
int ret;

ret = ccw_device_cancel_halt_clear(cdev);
switch (ret) {
case 0:
cdev->private->state = DEV_STATE_OFFLINE;
wake_up(&cdev->private->wait_q);
break;
case -ENODEV:
if (ret == -EBUSY) {
ccw_device_set_timeout(cdev, HZ/10);
} else {
cdev->private->state = DEV_STATE_NOT_OPER;
wake_up(&cdev->private->wait_q);
break;
default:
ccw_device_set_timeout(cdev, HZ/10);
}
}

Expand Down

0 comments on commit 373994c

Please sign in to comment.