Lines Matching defs:erp
43 * the status of the original cqr / erp to the given (final) status
46 * erp request to be blocked
53 dasd_3990_erp_cleanup(struct dasd_ccw_req * erp, char final_status)
55 struct dasd_ccw_req *cqr = erp->refers;
57 dasd_free_erp_request(erp, erp->memdev);
71 static void dasd_3990_erp_block_queue(struct dasd_ccw_req *erp, int expires)
74 struct dasd_device *device = erp->startdev;
83 erp->status = DASD_CQR_FILLED;
84 if (erp->block)
85 dasd_block_set_timer(erp->block, expires);
98 * erp current erp
100 * erp modified erp
103 dasd_3990_erp_int_req(struct dasd_ccw_req * erp)
106 struct dasd_device *device = erp->startdev;
111 if (erp->function != dasd_3990_erp_int_req) {
113 erp->retries = 256;
114 erp->function = dasd_3990_erp_int_req;
123 dasd_3990_erp_block_queue(erp, 60*HZ);
126 return erp;
139 * erp pointer to the current ERP
142 * erp modified pointer to the ERP
145 dasd_3990_erp_alternate_path(struct dasd_ccw_req * erp)
147 struct dasd_device *device = erp->startdev;
155 if (erp->lpm == 0)
156 erp->lpm = LPM_ANYPATH & ~(erp->irb.esw.esw0.sublog.lpum);
158 erp->lpm &= ~(erp->irb.esw.esw0.sublog.lpum);
160 if ((erp->lpm & opm) != 0x00) {
164 erp->lpm, erp->irb.esw.esw0.sublog.lpum, opm);
167 erp->status = DASD_CQR_FILLED;
168 erp->retries = 10;
172 "/opm=%x)\n", erp->irb.esw.esw0.sublog.lpum, opm);
175 erp->status = DASD_CQR_FAILED;
187 * erp pointer to the current (failed) ERP
195 dasd_3990_erp_DCTL(struct dasd_ccw_req * erp, char modifier)
198 struct dasd_device *device = erp->startdev;
203 dctl_cqr = dasd_alloc_erp_request((char *) &erp->magic, 1,
209 erp->status = DASD_CQR_FAILED;
210 return erp;
224 dctl_cqr->refers = erp;
227 dctl_cqr->magic = erp->magic;
254 * erp pointer to the current ERP
257 * erp pointer to the ERP
260 static struct dasd_ccw_req *dasd_3990_erp_action_1_sec(struct dasd_ccw_req *erp)
262 erp->function = dasd_3990_erp_action_1_sec;
263 dasd_3990_erp_alternate_path(erp);
264 return erp;
267 static struct dasd_ccw_req *dasd_3990_erp_action_1(struct dasd_ccw_req *erp)
269 erp->function = dasd_3990_erp_action_1;
270 dasd_3990_erp_alternate_path(erp);
271 if (erp->status == DASD_CQR_FAILED) {
272 erp->status = DASD_CQR_FILLED;
273 erp->retries = 10;
274 erp->lpm = LPM_ANYPATH;
275 erp->function = dasd_3990_erp_action_1_sec;
277 return erp;
292 * erp pointer to the current ERP
295 * erp pointer to the ERP
299 dasd_3990_erp_action_4(struct dasd_ccw_req * erp, char *sense)
302 struct dasd_device *device = erp->startdev;
307 if (erp->function != dasd_3990_erp_action_4) {
312 erp->retries = 256;
313 erp->function = dasd_3990_erp_action_4;
321 erp->retries);
323 dasd_3990_erp_block_queue(erp, 30*HZ);
329 erp->retries);
330 dasd_3990_erp_block_queue(erp, HZ);
336 erp->retries);
337 erp->status = DASD_CQR_FILLED;
341 return erp;
359 * erp pointer to the current ERP
362 * erp pointer to the ERP
366 dasd_3990_erp_action_5(struct dasd_ccw_req * erp)
370 erp->retries = 10;
371 erp->function = dasd_3990_erp_action_5;
373 return erp;
392 dasd_3990_handle_env_data(struct dasd_ccw_req * erp, char *sense)
395 struct dasd_device *device = erp->startdev;
981 dasd_eer_write(device, erp->refers,
1022 * erp current erp_head
1026 * erp 'new' erp_head - pointer to new ERP
1029 dasd_3990_erp_com_rej(struct dasd_ccw_req * erp, char *sense)
1032 struct dasd_device *device = erp->startdev;
1034 erp->function = dasd_3990_erp_com_rej;
1042 dasd_3990_handle_env_data(erp, sense);
1044 erp->retries = 5;
1049 erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
1056 erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
1059 return erp;
1070 * erp current erp_head
1072 * erp new erp_head - pointer to new ERP
1075 dasd_3990_erp_bus_out(struct dasd_ccw_req * erp)
1078 struct dasd_device *device = erp->startdev;
1083 if (erp->function != dasd_3990_erp_bus_out) {
1084 erp->retries = 256;
1085 erp->function = dasd_3990_erp_bus_out;
1094 dasd_3990_erp_block_queue(erp, 60*HZ);
1098 return erp;
1109 * erp current erp_head
1111 * erp new erp_head - pointer to new ERP
1114 dasd_3990_erp_equip_check(struct dasd_ccw_req * erp, char *sense)
1117 struct dasd_device *device = erp->startdev;
1119 erp->function = dasd_3990_erp_equip_check;
1130 erp = dasd_3990_erp_action_1(erp);
1137 dasd_3990_handle_env_data(erp, sense);
1139 erp = dasd_3990_erp_action_4(erp, sense);
1147 erp = dasd_3990_erp_action_1(erp);
1155 erp = dasd_3990_erp_action_5(erp);
1157 return erp;
1168 * erp current erp_head
1170 * erp new erp_head - pointer to new ERP
1173 dasd_3990_erp_data_check(struct dasd_ccw_req * erp, char *sense)
1176 struct dasd_device *device = erp->startdev;
1178 erp->function = dasd_3990_erp_data_check;
1197 erp = dasd_3990_erp_action_4(erp, sense);
1205 erp = dasd_3990_erp_action_1(erp);
1213 erp = dasd_3990_erp_action_5(erp);
1216 return erp;
1227 * erp current erp_head
1229 * erp new erp_head - pointer to new ERP
1232 dasd_3990_erp_overrun(struct dasd_ccw_req * erp, char *sense)
1235 struct dasd_device *device = erp->startdev;
1237 erp->function = dasd_3990_erp_overrun;
1243 erp = dasd_3990_erp_action_5(erp);
1245 return erp;
1256 * erp current erp_head
1258 * erp new erp_head - pointer to new ERP
1261 dasd_3990_erp_inv_format(struct dasd_ccw_req * erp, char *sense)
1264 struct dasd_device *device = erp->startdev;
1266 erp->function = dasd_3990_erp_inv_format;
1274 dasd_3990_handle_env_data(erp, sense);
1276 erp = dasd_3990_erp_action_4(erp, sense);
1284 erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
1287 return erp;
1298 * erp already added default erp
1300 * erp pointer to original (failed) cqr.
1323 * erp current erp_head
1325 * erp new erp_head - pointer to new ERP
1328 dasd_3990_erp_env_data(struct dasd_ccw_req * erp, char *sense)
1331 struct dasd_device *device = erp->startdev;
1333 erp->function = dasd_3990_erp_env_data;
1337 dasd_3990_handle_env_data(erp, sense);
1341 erp = dasd_3990_erp_action_4(erp, sense);
1343 erp->status = DASD_CQR_FILLED;
1346 return erp;
1357 * erp already added default ERP
1360 * erp new erp_head - pointer to new ERP
1384 * erp current erp_head
1386 * erp new erp_head - pointer to new ERP
1389 dasd_3990_erp_file_prot(struct dasd_ccw_req * erp)
1392 struct dasd_device *device = erp->startdev;
1397 return dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
1406 * If yes, it modifies the original and the erp request so that
1407 * the erp request can be started on a base device.
1410 * erp pointer to the currently created default ERP
1413 * erp pointer to the modified ERP, or NULL
1417 struct dasd_ccw_req *erp)
1419 struct dasd_ccw_req *cqr = erp->refers;
1425 sense = dasd_get_sense(&erp->refers->irb);
1450 erp->startdev = cqr->block->base;
1451 erp->function = dasd_3990_erp_inspect_alias;
1452 return erp;
1467 * erp pointer to the currently created default ERP
1470 * erp pointer to the (addtitional) ERP
1473 dasd_3990_erp_inspect_24(struct dasd_ccw_req * erp, char *sense)
1481 erp_filled = dasd_3990_erp_com_rej(erp, sense);
1485 erp_filled = dasd_3990_erp_int_req(erp);
1489 erp_filled = dasd_3990_erp_bus_out(erp);
1493 erp_filled = dasd_3990_erp_equip_check(erp, sense);
1497 erp_filled = dasd_3990_erp_data_check(erp, sense);
1501 erp_filled = dasd_3990_erp_overrun(erp, sense);
1505 erp_filled = dasd_3990_erp_inv_format(erp, sense);
1509 erp_filled = dasd_3990_erp_EOC(erp, sense);
1513 erp_filled = dasd_3990_erp_env_data(erp, sense);
1517 erp_filled = dasd_3990_erp_no_rec(erp, sense);
1521 erp_filled = dasd_3990_erp_file_prot(erp);
1526 erp_filled = erp;
1547 * erp current erp_head
1550 * erp modified erp_head
1553 dasd_3990_erp_action_10_32(struct dasd_ccw_req * erp, char *sense)
1556 struct dasd_device *device = erp->startdev;
1558 erp->retries = 256;
1559 erp->function = dasd_3990_erp_action_10_32;
1563 return erp;
1574 * The already created 'default erp' is used to get the link to
1575 * the erp chain, but it can not be used for this recovery
1579 * default_erp already added default erp.
1583 * erp new erp or
1593 struct dasd_ccw_req *erp;
1618 /* for imprecise ending just do default erp */
1639 erp = dasd_alloc_erp_request((char *) &cqr->magic,
1644 if (IS_ERR(erp)) {
1652 DE_data = erp->data;
1662 LO_data = erp->data + sizeof(struct DE_eckd_data);
1691 ccw = erp->cpaddr;
1711 /* fill erp related fields */
1712 erp->function = dasd_3990_erp_action_1B_32;
1713 erp->refers = default_erp->refers;
1714 erp->startdev = device;
1715 erp->memdev = device;
1716 erp->magic = default_erp->magic;
1717 erp->expires = 0;
1718 erp->retries = 256;
1719 erp->buildclk = get_clock();
1720 erp->status = DASD_CQR_FILLED;
1722 /* remove the default erp */
1725 return erp;
1739 * previous_erp already created previous erp.
1742 * erp modified erp
1751 struct dasd_ccw_req *erp;
1773 /* for imprecise ending just do default erp */
1798 erp = previous_erp;
1801 LO_data = erp->data + sizeof(struct DE_eckd_data);
1832 ccw = erp->cpaddr; /* addr of DE ccw */
1837 erp->status = DASD_CQR_FILLED;
1839 return erp;
1854 * erp pointer to the currently created ERP
1857 * erp modified ERP pointer
1861 dasd_3990_erp_compound_retry(struct dasd_ccw_req * erp, char *sense)
1866 erp->retries = 1;
1870 erp->retries = 2;
1874 erp->retries = 10;
1878 erp->retries = 256;
1885 erp->function = dasd_3990_erp_compound_retry;
1898 * erp pointer to the currently created ERP
1901 * erp modified ERP pointer
1905 dasd_3990_erp_compound_path(struct dasd_ccw_req * erp, char *sense)
1909 dasd_3990_erp_alternate_path(erp);
1911 if (erp->status == DASD_CQR_FAILED) {
1915 erp->lpm = 0;
1916 erp->status = DASD_CQR_NEED_ERP;
1920 erp->function = dasd_3990_erp_compound_path;
1932 * erp pointer to the currently created ERP
1935 * erp NEW ERP pointer
1939 dasd_3990_erp_compound_code(struct dasd_ccw_req * erp, char *sense)
1948 erp = dasd_3990_erp_DCTL(erp, 0x20);
1953 erp->retries = 1;
1955 dasd_3990_erp_block_queue (erp, 5*HZ);
1964 erp->function = dasd_3990_erp_compound_code;
1966 return erp;
1980 * erp pointer to the currently created ERP
1983 * erp modified ERP pointer
1987 dasd_3990_erp_compound_config(struct dasd_ccw_req * erp, char *sense)
1995 struct dasd_device *device = erp->startdev;
2002 erp->function = dasd_3990_erp_compound_config;
2015 * erp pointer to the current (failed) ERP
2018 * erp (additional) ERP pointer
2022 dasd_3990_erp_compound(struct dasd_ccw_req * erp, char *sense)
2025 if ((erp->function == dasd_3990_erp_compound_retry) &&
2026 (erp->status == DASD_CQR_NEED_ERP)) {
2028 dasd_3990_erp_compound_path(erp, sense);
2031 if ((erp->function == dasd_3990_erp_compound_path) &&
2032 (erp->status == DASD_CQR_NEED_ERP)) {
2034 erp = dasd_3990_erp_compound_code(erp, sense);
2037 if ((erp->function == dasd_3990_erp_compound_code) &&
2038 (erp->status == DASD_CQR_NEED_ERP)) {
2040 dasd_3990_erp_compound_config(erp, sense);
2044 if (erp->status == DASD_CQR_NEED_ERP)
2045 erp->status = DASD_CQR_FAILED;
2047 return erp;
2089 * erp pointer to the currently created default ERP
2096 dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense)
2099 struct dasd_device *device = erp->startdev;
2101 erp->function = dasd_3990_erp_inspect_32;
2110 dasd_3990_erp_compound_retry(erp, sense);
2127 erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
2132 erp = dasd_3990_erp_int_req(erp);
2140 erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
2144 erp = dasd_3990_erp_action_10_32(erp, sense);
2154 erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
2159 erp = dasd_3990_erp_action_1B_32(erp, sense);
2178 erp = dasd_3990_erp_action_4(erp, sense);
2185 erp = dasd_3990_erp_action_4(erp, sense);
2188 default: /* all others errors - default erp */
2193 return erp;
2211 * erp pointer to the currently created default ERP
2214 * erp_filled pointer to the erp
2218 dasd_3990_erp_control_check(struct dasd_ccw_req *erp)
2220 struct dasd_device *device = erp->startdev;
2222 if (scsw_cstat(&erp->refers->irb.scsw) & (SCHN_STAT_INTF_CTRL_CHK
2226 erp = dasd_3990_erp_action_4(erp, NULL);
2228 return erp;
2239 * erp pointer to the currently created default ERP
2244 dasd_3990_erp_inspect(struct dasd_ccw_req *erp)
2251 erp_new = dasd_3990_erp_inspect_alias(erp);
2259 sense = dasd_get_sense(&erp->refers->irb);
2261 erp_new = dasd_3990_erp_control_check(erp);
2266 erp_new = dasd_3990_erp_inspect_24(erp, sense);
2271 erp_new = dasd_3990_erp_inspect_32(erp, sense);
2283 * the given cqr (or erp).
2284 * For a command mode cqr the erp is initialized as an default erp
2294 * erp pointer to new ERP-chain head
2301 struct dasd_ccw_req *erp;
2316 erp = dasd_alloc_erp_request((char *) &cqr->magic,
2318 if (IS_ERR(erp)) {
2331 return erp;
2337 erp->cpmode = 1;
2338 erp->cpaddr = PTR_ALIGN(erp->data, 64);
2339 tcw = erp->cpaddr;
2345 erp->cpaddr = cqr->cpaddr;
2348 ccw = erp->cpaddr;
2356 erp->function = dasd_3990_erp_add_erp;
2357 erp->refers = cqr;
2358 erp->startdev = device;
2359 erp->memdev = device;
2360 erp->block = cqr->block;
2361 erp->magic = cqr->magic;
2362 erp->expires = 0;
2363 erp->retries = 256;
2364 erp->buildclk = get_clock();
2365 erp->status = DASD_CQR_FILLED;
2367 return erp;
2383 * erp pointer to new ERP-chain head
2389 struct dasd_ccw_req *erp = NULL;
2391 /* add erp and initialize with default TIC */
2392 erp = dasd_3990_erp_add_erp(cqr);
2394 if (IS_ERR(erp))
2395 return erp;
2398 if (erp != cqr) {
2400 erp = dasd_3990_erp_inspect(erp);
2403 return erp;
2468 * cqr failed cqr (either original cqr or already an erp)
2471 * erp erp-pointer to the already defined error
2479 struct dasd_ccw_req *erp_head = cqr, /* save erp chain head */
2480 *erp_match = NULL; /* save erp chain head */
2483 if (cqr->refers == NULL) { /* return if not in erp */
2487 /* check the erp/cqr chain for current error */
2490 erp_match = cqr; /* save possible matching erp */
2491 cqr = cqr->refers; /* check next erp/cqr in queue */
2499 return erp_match; /* return address of matching erp */
2514 * erp ERP which is in progress with no retry left
2517 * erp modified/additional ERP
2520 dasd_3990_erp_further_erp(struct dasd_ccw_req *erp)
2523 struct dasd_device *device = erp->startdev;
2524 char *sense = dasd_get_sense(&erp->irb);
2527 if ((erp->function == dasd_3990_erp_bus_out) ||
2528 (erp->function == dasd_3990_erp_action_1) ||
2529 (erp->function == dasd_3990_erp_action_4)) {
2531 erp = dasd_3990_erp_action_1(erp);
2533 } else if (erp->function == dasd_3990_erp_action_1_sec) {
2534 erp = dasd_3990_erp_action_1_sec(erp);
2535 } else if (erp->function == dasd_3990_erp_action_5) {
2538 /* prepare erp for retry on different channel path */
2539 erp = dasd_3990_erp_action_1(erp);
2549 erp = dasd_3990_erp_DCTL(erp, 0x20);
2554 erp = dasd_3990_erp_DCTL(erp, 0x40);
2559 erp = dasd_3990_erp_DCTL(erp, 0x80);
2572 ((erp->function == dasd_3990_erp_compound_retry) ||
2573 (erp->function == dasd_3990_erp_compound_path) ||
2574 (erp->function == dasd_3990_erp_compound_code) ||
2575 (erp->function == dasd_3990_erp_compound_config))) {
2577 erp = dasd_3990_erp_compound(erp, sense);
2585 "ERP %p has run out of retries and failed\n", erp);
2587 erp->status = DASD_CQR_FAILED;
2590 return erp;
2602 * If retry counter of matching erp is already 0, it is checked if further
2607 * erp ERP that handles the actual error.
2608 * (matching erp)
2611 * erp modified/additional ERP
2615 struct dasd_ccw_req *erp)
2623 while (erp_done != erp) {
2635 /* free the finished erp request */
2640 if (erp->retries > 0) {
2642 char *sense = dasd_get_sense(&erp->refers->irb);
2645 if (sense && erp->function == dasd_3990_erp_action_4) {
2647 erp = dasd_3990_erp_action_4(erp, sense);
2650 erp->function == dasd_3990_erp_action_1B_32) {
2652 erp = dasd_3990_update_1B(erp, sense);
2654 } else if (sense && erp->function == dasd_3990_erp_int_req) {
2656 erp = dasd_3990_erp_int_req(erp);
2661 "%i retries left for erp %p",
2662 erp->retries, erp);
2665 erp->status = DASD_CQR_FILLED;
2671 erp = dasd_3990_erp_further_erp(erp);
2674 return erp;
2682 * control routine for 3990 erp actions.
2686 * cqr failed cqr (either original cqr or already an erp)
2689 * erp erp-pointer to the head of the ERP action chain.
2698 struct dasd_ccw_req *erp = NULL;
2716 /* double-check if current erp/cqr was successful */
2731 erp = dasd_3990_erp_in_erp(cqr);
2733 if (erp == NULL) {
2734 /* no matching erp found - set up erp */
2735 erp = dasd_3990_erp_additional_erp(cqr);
2736 if (IS_ERR(erp))
2737 return erp;
2739 /* matching erp found - set all leading erp's to DONE */
2740 erp = dasd_3990_erp_handle_match_erp(cqr, erp);
2747 for (temp_erp = erp;
2758 if (list_empty(&erp->blocklist)) {
2760 /* add erp request before the cqr */
2761 list_add_tail(&erp->blocklist, &cqr->blocklist);
2766 return erp;