Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173240
b: refs/heads/master
c: 4257aae
h: refs/heads/master
v: v3
  • Loading branch information
Peter Oberparleiter authored and Martin Schwidefsky committed Dec 7, 2009
1 parent 517da26 commit 5c68455
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 76 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: 350e91207bc9c6a464c22b9e0e30d21dfc07efe3
refs/heads/master: 4257aaecffab77bad43e12057f56a5590b360f9f
58 changes: 17 additions & 41 deletions trunk/drivers/s390/cio/device.c
Original file line number Diff line number Diff line change
Expand Up @@ -1068,55 +1068,31 @@ static void io_subchannel_verify(struct subchannel *sch)
dev_fsm_event(cdev, DEV_EVENT_VERIFY);
}

static int check_for_io_on_path(struct subchannel *sch, int mask)
{
if (cio_update_schib(sch))
return 0;
if (scsw_actl(&sch->schib.scsw) && sch->schib.pmcw.lpum == mask)
return 1;
return 0;
}

static void terminate_internal_io(struct subchannel *sch,
struct ccw_device *cdev)
{
if (cio_clear(sch)) {
/* Recheck device in case clear failed. */
sch->lpm = 0;
if (cdev->online)
dev_fsm_event(cdev, DEV_EVENT_VERIFY);
else
css_schedule_eval(sch->schid);
return;
}
cdev->private->state = DEV_STATE_CLEAR_VERIFY;
/* Request retry of internal operation. */
cdev->private->flags.intretry = 1;
/* Call handler. */
if (cdev->handler)
cdev->handler(cdev, cdev->private->intparm,
ERR_PTR(-EIO));
}

static void io_subchannel_terminate_path(struct subchannel *sch, u8 mask)
{
struct ccw_device *cdev;

cdev = sch_get_cdev(sch);
if (!cdev)
return;
if (check_for_io_on_path(sch, mask)) {
if (cdev->private->state == DEV_STATE_ONLINE)
ccw_device_kill_io(cdev);
else {
terminate_internal_io(sch, cdev);
/* Re-start path verification. */
dev_fsm_event(cdev, DEV_EVENT_VERIFY);
}
} else
/* trigger path verification. */
dev_fsm_event(cdev, DEV_EVENT_VERIFY);
if (cio_update_schib(sch))
goto err;
/* Check for I/O on path. */
if (scsw_actl(&sch->schib.scsw) == 0 || sch->schib.pmcw.lpum != mask)
goto out;
if (cdev->private->state == DEV_STATE_ONLINE) {
ccw_device_kill_io(cdev);
goto out;
}
if (cio_clear(sch))
goto err;
out:
/* Trigger path verification. */
dev_fsm_event(cdev, DEV_EVENT_VERIFY);
return;

err:
dev_fsm_event(cdev, DEV_EVENT_NOTOPER);
}

static int io_subchannel_chp_event(struct subchannel *sch,
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/s390/cio/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ enum dev_state {
DEV_STATE_DISBAND_PGID,
DEV_STATE_BOXED,
/* states to wait for i/o completion before doing something */
DEV_STATE_CLEAR_VERIFY,
DEV_STATE_TIMEOUT_KILL,
DEV_STATE_QUIESCE,
/* special states for devices gone not operational */
Expand Down
27 changes: 0 additions & 27 deletions trunk/drivers/s390/cio/device_fsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -771,12 +771,6 @@ ccw_device_w4sense(struct ccw_device *cdev, enum dev_event dev_event)
*/
if (scsw_fctl(&irb->scsw) &
(SCSW_FCTL_CLEAR_FUNC | SCSW_FCTL_HALT_FUNC)) {
/* Retry Basic Sense if requested. */
if (cdev->private->flags.intretry) {
cdev->private->flags.intretry = 0;
ccw_device_do_sense(cdev, irb);
return;
}
cdev->private->flags.dosense = 0;
memset(&cdev->private->irb, 0, sizeof(struct irb));
ccw_device_accumulate_irb(cdev, irb);
Expand All @@ -799,21 +793,6 @@ ccw_device_w4sense(struct ccw_device *cdev, enum dev_event dev_event)
ccw_device_online_verify(cdev, 0);
}

static void
ccw_device_clear_verify(struct ccw_device *cdev, enum dev_event dev_event)
{
struct irb *irb;

irb = (struct irb *) __LC_IRB;
/* Accumulate status. We don't do basic sense. */
ccw_device_accumulate_irb(cdev, irb);
/* Remember to clear irb to avoid residuals. */
memset(&cdev->private->irb, 0, sizeof(struct irb));
/* Try to start delayed device verification. */
ccw_device_online_verify(cdev, 0);
/* Note: Don't call handler for cio initiated clear! */
}

static void
ccw_device_killing_irq(struct ccw_device *cdev, enum dev_event dev_event)
{
Expand Down Expand Up @@ -1069,12 +1048,6 @@ fsm_func_t *dev_jumptable[NR_DEV_STATES][NR_DEV_EVENTS] = {
[DEV_EVENT_VERIFY] = ccw_device_nop,
},
/* states to wait for i/o completion before doing something */
[DEV_STATE_CLEAR_VERIFY] = {
[DEV_EVENT_NOTOPER] = ccw_device_generic_notoper,
[DEV_EVENT_INTERRUPT] = ccw_device_clear_verify,
[DEV_EVENT_TIMEOUT] = ccw_device_nop,
[DEV_EVENT_VERIFY] = ccw_device_nop,
},
[DEV_STATE_TIMEOUT_KILL] = {
[DEV_EVENT_NOTOPER] = ccw_device_generic_notoper,
[DEV_EVENT_INTERRUPT] = ccw_device_killing_irq,
Expand Down
3 changes: 1 addition & 2 deletions trunk/drivers/s390/cio/device_ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,8 +167,7 @@ int ccw_device_start_key(struct ccw_device *cdev, struct ccw1 *cpa,
return -EINVAL;
if (cdev->private->state == DEV_STATE_NOT_OPER)
return -ENODEV;
if (cdev->private->state == DEV_STATE_VERIFY ||
cdev->private->state == DEV_STATE_CLEAR_VERIFY) {
if (cdev->private->state == DEV_STATE_VERIFY) {
/* Remember to fake irb when finished. */
if (!cdev->private->flags.fake_irb) {
cdev->private->flags.fake_irb = 1;
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/s390/cio/device_status.c
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,6 @@ ccw_device_do_sense(struct ccw_device *cdev, struct irb *irb)
sense_ccw->count = SENSE_MAX_COUNT;
sense_ccw->flags = CCW_FLAG_SLI;

/* Reset internal retry indication. */
cdev->private->flags.intretry = 0;

rc = cio_start(sch, sense_ccw, 0xff);
if (rc == -ENODEV || rc == -EACCES)
dev_fsm_event(cdev, DEV_EVENT_VERIFY);
Expand Down
1 change: 0 additions & 1 deletion trunk/drivers/s390/cio/io_sch.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ struct ccw_device_private {
unsigned int donotify:1; /* call notify function */
unsigned int recog_done:1; /* dev. recog. complete */
unsigned int fake_irb:1; /* deliver faked irb */
unsigned int intretry:1; /* retry internal operation */
unsigned int resuming:1; /* recognition while resume */
unsigned int pgid_rdy:1; /* pgids are ready */
} __attribute__((packed)) flags;
Expand Down

0 comments on commit 5c68455

Please sign in to comment.