From: Peter Oberparleiter Date: Mon, 7 Dec 2009 11:51:29 +0000 (+0100) Subject: [S390] cio: remove intretry flag X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=4257aaecffab77bad43e12057f56a5590b360f9f;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git [S390] cio: remove intretry flag After changing all internal I/O functions to use the newly introduced ccw request infrastructure, retries are handled automatically after a clear operation. Therefore remove the internal retry flag and associated code. Signed-off-by: Peter Oberparleiter Signed-off-by: Martin Schwidefsky --- diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 9af864f615b0..e24b9b1d1022 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -1068,36 +1068,6 @@ 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; @@ -1105,18 +1075,24 @@ static void io_subchannel_terminate_path(struct subchannel *sch, u8 mask) 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, diff --git a/drivers/s390/cio/device.h b/drivers/s390/cio/device.h index ac6f55b4b74c..4e1775cf9739 100644 --- a/drivers/s390/cio/device.h +++ b/drivers/s390/cio/device.h @@ -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 */ diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index c7439f5500f8..349d8c52c0d0 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c @@ -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); @@ -799,21 +793,6 @@ call_handler: 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) { @@ -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, diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c index 2d0efee8a290..5ab90ec42318 100644 --- a/drivers/s390/cio/device_ops.c +++ b/drivers/s390/cio/device_ops.c @@ -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; diff --git a/drivers/s390/cio/device_status.c b/drivers/s390/cio/device_status.c index 5814dbee2410..66d8066ef22a 100644 --- a/drivers/s390/cio/device_status.c +++ b/drivers/s390/cio/device_status.c @@ -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); diff --git a/drivers/s390/cio/io_sch.h b/drivers/s390/cio/io_sch.h index 78b5ad980cf3..8942dc092d0a 100644 --- a/drivers/s390/cio/io_sch.h +++ b/drivers/s390/cio/io_sch.h @@ -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;