Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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 <peter.oberparleiter@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>

authored by

Peter Oberparleiter and committed by
Martin Schwidefsky
4257aaec 350e9120

+18 -75
+17 -41
drivers/s390/cio/device.c
··· 1068 1068 dev_fsm_event(cdev, DEV_EVENT_VERIFY); 1069 1069 } 1070 1070 1071 - static int check_for_io_on_path(struct subchannel *sch, int mask) 1072 - { 1073 - if (cio_update_schib(sch)) 1074 - return 0; 1075 - if (scsw_actl(&sch->schib.scsw) && sch->schib.pmcw.lpum == mask) 1076 - return 1; 1077 - return 0; 1078 - } 1079 - 1080 - static void terminate_internal_io(struct subchannel *sch, 1081 - struct ccw_device *cdev) 1082 - { 1083 - if (cio_clear(sch)) { 1084 - /* Recheck device in case clear failed. */ 1085 - sch->lpm = 0; 1086 - if (cdev->online) 1087 - dev_fsm_event(cdev, DEV_EVENT_VERIFY); 1088 - else 1089 - css_schedule_eval(sch->schid); 1090 - return; 1091 - } 1092 - cdev->private->state = DEV_STATE_CLEAR_VERIFY; 1093 - /* Request retry of internal operation. */ 1094 - cdev->private->flags.intretry = 1; 1095 - /* Call handler. */ 1096 - if (cdev->handler) 1097 - cdev->handler(cdev, cdev->private->intparm, 1098 - ERR_PTR(-EIO)); 1099 - } 1100 - 1101 1071 static void io_subchannel_terminate_path(struct subchannel *sch, u8 mask) 1102 1072 { 1103 1073 struct ccw_device *cdev; ··· 1075 1105 cdev = sch_get_cdev(sch); 1076 1106 if (!cdev) 1077 1107 return; 1078 - if (check_for_io_on_path(sch, mask)) { 1079 - if (cdev->private->state == DEV_STATE_ONLINE) 1080 - ccw_device_kill_io(cdev); 1081 - else { 1082 - terminate_internal_io(sch, cdev); 1083 - /* Re-start path verification. */ 1084 - dev_fsm_event(cdev, DEV_EVENT_VERIFY); 1085 - } 1086 - } else 1087 - /* trigger path verification. */ 1088 - dev_fsm_event(cdev, DEV_EVENT_VERIFY); 1108 + if (cio_update_schib(sch)) 1109 + goto err; 1110 + /* Check for I/O on path. */ 1111 + if (scsw_actl(&sch->schib.scsw) == 0 || sch->schib.pmcw.lpum != mask) 1112 + goto out; 1113 + if (cdev->private->state == DEV_STATE_ONLINE) { 1114 + ccw_device_kill_io(cdev); 1115 + goto out; 1116 + } 1117 + if (cio_clear(sch)) 1118 + goto err; 1119 + out: 1120 + /* Trigger path verification. */ 1121 + dev_fsm_event(cdev, DEV_EVENT_VERIFY); 1122 + return; 1089 1123 1124 + err: 1125 + dev_fsm_event(cdev, DEV_EVENT_NOTOPER); 1090 1126 } 1091 1127 1092 1128 static int io_subchannel_chp_event(struct subchannel *sch,
-1
drivers/s390/cio/device.h
··· 21 21 DEV_STATE_DISBAND_PGID, 22 22 DEV_STATE_BOXED, 23 23 /* states to wait for i/o completion before doing something */ 24 - DEV_STATE_CLEAR_VERIFY, 25 24 DEV_STATE_TIMEOUT_KILL, 26 25 DEV_STATE_QUIESCE, 27 26 /* special states for devices gone not operational */
-27
drivers/s390/cio/device_fsm.c
··· 771 771 */ 772 772 if (scsw_fctl(&irb->scsw) & 773 773 (SCSW_FCTL_CLEAR_FUNC | SCSW_FCTL_HALT_FUNC)) { 774 - /* Retry Basic Sense if requested. */ 775 - if (cdev->private->flags.intretry) { 776 - cdev->private->flags.intretry = 0; 777 - ccw_device_do_sense(cdev, irb); 778 - return; 779 - } 780 774 cdev->private->flags.dosense = 0; 781 775 memset(&cdev->private->irb, 0, sizeof(struct irb)); 782 776 ccw_device_accumulate_irb(cdev, irb); ··· 791 797 if (ccw_device_call_handler(cdev) && cdev->private->flags.doverify) 792 798 /* Start delayed path verification. */ 793 799 ccw_device_online_verify(cdev, 0); 794 - } 795 - 796 - static void 797 - ccw_device_clear_verify(struct ccw_device *cdev, enum dev_event dev_event) 798 - { 799 - struct irb *irb; 800 - 801 - irb = (struct irb *) __LC_IRB; 802 - /* Accumulate status. We don't do basic sense. */ 803 - ccw_device_accumulate_irb(cdev, irb); 804 - /* Remember to clear irb to avoid residuals. */ 805 - memset(&cdev->private->irb, 0, sizeof(struct irb)); 806 - /* Try to start delayed device verification. */ 807 - ccw_device_online_verify(cdev, 0); 808 - /* Note: Don't call handler for cio initiated clear! */ 809 800 } 810 801 811 802 static void ··· 1048 1069 [DEV_EVENT_VERIFY] = ccw_device_nop, 1049 1070 }, 1050 1071 /* states to wait for i/o completion before doing something */ 1051 - [DEV_STATE_CLEAR_VERIFY] = { 1052 - [DEV_EVENT_NOTOPER] = ccw_device_generic_notoper, 1053 - [DEV_EVENT_INTERRUPT] = ccw_device_clear_verify, 1054 - [DEV_EVENT_TIMEOUT] = ccw_device_nop, 1055 - [DEV_EVENT_VERIFY] = ccw_device_nop, 1056 - }, 1057 1072 [DEV_STATE_TIMEOUT_KILL] = { 1058 1073 [DEV_EVENT_NOTOPER] = ccw_device_generic_notoper, 1059 1074 [DEV_EVENT_INTERRUPT] = ccw_device_killing_irq,
+1 -2
drivers/s390/cio/device_ops.c
··· 167 167 return -EINVAL; 168 168 if (cdev->private->state == DEV_STATE_NOT_OPER) 169 169 return -ENODEV; 170 - if (cdev->private->state == DEV_STATE_VERIFY || 171 - cdev->private->state == DEV_STATE_CLEAR_VERIFY) { 170 + if (cdev->private->state == DEV_STATE_VERIFY) { 172 171 /* Remember to fake irb when finished. */ 173 172 if (!cdev->private->flags.fake_irb) { 174 173 cdev->private->flags.fake_irb = 1;
-3
drivers/s390/cio/device_status.c
··· 336 336 sense_ccw->count = SENSE_MAX_COUNT; 337 337 sense_ccw->flags = CCW_FLAG_SLI; 338 338 339 - /* Reset internal retry indication. */ 340 - cdev->private->flags.intretry = 0; 341 - 342 339 rc = cio_start(sch, sense_ccw, 0xff); 343 340 if (rc == -ENODEV || rc == -EACCES) 344 341 dev_fsm_event(cdev, DEV_EVENT_VERIFY);
-1
drivers/s390/cio/io_sch.h
··· 165 165 unsigned int donotify:1; /* call notify function */ 166 166 unsigned int recog_done:1; /* dev. recog. complete */ 167 167 unsigned int fake_irb:1; /* deliver faked irb */ 168 - unsigned int intretry:1; /* retry internal operation */ 169 168 unsigned int resuming:1; /* recognition while resume */ 170 169 unsigned int pgid_rdy:1; /* pgids are ready */ 171 170 } __attribute__((packed)) flags;