2 * File...........: linux/drivers/s390/block/dasd_3990_erp.c
3 * Author(s)......: Horst Hummel <Horst.Hummel@de.ibm.com>
4 * Holger Smolinski <Holger.Smolinski@de.ibm.com>
5 * Bugreports.to..: <Linux390@de.ibm.com>
6 * (C) IBM Corporation, IBM Deutschland Entwicklung GmbH, 2000, 2001
10 #define KMSG_COMPONENT "dasd-eckd"
12 #include <linux/timer.h>
13 #include <asm/idals.h>
15 #define PRINTK_HEADER "dasd_erp(3990): "
18 #include "dasd_eckd.h"
22 unsigned char subcommand; /* e.g Inhibit Write, Enable Write,... */
23 unsigned char modifier; /* Subcommand modifier */
24 unsigned short res; /* reserved */
25 } __attribute__ ((packed));
28 *****************************************************************************
29 * SECTION ERP HANDLING
30 *****************************************************************************
33 *****************************************************************************
34 * 24 and 32 byte sense ERP functions
35 *****************************************************************************
39 * DASD_3990_ERP_CLEANUP
42 * Removes the already build but not necessary ERP request and sets
43 * the status of the original cqr / erp to the given (final) status
46 * erp request to be blocked
47 * final_status either DASD_CQR_DONE or DASD_CQR_FAILED
52 static struct dasd_ccw_req *
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);
58 cqr->status = final_status;
61 } /* end dasd_3990_erp_cleanup */
64 * DASD_3990_ERP_BLOCK_QUEUE
67 * Block the given device request queue to prevent from further
68 * processing until the started timer has expired or an related
69 * interrupt was received.
71 static void dasd_3990_erp_block_queue(struct dasd_ccw_req *erp, int expires)
74 struct dasd_device *device = erp->startdev;
77 DBF_DEV_EVENT(DBF_INFO, device,
78 "blocking request queue for %is", expires/HZ);
80 spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags);
81 dasd_device_set_stop_bits(device, DASD_STOPPED_PENDING);
82 spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
83 erp->status = DASD_CQR_FILLED;
85 dasd_block_set_timer(erp->block, expires);
87 dasd_device_set_timer(device, expires);
91 * DASD_3990_ERP_INT_REQ
94 * Handles 'Intervention Required' error.
95 * This means either device offline or not installed.
102 static struct dasd_ccw_req *
103 dasd_3990_erp_int_req(struct dasd_ccw_req * erp)
106 struct dasd_device *device = erp->startdev;
108 /* first time set initial retry counter and erp_function */
109 /* and retry once without blocking queue */
110 /* (this enables easier enqueing of the cqr) */
111 if (erp->function != dasd_3990_erp_int_req) {
114 erp->function = dasd_3990_erp_int_req;
118 /* issue a message and wait for 'device ready' interrupt */
119 dev_err(&device->cdev->dev,
120 "is offline or not installed - "
121 "INTERVENTION REQUIRED!!\n");
123 dasd_3990_erp_block_queue(erp, 60*HZ);
128 } /* end dasd_3990_erp_int_req */
131 * DASD_3990_ERP_ALTERNATE_PATH
134 * Repeat the operation on a different channel path.
135 * If all alternate paths have been tried, the request is posted with a
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;
151 /* try alternate valid path */
152 spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags);
153 opm = ccw_device_get_path_mask(device->cdev);
154 spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags);
155 //FIXME: start with get_opm ?
157 erp->lpm = LPM_ANYPATH & ~(erp->irb.esw.esw0.sublog.lpum);
159 erp->lpm &= ~(erp->irb.esw.esw0.sublog.lpum);
161 if ((erp->lpm & opm) != 0x00) {
163 DBF_DEV_EVENT(DBF_WARNING, device,
164 "try alternate lpm=%x (lpum=%x / opm=%x)",
165 erp->lpm, erp->irb.esw.esw0.sublog.lpum, opm);
167 /* reset status to submit the request again... */
168 erp->status = DASD_CQR_FILLED;
171 dev_err(&device->cdev->dev,
172 "The DASD cannot be reached on any path (lpum=%x"
173 "/opm=%x)\n", erp->irb.esw.esw0.sublog.lpum, opm);
175 /* post request with permanent error */
176 erp->status = DASD_CQR_FAILED;
178 } /* end dasd_3990_erp_alternate_path */
184 * Setup cqr to do the Diagnostic Control (DCTL) command with an
185 * Inhibit Write subcommand (0x20) and the given modifier.
188 * erp pointer to the current (failed) ERP
189 * modifier subcommand modifier
192 * dctl_cqr pointer to NEW dctl_cqr
195 static struct dasd_ccw_req *
196 dasd_3990_erp_DCTL(struct dasd_ccw_req * erp, char modifier)
199 struct dasd_device *device = erp->startdev;
200 struct DCTL_data *DCTL_data;
202 struct dasd_ccw_req *dctl_cqr;
204 dctl_cqr = dasd_alloc_erp_request((char *) &erp->magic, 1,
205 sizeof(struct DCTL_data),
207 if (IS_ERR(dctl_cqr)) {
208 dev_err(&device->cdev->dev,
209 "Unable to allocate DCTL-CQR\n");
210 erp->status = DASD_CQR_FAILED;
214 DCTL_data = dctl_cqr->data;
216 DCTL_data->subcommand = 0x02; /* Inhibit Write */
217 DCTL_data->modifier = modifier;
219 ccw = dctl_cqr->cpaddr;
220 memset(ccw, 0, sizeof(struct ccw1));
221 ccw->cmd_code = CCW_CMD_DCTL;
223 ccw->cda = (__u32)(addr_t) DCTL_data;
224 dctl_cqr->flags = erp->flags;
225 dctl_cqr->function = dasd_3990_erp_DCTL;
226 dctl_cqr->refers = erp;
227 dctl_cqr->startdev = device;
228 dctl_cqr->memdev = device;
229 dctl_cqr->magic = erp->magic;
230 dctl_cqr->expires = 5 * 60 * HZ;
231 dctl_cqr->retries = 2;
233 dctl_cqr->buildclk = get_clock();
235 dctl_cqr->status = DASD_CQR_FILLED;
239 } /* end dasd_3990_erp_DCTL */
242 * DASD_3990_ERP_ACTION_1
245 * Setup ERP to do the ERP action 1 (see Reference manual).
246 * Repeat the operation on a different channel path.
247 * As deviation from the recommended recovery action, we reset the path mask
248 * after we have tried each path and go through all paths a second time.
249 * This will cover situations where only one path at a time is actually down,
250 * but all paths fail and recover just with the same sequence and timing as
251 * we try to use them (flapping links).
252 * If all alternate paths have been tried twice, the request is posted with
256 * erp pointer to the current ERP
259 * erp pointer to the ERP
262 static struct dasd_ccw_req *dasd_3990_erp_action_1_sec(struct dasd_ccw_req *erp)
264 erp->function = dasd_3990_erp_action_1_sec;
265 dasd_3990_erp_alternate_path(erp);
269 static struct dasd_ccw_req *dasd_3990_erp_action_1(struct dasd_ccw_req *erp)
271 erp->function = dasd_3990_erp_action_1;
272 dasd_3990_erp_alternate_path(erp);
273 if (erp->status == DASD_CQR_FAILED) {
274 erp->status = DASD_CQR_FILLED;
276 erp->lpm = LPM_ANYPATH;
277 erp->function = dasd_3990_erp_action_1_sec;
280 } /* end dasd_3990_erp_action_1(b) */
283 * DASD_3990_ERP_ACTION_4
286 * Setup ERP to do the ERP action 4 (see Reference manual).
287 * Set the current request to PENDING to block the CQR queue for that device
288 * until the state change interrupt appears.
289 * Use a timer (20 seconds) to retry the cqr if the interrupt is still
293 * sense sense data of the actual error
294 * erp pointer to the current ERP
297 * erp pointer to the ERP
300 static struct dasd_ccw_req *
301 dasd_3990_erp_action_4(struct dasd_ccw_req * erp, char *sense)
304 struct dasd_device *device = erp->startdev;
306 /* first time set initial retry counter and erp_function */
307 /* and retry once without waiting for state change pending */
308 /* interrupt (this enables easier enqueing of the cqr) */
309 if (erp->function != dasd_3990_erp_action_4) {
311 DBF_DEV_EVENT(DBF_INFO, device, "%s",
312 "dasd_3990_erp_action_4: first time retry");
315 erp->function = dasd_3990_erp_action_4;
318 if (sense && (sense[25] == 0x1D)) { /* state change pending */
320 DBF_DEV_EVENT(DBF_INFO, device,
321 "waiting for state change pending "
322 "interrupt, %d retries left",
325 dasd_3990_erp_block_queue(erp, 30*HZ);
327 } else if (sense && (sense[25] == 0x1E)) { /* busy */
328 DBF_DEV_EVENT(DBF_INFO, device,
329 "busy - redriving request later, "
332 dasd_3990_erp_block_queue(erp, HZ);
334 /* no state change pending - retry */
335 DBF_DEV_EVENT(DBF_INFO, device,
336 "redriving request immediately, "
339 erp->status = DASD_CQR_FILLED;
345 } /* end dasd_3990_erp_action_4 */
348 *****************************************************************************
349 * 24 byte sense ERP functions (only)
350 *****************************************************************************
354 * DASD_3990_ERP_ACTION_5
357 * Setup ERP to do the ERP action 5 (see Reference manual).
358 * NOTE: Further handling is done in xxx_further_erp after the retries.
361 * erp pointer to the current ERP
364 * erp pointer to the ERP
367 static struct dasd_ccw_req *
368 dasd_3990_erp_action_5(struct dasd_ccw_req * erp)
371 /* first of all retry */
373 erp->function = dasd_3990_erp_action_5;
377 } /* end dasd_3990_erp_action_5 */
380 * DASD_3990_HANDLE_ENV_DATA
383 * Handles 24 byte 'Environmental data present'.
384 * Does a analysis of the sense data (message Format)
385 * and prints the error messages.
388 * sense current sense data
394 dasd_3990_handle_env_data(struct dasd_ccw_req * erp, char *sense)
397 struct dasd_device *device = erp->startdev;
398 char msg_format = (sense[7] & 0xF0);
399 char msg_no = (sense[7] & 0x0F);
400 char errorstring[ERRORLENGTH];
402 switch (msg_format) {
403 case 0x00: /* Format 0 - Program or System Checks */
405 if (sense[1] & 0x10) { /* check message to operator bit */
408 case 0x00: /* No Message */
411 dev_warn(&device->cdev->dev,
412 "FORMAT 0 - Invalid Command\n");
415 dev_warn(&device->cdev->dev,
416 "FORMAT 0 - Invalid Command "
420 dev_warn(&device->cdev->dev,
421 "FORMAT 0 - CCW Count less than "
425 dev_warn(&device->cdev->dev,
426 "FORMAT 0 - Invalid Parameter\n");
429 dev_warn(&device->cdev->dev,
430 "FORMAT 0 - Diagnostic of Special"
431 " Command Violates File Mask\n");
434 dev_warn(&device->cdev->dev,
435 "FORMAT 0 - Channel Returned with "
436 "Incorrect retry CCW\n");
439 dev_warn(&device->cdev->dev,
440 "FORMAT 0 - Reset Notification\n");
443 dev_warn(&device->cdev->dev,
444 "FORMAT 0 - Storage Path Restart\n");
447 dev_warn(&device->cdev->dev,
448 "FORMAT 0 - Channel requested "
449 "... %02x\n", sense[8]);
452 dev_warn(&device->cdev->dev,
453 "FORMAT 0 - Invalid Defective/"
454 "Alternate Track Pointer\n");
457 dev_warn(&device->cdev->dev,
458 "FORMAT 0 - DPS Installation "
462 dev_warn(&device->cdev->dev,
463 "FORMAT 0 - Command Invalid on "
464 "Secondary Address\n");
467 dev_warn(&device->cdev->dev,
468 "FORMAT 0 - Status Not As "
469 "Required: reason %02x\n",
473 dev_warn(&device->cdev->dev,
474 "FORMAT 0 - Reserved\n");
478 case 0x00: /* No Message */
481 dev_warn(&device->cdev->dev,
482 "FORMAT 0 - Device Error "
486 dev_warn(&device->cdev->dev,
487 "FORMAT 0 - Reserved\n");
490 dev_warn(&device->cdev->dev,
491 "FORMAT 0 - Device Fenced - "
492 "device = %02x\n", sense[4]);
495 dev_warn(&device->cdev->dev,
496 "FORMAT 0 - Data Pinned for "
500 dev_warn(&device->cdev->dev,
501 "FORMAT 0 - Reserved\n");
506 case 0x10: /* Format 1 - Device Equipment Checks */
508 case 0x00: /* No Message */
511 dev_warn(&device->cdev->dev,
512 "FORMAT 1 - Device Status 1 not as "
516 dev_warn(&device->cdev->dev,
517 "FORMAT 1 - Index missing\n");
520 dev_warn(&device->cdev->dev,
521 "FORMAT 1 - Interruption cannot be "
525 dev_warn(&device->cdev->dev,
526 "FORMAT 1 - Device did not respond to "
530 dev_warn(&device->cdev->dev,
531 "FORMAT 1 - Device check-2 error or Set "
532 "Sector is not complete\n");
535 dev_warn(&device->cdev->dev,
536 "FORMAT 1 - Head address does not "
540 dev_warn(&device->cdev->dev,
541 "FORMAT 1 - Device status 1 not valid\n");
544 dev_warn(&device->cdev->dev,
545 "FORMAT 1 - Device not ready\n");
548 dev_warn(&device->cdev->dev,
549 "FORMAT 1 - Track physical address did "
553 dev_warn(&device->cdev->dev,
554 "FORMAT 1 - Missing device address bit\n");
557 dev_warn(&device->cdev->dev,
558 "FORMAT 1 - Drive motor switch is off\n");
561 dev_warn(&device->cdev->dev,
562 "FORMAT 1 - Seek incomplete\n");
565 dev_warn(&device->cdev->dev,
566 "FORMAT 1 - Cylinder address did not "
570 dev_warn(&device->cdev->dev,
571 "FORMAT 1 - Offset active cannot be "
575 dev_warn(&device->cdev->dev,
576 "FORMAT 1 - Reserved\n");
580 case 0x20: /* Format 2 - 3990 Equipment Checks */
583 dev_warn(&device->cdev->dev,
584 "FORMAT 2 - 3990 check-2 error\n");
587 dev_warn(&device->cdev->dev,
588 "FORMAT 2 - Support facility errors\n");
591 dev_warn(&device->cdev->dev,
592 "FORMAT 2 - Microcode detected error "
597 dev_warn(&device->cdev->dev,
598 "FORMAT 2 - Reserved\n");
602 case 0x30: /* Format 3 - 3990 Control Checks */
605 dev_warn(&device->cdev->dev,
606 "FORMAT 3 - Allegiance terminated\n");
609 dev_warn(&device->cdev->dev,
610 "FORMAT 3 - Reserved\n");
614 case 0x40: /* Format 4 - Data Checks */
617 dev_warn(&device->cdev->dev,
618 "FORMAT 4 - Home address area error\n");
621 dev_warn(&device->cdev->dev,
622 "FORMAT 4 - Count area error\n");
625 dev_warn(&device->cdev->dev,
626 "FORMAT 4 - Key area error\n");
629 dev_warn(&device->cdev->dev,
630 "FORMAT 4 - Data area error\n");
633 dev_warn(&device->cdev->dev,
634 "FORMAT 4 - No sync byte in home address "
638 dev_warn(&device->cdev->dev,
639 "FORMAT 4 - No sync byte in count address "
643 dev_warn(&device->cdev->dev,
644 "FORMAT 4 - No sync byte in key area\n");
647 dev_warn(&device->cdev->dev,
648 "FORMAT 4 - No sync byte in data area\n");
651 dev_warn(&device->cdev->dev,
652 "FORMAT 4 - Home address area error; "
656 dev_warn(&device->cdev->dev,
657 "FORMAT 4 - Count area error; offset "
661 dev_warn(&device->cdev->dev,
662 "FORMAT 4 - Key area error; offset "
666 dev_warn(&device->cdev->dev,
667 "FORMAT 4 - Data area error; "
671 dev_warn(&device->cdev->dev,
672 "FORMAT 4 - No sync byte in home "
673 "address area; offset active\n");
676 dev_warn(&device->cdev->dev,
677 "FORMAT 4 - No syn byte in count "
678 "address area; offset active\n");
681 dev_warn(&device->cdev->dev,
682 "FORMAT 4 - No sync byte in key area; "
686 dev_warn(&device->cdev->dev,
687 "FORMAT 4 - No syn byte in data area; "
691 dev_warn(&device->cdev->dev,
692 "FORMAT 4 - Reserved\n");
696 case 0x50: /* Format 5 - Data Check with displacement information */
699 dev_warn(&device->cdev->dev,
700 "FORMAT 5 - Data Check in the "
701 "home address area\n");
704 dev_warn(&device->cdev->dev,
705 "FORMAT 5 - Data Check in the count "
709 dev_warn(&device->cdev->dev,
710 "FORMAT 5 - Data Check in the key area\n");
713 dev_warn(&device->cdev->dev,
714 "FORMAT 5 - Data Check in the data "
718 dev_warn(&device->cdev->dev,
719 "FORMAT 5 - Data Check in the "
720 "home address area; offset active\n");
723 dev_warn(&device->cdev->dev,
724 "FORMAT 5 - Data Check in the count area; "
728 dev_warn(&device->cdev->dev,
729 "FORMAT 5 - Data Check in the key area; "
733 dev_warn(&device->cdev->dev,
734 "FORMAT 5 - Data Check in the data area; "
738 dev_warn(&device->cdev->dev,
739 "FORMAT 5 - Reserved\n");
743 case 0x60: /* Format 6 - Usage Statistics/Overrun Errors */
746 dev_warn(&device->cdev->dev,
747 "FORMAT 6 - Overrun on channel A\n");
750 dev_warn(&device->cdev->dev,
751 "FORMAT 6 - Overrun on channel B\n");
754 dev_warn(&device->cdev->dev,
755 "FORMAT 6 - Overrun on channel C\n");
758 dev_warn(&device->cdev->dev,
759 "FORMAT 6 - Overrun on channel D\n");
762 dev_warn(&device->cdev->dev,
763 "FORMAT 6 - Overrun on channel E\n");
766 dev_warn(&device->cdev->dev,
767 "FORMAT 6 - Overrun on channel F\n");
770 dev_warn(&device->cdev->dev,
771 "FORMAT 6 - Overrun on channel G\n");
774 dev_warn(&device->cdev->dev,
775 "FORMAT 6 - Overrun on channel H\n");
778 dev_warn(&device->cdev->dev,
779 "FORMAT 6 - Reserved\n");
783 case 0x70: /* Format 7 - Device Connection Control Checks */
786 dev_warn(&device->cdev->dev,
787 "FORMAT 7 - RCC initiated by a connection "
791 dev_warn(&device->cdev->dev,
792 "FORMAT 7 - RCC 1 sequence not "
796 dev_warn(&device->cdev->dev,
797 "FORMAT 7 - RCC 1 and RCC 2 sequences not "
801 dev_warn(&device->cdev->dev,
802 "FORMAT 7 - Invalid tag-in during "
803 "selection sequence\n");
806 dev_warn(&device->cdev->dev,
807 "FORMAT 7 - extra RCC required\n");
810 dev_warn(&device->cdev->dev,
811 "FORMAT 7 - Invalid DCC selection "
812 "response or timeout\n");
815 dev_warn(&device->cdev->dev,
816 "FORMAT 7 - Missing end operation; device "
817 "transfer complete\n");
820 dev_warn(&device->cdev->dev,
821 "FORMAT 7 - Missing end operation; device "
822 "transfer incomplete\n");
825 dev_warn(&device->cdev->dev,
826 "FORMAT 7 - Invalid tag-in for an "
827 "immediate command sequence\n");
830 dev_warn(&device->cdev->dev,
831 "FORMAT 7 - Invalid tag-in for an "
832 "extended command sequence\n");
835 dev_warn(&device->cdev->dev,
836 "FORMAT 7 - 3990 microcode time out when "
837 "stopping selection\n");
840 dev_warn(&device->cdev->dev,
841 "FORMAT 7 - No response to selection "
842 "after a poll interruption\n");
845 dev_warn(&device->cdev->dev,
846 "FORMAT 7 - Permanent path error (DASD "
847 "controller not available)\n");
850 dev_warn(&device->cdev->dev,
851 "FORMAT 7 - DASD controller not available"
852 " on disconnected command chain\n");
855 dev_warn(&device->cdev->dev,
856 "FORMAT 7 - Reserved\n");
860 case 0x80: /* Format 8 - Additional Device Equipment Checks */
862 case 0x00: /* No Message */
864 dev_warn(&device->cdev->dev,
865 "FORMAT 8 - Error correction code "
869 dev_warn(&device->cdev->dev,
870 "FORMAT 8 - Unexpected end operation "
874 dev_warn(&device->cdev->dev,
875 "FORMAT 8 - End operation with transfer "
879 dev_warn(&device->cdev->dev,
880 "FORMAT 8 - End operation with transfer "
884 dev_warn(&device->cdev->dev,
885 "FORMAT 8 - DPS checks after a system "
886 "reset or selective reset\n");
889 dev_warn(&device->cdev->dev,
890 "FORMAT 8 - DPS cannot be filled\n");
893 dev_warn(&device->cdev->dev,
894 "FORMAT 8 - Short busy time-out during "
895 "device selection\n");
898 dev_warn(&device->cdev->dev,
899 "FORMAT 8 - DASD controller failed to "
900 "set or reset the long busy latch\n");
903 dev_warn(&device->cdev->dev,
904 "FORMAT 8 - No interruption from device "
905 "during a command chain\n");
908 dev_warn(&device->cdev->dev,
909 "FORMAT 8 - Reserved\n");
913 case 0x90: /* Format 9 - Device Read, Write, and Seek Checks */
916 break; /* No Message */
918 dev_warn(&device->cdev->dev,
919 "FORMAT 9 - Device check-2 error\n");
922 dev_warn(&device->cdev->dev,
923 "FORMAT 9 - Head address did not "
927 dev_warn(&device->cdev->dev,
928 "FORMAT 9 - Track physical address did "
929 "not compare while oriented\n");
932 dev_warn(&device->cdev->dev,
933 "FORMAT 9 - Cylinder address did not "
937 dev_warn(&device->cdev->dev,
938 "FORMAT 9 - Reserved\n");
942 case 0xF0: /* Format F - Cache Storage Checks */
945 dev_warn(&device->cdev->dev,
946 "FORMAT F - Operation Terminated\n");
949 dev_warn(&device->cdev->dev,
950 "FORMAT F - Subsystem Processing Error\n");
953 dev_warn(&device->cdev->dev,
954 "FORMAT F - Cache or nonvolatile storage "
955 "equipment failure\n");
958 dev_warn(&device->cdev->dev,
959 "FORMAT F - Caching terminated\n");
962 dev_warn(&device->cdev->dev,
963 "FORMAT F - Cache fast write access not "
967 dev_warn(&device->cdev->dev,
968 "FORMAT F - Track format incorrect\n");
971 dev_warn(&device->cdev->dev,
972 "FORMAT F - Caching reinitiated\n");
975 dev_warn(&device->cdev->dev,
976 "FORMAT F - Nonvolatile storage "
980 dev_warn(&device->cdev->dev,
981 "FORMAT F - Volume is suspended duplex\n");
982 /* call extended error reporting (EER) */
983 dasd_eer_write(device, erp->refers,
984 DASD_EER_PPRCSUSPEND);
987 dev_warn(&device->cdev->dev,
988 "FORMAT F - Subsystem status cannot be "
992 dev_warn(&device->cdev->dev,
993 "FORMAT F - Caching status reset to "
997 dev_warn(&device->cdev->dev,
998 "FORMAT F - DASD Fast Write inhibited\n");
1001 dev_warn(&device->cdev->dev,
1002 "FORMAT D - Reserved\n");
1006 default: /* unknown message format - should not happen
1007 internal error 03 - unknown message format */
1008 snprintf(errorstring, ERRORLENGTH, "03 %x02", msg_format);
1009 dev_err(&device->cdev->dev,
1010 "An error occurred in the DASD device driver, "
1011 "reason=%s\n", errorstring);
1013 } /* end switch message format */
1015 } /* end dasd_3990_handle_env_data */
1018 * DASD_3990_ERP_COM_REJ
1021 * Handles 24 byte 'Command Reject' error.
1024 * erp current erp_head
1025 * sense current sense data
1028 * erp 'new' erp_head - pointer to new ERP
1030 static struct dasd_ccw_req *
1031 dasd_3990_erp_com_rej(struct dasd_ccw_req * erp, char *sense)
1034 struct dasd_device *device = erp->startdev;
1036 erp->function = dasd_3990_erp_com_rej;
1038 /* env data present (ACTION 10 - retry should work) */
1039 if (sense[2] & SNS2_ENV_DATA_PRESENT) {
1041 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1042 "Command Reject - environmental data present");
1044 dasd_3990_handle_env_data(erp, sense);
1048 } else if (sense[1] & SNS1_WRITE_INHIBITED) {
1049 dev_err(&device->cdev->dev, "An I/O request was rejected"
1050 " because writing is inhibited\n");
1051 erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
1053 /* fatal error - set status to FAILED
1054 internal error 09 - Command Reject */
1055 dev_err(&device->cdev->dev, "An error occurred in the DASD "
1056 "device driver, reason=%s\n", "09");
1058 erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
1063 } /* end dasd_3990_erp_com_rej */
1066 * DASD_3990_ERP_BUS_OUT
1069 * Handles 24 byte 'Bus Out Parity Check' error.
1072 * erp current erp_head
1074 * erp new erp_head - pointer to new ERP
1076 static struct dasd_ccw_req *
1077 dasd_3990_erp_bus_out(struct dasd_ccw_req * erp)
1080 struct dasd_device *device = erp->startdev;
1082 /* first time set initial retry counter and erp_function */
1083 /* and retry once without blocking queue */
1084 /* (this enables easier enqueing of the cqr) */
1085 if (erp->function != dasd_3990_erp_bus_out) {
1087 erp->function = dasd_3990_erp_bus_out;
1091 /* issue a message and wait for 'device ready' interrupt */
1092 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1093 "bus out parity error or BOPC requested by "
1096 dasd_3990_erp_block_queue(erp, 60*HZ);
1102 } /* end dasd_3990_erp_bus_out */
1105 * DASD_3990_ERP_EQUIP_CHECK
1108 * Handles 24 byte 'Equipment Check' error.
1111 * erp current erp_head
1113 * erp new erp_head - pointer to new ERP
1115 static struct dasd_ccw_req *
1116 dasd_3990_erp_equip_check(struct dasd_ccw_req * erp, char *sense)
1119 struct dasd_device *device = erp->startdev;
1121 erp->function = dasd_3990_erp_equip_check;
1123 if (sense[1] & SNS1_WRITE_INHIBITED) {
1124 dev_info(&device->cdev->dev,
1125 "Write inhibited path encountered\n");
1127 /* vary path offline
1128 internal error 04 - Path should be varied off-line.*/
1129 dev_err(&device->cdev->dev, "An error occurred in the DASD "
1130 "device driver, reason=%s\n", "04");
1132 erp = dasd_3990_erp_action_1(erp);
1134 } else if (sense[2] & SNS2_ENV_DATA_PRESENT) {
1136 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1137 "Equipment Check - " "environmental data present");
1139 dasd_3990_handle_env_data(erp, sense);
1141 erp = dasd_3990_erp_action_4(erp, sense);
1143 } else if (sense[1] & SNS1_PERM_ERR) {
1145 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1146 "Equipment Check - retry exhausted or "
1149 erp = dasd_3990_erp_action_1(erp);
1152 /* all other equipment checks - Action 5 */
1153 /* rest is done when retries == 0 */
1154 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1155 "Equipment check or processing error");
1157 erp = dasd_3990_erp_action_5(erp);
1161 } /* end dasd_3990_erp_equip_check */
1164 * DASD_3990_ERP_DATA_CHECK
1167 * Handles 24 byte 'Data Check' error.
1170 * erp current erp_head
1172 * erp new erp_head - pointer to new ERP
1174 static struct dasd_ccw_req *
1175 dasd_3990_erp_data_check(struct dasd_ccw_req * erp, char *sense)
1178 struct dasd_device *device = erp->startdev;
1180 erp->function = dasd_3990_erp_data_check;
1182 if (sense[2] & SNS2_CORRECTABLE) { /* correctable data check */
1184 /* issue message that the data has been corrected */
1185 dev_emerg(&device->cdev->dev,
1186 "Data recovered during retry with PCI "
1187 "fetch mode active\n");
1189 /* not possible to handle this situation in Linux */
1190 panic("No way to inform application about the possibly "
1193 } else if (sense[2] & SNS2_ENV_DATA_PRESENT) {
1195 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1196 "Uncorrectable data check recovered secondary "
1197 "addr of duplex pair");
1199 erp = dasd_3990_erp_action_4(erp, sense);
1201 } else if (sense[1] & SNS1_PERM_ERR) {
1203 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1204 "Uncorrectable data check with internal "
1207 erp = dasd_3990_erp_action_1(erp);
1210 /* all other data checks */
1211 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1212 "Uncorrectable data check with retry count "
1215 erp = dasd_3990_erp_action_5(erp);
1220 } /* end dasd_3990_erp_data_check */
1223 * DASD_3990_ERP_OVERRUN
1226 * Handles 24 byte 'Overrun' error.
1229 * erp current erp_head
1231 * erp new erp_head - pointer to new ERP
1233 static struct dasd_ccw_req *
1234 dasd_3990_erp_overrun(struct dasd_ccw_req * erp, char *sense)
1237 struct dasd_device *device = erp->startdev;
1239 erp->function = dasd_3990_erp_overrun;
1241 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1242 "Overrun - service overrun or overrun"
1243 " error requested by channel");
1245 erp = dasd_3990_erp_action_5(erp);
1249 } /* end dasd_3990_erp_overrun */
1252 * DASD_3990_ERP_INV_FORMAT
1255 * Handles 24 byte 'Invalid Track Format' error.
1258 * erp current erp_head
1260 * erp new erp_head - pointer to new ERP
1262 static struct dasd_ccw_req *
1263 dasd_3990_erp_inv_format(struct dasd_ccw_req * erp, char *sense)
1266 struct dasd_device *device = erp->startdev;
1268 erp->function = dasd_3990_erp_inv_format;
1270 if (sense[2] & SNS2_ENV_DATA_PRESENT) {
1272 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1273 "Track format error when destaging or "
1276 dasd_3990_handle_env_data(erp, sense);
1278 erp = dasd_3990_erp_action_4(erp, sense);
1281 /* internal error 06 - The track format is not valid*/
1282 dev_err(&device->cdev->dev,
1283 "An error occurred in the DASD device driver, "
1284 "reason=%s\n", "06");
1286 erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
1291 } /* end dasd_3990_erp_inv_format */
1297 * Handles 24 byte 'End-of-Cylinder' error.
1300 * erp already added default erp
1302 * erp pointer to original (failed) cqr.
1304 static struct dasd_ccw_req *
1305 dasd_3990_erp_EOC(struct dasd_ccw_req * default_erp, char *sense)
1308 struct dasd_device *device = default_erp->startdev;
1310 dev_err(&device->cdev->dev,
1311 "The cylinder data for accessing the DASD is inconsistent\n");
1313 /* implement action 7 - BUG */
1314 return dasd_3990_erp_cleanup(default_erp, DASD_CQR_FAILED);
1316 } /* end dasd_3990_erp_EOC */
1319 * DASD_3990_ERP_ENV_DATA
1322 * Handles 24 byte 'Environmental-Data Present' error.
1325 * erp current erp_head
1327 * erp new erp_head - pointer to new ERP
1329 static struct dasd_ccw_req *
1330 dasd_3990_erp_env_data(struct dasd_ccw_req * erp, char *sense)
1333 struct dasd_device *device = erp->startdev;
1335 erp->function = dasd_3990_erp_env_data;
1337 DBF_DEV_EVENT(DBF_WARNING, device, "%s", "Environmental data present");
1339 dasd_3990_handle_env_data(erp, sense);
1341 /* don't retry on disabled interface */
1342 if (sense[7] != 0x0F) {
1343 erp = dasd_3990_erp_action_4(erp, sense);
1345 erp->status = DASD_CQR_FILLED;
1350 } /* end dasd_3990_erp_env_data */
1353 * DASD_3990_ERP_NO_REC
1356 * Handles 24 byte 'No Record Found' error.
1359 * erp already added default ERP
1362 * erp new erp_head - pointer to new ERP
1364 static struct dasd_ccw_req *
1365 dasd_3990_erp_no_rec(struct dasd_ccw_req * default_erp, char *sense)
1368 struct dasd_device *device = default_erp->startdev;
1370 dev_err(&device->cdev->dev,
1371 "The specified record was not found\n");
1373 return dasd_3990_erp_cleanup(default_erp, DASD_CQR_FAILED);
1375 } /* end dasd_3990_erp_no_rec */
1378 * DASD_3990_ERP_FILE_PROT
1381 * Handles 24 byte 'File Protected' error.
1382 * Note: Seek related recovery is not implemented because
1383 * wee don't use the seek command yet.
1386 * erp current erp_head
1388 * erp new erp_head - pointer to new ERP
1390 static struct dasd_ccw_req *
1391 dasd_3990_erp_file_prot(struct dasd_ccw_req * erp)
1394 struct dasd_device *device = erp->startdev;
1396 dev_err(&device->cdev->dev, "Accessing the DASD failed because of "
1397 "a hardware error\n");
1399 return dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
1401 } /* end dasd_3990_erp_file_prot */
1404 * DASD_3990_ERP_INSPECT_ALIAS
1407 * Checks if the original request was started on an alias device.
1408 * If yes, it modifies the original and the erp request so that
1409 * the erp request can be started on a base device.
1412 * erp pointer to the currently created default ERP
1415 * erp pointer to the modified ERP, or NULL
1418 static struct dasd_ccw_req *dasd_3990_erp_inspect_alias(
1419 struct dasd_ccw_req *erp)
1421 struct dasd_ccw_req *cqr = erp->refers;
1425 (cqr->block->base != cqr->startdev)) {
1427 sense = dasd_get_sense(&erp->refers->irb);
1429 * dynamic pav may have changed base alias mapping
1431 if (!test_bit(DASD_FLAG_OFFLINE, &cqr->startdev->flags) && sense
1432 && (sense[0] == 0x10) && (sense[7] == 0x0F)
1433 && (sense[8] == 0x67)) {
1435 * remove device from alias handling to prevent new
1436 * requests from being scheduled on the
1437 * wrong alias device
1439 dasd_alias_remove_device(cqr->startdev);
1441 /* schedule worker to reload device */
1442 dasd_reload_device(cqr->startdev);
1445 if (cqr->startdev->features & DASD_FEATURE_ERPLOG) {
1446 DBF_DEV_EVENT(DBF_ERR, cqr->startdev,
1447 "ERP on alias device for request %p,"
1448 " recover on base device %s", cqr,
1449 dev_name(&cqr->block->base->cdev->dev));
1451 dasd_eckd_reset_ccw_to_base_io(cqr);
1452 erp->startdev = cqr->block->base;
1453 erp->function = dasd_3990_erp_inspect_alias;
1461 * DASD_3990_ERP_INSPECT_24
1464 * Does a detailed inspection of the 24 byte sense data
1465 * and sets up a related error recovery action.
1468 * sense sense data of the actual error
1469 * erp pointer to the currently created default ERP
1472 * erp pointer to the (addtitional) ERP
1474 static struct dasd_ccw_req *
1475 dasd_3990_erp_inspect_24(struct dasd_ccw_req * erp, char *sense)
1478 struct dasd_ccw_req *erp_filled = NULL;
1480 /* Check sense for .... */
1481 /* 'Command Reject' */
1482 if ((erp_filled == NULL) && (sense[0] & SNS0_CMD_REJECT)) {
1483 erp_filled = dasd_3990_erp_com_rej(erp, sense);
1485 /* 'Intervention Required' */
1486 if ((erp_filled == NULL) && (sense[0] & SNS0_INTERVENTION_REQ)) {
1487 erp_filled = dasd_3990_erp_int_req(erp);
1489 /* 'Bus Out Parity Check' */
1490 if ((erp_filled == NULL) && (sense[0] & SNS0_BUS_OUT_CHECK)) {
1491 erp_filled = dasd_3990_erp_bus_out(erp);
1493 /* 'Equipment Check' */
1494 if ((erp_filled == NULL) && (sense[0] & SNS0_EQUIPMENT_CHECK)) {
1495 erp_filled = dasd_3990_erp_equip_check(erp, sense);
1498 if ((erp_filled == NULL) && (sense[0] & SNS0_DATA_CHECK)) {
1499 erp_filled = dasd_3990_erp_data_check(erp, sense);
1502 if ((erp_filled == NULL) && (sense[0] & SNS0_OVERRUN)) {
1503 erp_filled = dasd_3990_erp_overrun(erp, sense);
1505 /* 'Invalid Track Format' */
1506 if ((erp_filled == NULL) && (sense[1] & SNS1_INV_TRACK_FORMAT)) {
1507 erp_filled = dasd_3990_erp_inv_format(erp, sense);
1509 /* 'End-of-Cylinder' */
1510 if ((erp_filled == NULL) && (sense[1] & SNS1_EOC)) {
1511 erp_filled = dasd_3990_erp_EOC(erp, sense);
1513 /* 'Environmental Data' */
1514 if ((erp_filled == NULL) && (sense[2] & SNS2_ENV_DATA_PRESENT)) {
1515 erp_filled = dasd_3990_erp_env_data(erp, sense);
1517 /* 'No Record Found' */
1518 if ((erp_filled == NULL) && (sense[1] & SNS1_NO_REC_FOUND)) {
1519 erp_filled = dasd_3990_erp_no_rec(erp, sense);
1521 /* 'File Protected' */
1522 if ((erp_filled == NULL) && (sense[1] & SNS1_FILE_PROTECTED)) {
1523 erp_filled = dasd_3990_erp_file_prot(erp);
1525 /* other (unknown) error - do default ERP */
1526 if (erp_filled == NULL) {
1533 } /* END dasd_3990_erp_inspect_24 */
1536 *****************************************************************************
1537 * 32 byte sense ERP functions (only)
1538 *****************************************************************************
1542 * DASD_3990_ERPACTION_10_32
1545 * Handles 32 byte 'Action 10' of Single Program Action Codes.
1546 * Just retry and if retry doesn't work, return with error.
1549 * erp current erp_head
1550 * sense current sense data
1552 * erp modified erp_head
1554 static struct dasd_ccw_req *
1555 dasd_3990_erp_action_10_32(struct dasd_ccw_req * erp, char *sense)
1558 struct dasd_device *device = erp->startdev;
1561 erp->function = dasd_3990_erp_action_10_32;
1563 DBF_DEV_EVENT(DBF_WARNING, device, "%s", "Perform logging requested");
1567 } /* end dasd_3990_erp_action_10_32 */
1570 * DASD_3990_ERP_ACTION_1B_32
1573 * Handles 32 byte 'Action 1B' of Single Program Action Codes.
1574 * A write operation could not be finished because of an unexpected
1576 * The already created 'default erp' is used to get the link to
1577 * the erp chain, but it can not be used for this recovery
1578 * action because it contains no DE/LO data space.
1581 * default_erp already added default erp.
1582 * sense current sense data
1586 * default_erp in case of imprecise ending or error
1588 static struct dasd_ccw_req *
1589 dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense)
1592 struct dasd_device *device = default_erp->startdev;
1594 struct dasd_ccw_req *cqr;
1595 struct dasd_ccw_req *erp;
1596 struct DE_eckd_data *DE_data;
1597 struct PFX_eckd_data *PFX_data;
1598 char *LO_data; /* LO_eckd_data_t */
1599 struct ccw1 *ccw, *oldccw;
1601 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1602 "Write not finished because of unexpected condition");
1604 default_erp->function = dasd_3990_erp_action_1B_32;
1606 /* determine the original cqr */
1609 while (cqr->refers != NULL) {
1613 if (scsw_is_tm(&cqr->irb.scsw)) {
1614 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1615 "32 bit sense, action 1B is not defined"
1616 " in transport mode - just retry");
1620 /* for imprecise ending just do default erp */
1621 if (sense[1] & 0x01) {
1622 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1623 "Imprecise ending is set - just retry");
1628 /* determine the address of the CCW to be restarted */
1629 /* Imprecise ending is not set -> addr from IRB-SCSW */
1630 cpa = default_erp->refers->irb.scsw.cmd.cpa;
1633 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1634 "Unable to determine address of the CCW "
1637 return dasd_3990_erp_cleanup(default_erp, DASD_CQR_FAILED);
1640 /* Build new ERP request including DE/LO */
1641 erp = dasd_alloc_erp_request((char *) &cqr->magic,
1642 2 + 1,/* DE/LO + TIC */
1643 sizeof(struct DE_eckd_data) +
1644 sizeof(struct LO_eckd_data), device);
1647 /* internal error 01 - Unable to allocate ERP */
1648 dev_err(&device->cdev->dev, "An error occurred in the DASD "
1649 "device driver, reason=%s\n", "01");
1650 return dasd_3990_erp_cleanup(default_erp, DASD_CQR_FAILED);
1653 /* use original DE */
1654 DE_data = erp->data;
1655 oldccw = cqr->cpaddr;
1656 if (oldccw->cmd_code == DASD_ECKD_CCW_PFX) {
1657 PFX_data = cqr->data;
1658 memcpy(DE_data, &PFX_data->define_extent,
1659 sizeof(struct DE_eckd_data));
1661 memcpy(DE_data, cqr->data, sizeof(struct DE_eckd_data));
1664 LO_data = erp->data + sizeof(struct DE_eckd_data);
1666 if ((sense[3] == 0x01) && (LO_data[1] & 0x01)) {
1668 return dasd_3990_erp_cleanup(default_erp, DASD_CQR_FAILED);
1671 if ((sense[7] & 0x3F) == 0x01) {
1672 /* operation code is WRITE DATA -> data area orientation */
1675 } else if ((sense[7] & 0x3F) == 0x03) {
1676 /* operation code is FORMAT WRITE -> index orientation */
1680 LO_data[0] = sense[7]; /* operation */
1683 LO_data[1] = sense[8]; /* auxiliary */
1684 LO_data[2] = sense[9];
1685 LO_data[3] = sense[3]; /* count */
1686 LO_data[4] = sense[29]; /* seek_addr.cyl */
1687 LO_data[5] = sense[30]; /* seek_addr.cyl 2nd byte */
1688 LO_data[7] = sense[31]; /* seek_addr.head 2nd byte */
1690 memcpy(&(LO_data[8]), &(sense[11]), 8);
1694 memset(ccw, 0, sizeof(struct ccw1));
1695 ccw->cmd_code = DASD_ECKD_CCW_DEFINE_EXTENT;
1696 ccw->flags = CCW_FLAG_CC;
1698 ccw->cda = (__u32)(addr_t) DE_data;
1702 memset(ccw, 0, sizeof(struct ccw1));
1703 ccw->cmd_code = DASD_ECKD_CCW_LOCATE_RECORD;
1704 ccw->flags = CCW_FLAG_CC;
1706 ccw->cda = (__u32)(addr_t) LO_data;
1708 /* TIC to the failed ccw */
1710 ccw->cmd_code = CCW_CMD_TIC;
1713 /* fill erp related fields */
1714 erp->flags = default_erp->flags;
1715 erp->function = dasd_3990_erp_action_1B_32;
1716 erp->refers = default_erp->refers;
1717 erp->startdev = device;
1718 erp->memdev = device;
1719 erp->magic = default_erp->magic;
1722 erp->buildclk = get_clock();
1723 erp->status = DASD_CQR_FILLED;
1725 /* remove the default erp */
1726 dasd_free_erp_request(default_erp, device);
1730 } /* end dasd_3990_erp_action_1B_32 */
1733 * DASD_3990_UPDATE_1B
1736 * Handles the update to the 32 byte 'Action 1B' of Single Program
1737 * Action Codes in case the first action was not successful.
1738 * The already created 'previous_erp' is the currently not successful
1742 * previous_erp already created previous erp.
1743 * sense current sense data
1747 static struct dasd_ccw_req *
1748 dasd_3990_update_1B(struct dasd_ccw_req * previous_erp, char *sense)
1751 struct dasd_device *device = previous_erp->startdev;
1753 struct dasd_ccw_req *cqr;
1754 struct dasd_ccw_req *erp;
1755 char *LO_data; /* struct LO_eckd_data */
1758 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1759 "Write not finished because of unexpected condition"
1762 /* determine the original cqr */
1765 while (cqr->refers != NULL) {
1769 if (scsw_is_tm(&cqr->irb.scsw)) {
1770 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1771 "32 bit sense, action 1B, update,"
1772 " in transport mode - just retry");
1773 return previous_erp;
1776 /* for imprecise ending just do default erp */
1777 if (sense[1] & 0x01) {
1778 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
1779 "Imprecise ending is set - just retry");
1781 previous_erp->status = DASD_CQR_FILLED;
1783 return previous_erp;
1786 /* determine the address of the CCW to be restarted */
1787 /* Imprecise ending is not set -> addr from IRB-SCSW */
1788 cpa = previous_erp->irb.scsw.cmd.cpa;
1791 /* internal error 02 -
1792 Unable to determine address of the CCW to be restarted */
1793 dev_err(&device->cdev->dev, "An error occurred in the DASD "
1794 "device driver, reason=%s\n", "02");
1796 previous_erp->status = DASD_CQR_FAILED;
1798 return previous_erp;
1803 /* update the LO with the new returned sense data */
1804 LO_data = erp->data + sizeof(struct DE_eckd_data);
1806 if ((sense[3] == 0x01) && (LO_data[1] & 0x01)) {
1807 /* should not happen */
1808 previous_erp->status = DASD_CQR_FAILED;
1810 return previous_erp;
1813 if ((sense[7] & 0x3F) == 0x01) {
1814 /* operation code is WRITE DATA -> data area orientation */
1817 } else if ((sense[7] & 0x3F) == 0x03) {
1818 /* operation code is FORMAT WRITE -> index orientation */
1822 LO_data[0] = sense[7]; /* operation */
1825 LO_data[1] = sense[8]; /* auxiliary */
1826 LO_data[2] = sense[9];
1827 LO_data[3] = sense[3]; /* count */
1828 LO_data[4] = sense[29]; /* seek_addr.cyl */
1829 LO_data[5] = sense[30]; /* seek_addr.cyl 2nd byte */
1830 LO_data[7] = sense[31]; /* seek_addr.head 2nd byte */
1832 memcpy(&(LO_data[8]), &(sense[11]), 8);
1834 /* TIC to the failed ccw */
1835 ccw = erp->cpaddr; /* addr of DE ccw */
1836 ccw++; /* addr of LE ccw */
1837 ccw++; /* addr of TIC ccw */
1840 erp->status = DASD_CQR_FILLED;
1844 } /* end dasd_3990_update_1B */
1847 * DASD_3990_ERP_COMPOUND_RETRY
1850 * Handles the compound ERP action retry code.
1851 * NOTE: At least one retry is done even if zero is specified
1852 * by the sense data. This makes enqueueing of the request
1856 * sense sense data of the actual error
1857 * erp pointer to the currently created ERP
1860 * erp modified ERP pointer
1864 dasd_3990_erp_compound_retry(struct dasd_ccw_req * erp, char *sense)
1867 switch (sense[25] & 0x03) {
1868 case 0x00: /* no not retry */
1872 case 0x01: /* retry 2 times */
1876 case 0x02: /* retry 10 times */
1880 case 0x03: /* retry 256 times */
1888 erp->function = dasd_3990_erp_compound_retry;
1890 } /* end dasd_3990_erp_compound_retry */
1893 * DASD_3990_ERP_COMPOUND_PATH
1896 * Handles the compound ERP action for retry on alternate
1900 * sense sense data of the actual error
1901 * erp pointer to the currently created ERP
1904 * erp modified ERP pointer
1908 dasd_3990_erp_compound_path(struct dasd_ccw_req * erp, char *sense)
1911 if (sense[25] & DASD_SENSE_BIT_3) {
1912 dasd_3990_erp_alternate_path(erp);
1914 if (erp->status == DASD_CQR_FAILED) {
1915 /* reset the lpm and the status to be able to
1916 * try further actions. */
1919 erp->status = DASD_CQR_NEED_ERP;
1923 erp->function = dasd_3990_erp_compound_path;
1925 } /* end dasd_3990_erp_compound_path */
1928 * DASD_3990_ERP_COMPOUND_CODE
1931 * Handles the compound ERP action for retry code.
1934 * sense sense data of the actual error
1935 * erp pointer to the currently created ERP
1938 * erp NEW ERP pointer
1941 static struct dasd_ccw_req *
1942 dasd_3990_erp_compound_code(struct dasd_ccw_req * erp, char *sense)
1945 if (sense[25] & DASD_SENSE_BIT_2) {
1947 switch (sense[28]) {
1949 /* issue a Diagnostic Control command with an
1950 * Inhibit Write subcommand and controller modifier */
1951 erp = dasd_3990_erp_DCTL(erp, 0x20);
1955 /* wait for 5 seconds and retry again */
1958 dasd_3990_erp_block_queue (erp, 5*HZ);
1962 /* should not happen - continue */
1967 erp->function = dasd_3990_erp_compound_code;
1971 } /* end dasd_3990_erp_compound_code */
1974 * DASD_3990_ERP_COMPOUND_CONFIG
1977 * Handles the compound ERP action for configruation
1979 * Note: duplex handling is not implemented (yet).
1982 * sense sense data of the actual error
1983 * erp pointer to the currently created ERP
1986 * erp modified ERP pointer
1990 dasd_3990_erp_compound_config(struct dasd_ccw_req * erp, char *sense)
1993 if ((sense[25] & DASD_SENSE_BIT_1) && (sense[26] & DASD_SENSE_BIT_2)) {
1995 /* set to suspended duplex state then restart
1996 internal error 05 - Set device to suspended duplex state
1998 struct dasd_device *device = erp->startdev;
1999 dev_err(&device->cdev->dev,
2000 "An error occurred in the DASD device driver, "
2001 "reason=%s\n", "05");
2005 erp->function = dasd_3990_erp_compound_config;
2007 } /* end dasd_3990_erp_compound_config */
2010 * DASD_3990_ERP_COMPOUND
2013 * Does the further compound program action if
2014 * compound retry was not successful.
2017 * sense sense data of the actual error
2018 * erp pointer to the current (failed) ERP
2021 * erp (additional) ERP pointer
2024 static struct dasd_ccw_req *
2025 dasd_3990_erp_compound(struct dasd_ccw_req * erp, char *sense)
2028 if ((erp->function == dasd_3990_erp_compound_retry) &&
2029 (erp->status == DASD_CQR_NEED_ERP)) {
2031 dasd_3990_erp_compound_path(erp, sense);
2034 if ((erp->function == dasd_3990_erp_compound_path) &&
2035 (erp->status == DASD_CQR_NEED_ERP)) {
2037 erp = dasd_3990_erp_compound_code(erp, sense);
2040 if ((erp->function == dasd_3990_erp_compound_code) &&
2041 (erp->status == DASD_CQR_NEED_ERP)) {
2043 dasd_3990_erp_compound_config(erp, sense);
2046 /* if no compound action ERP specified, the request failed */
2047 if (erp->status == DASD_CQR_NEED_ERP)
2048 erp->status = DASD_CQR_FAILED;
2052 } /* end dasd_3990_erp_compound */
2055 *DASD_3990_ERP_HANDLE_SIM
2058 * inspects the SIM SENSE data and starts an appropriate action
2061 * sense sense data of the actual error
2067 dasd_3990_erp_handle_sim(struct dasd_device *device, char *sense)
2069 /* print message according to log or message to operator mode */
2070 if ((sense[24] & DASD_SIM_MSG_TO_OP) || (sense[1] & 0x10)) {
2071 /* print SIM SRC from RefCode */
2072 dev_err(&device->cdev->dev, "SIM - SRC: "
2073 "%02x%02x%02x%02x\n", sense[22],
2074 sense[23], sense[11], sense[12]);
2075 } else if (sense[24] & DASD_SIM_LOG) {
2076 /* print SIM SRC Refcode */
2077 dev_warn(&device->cdev->dev, "log SIM - SRC: "
2078 "%02x%02x%02x%02x\n", sense[22],
2079 sense[23], sense[11], sense[12]);
2084 * DASD_3990_ERP_INSPECT_32
2087 * Does a detailed inspection of the 32 byte sense data
2088 * and sets up a related error recovery action.
2091 * sense sense data of the actual error
2092 * erp pointer to the currently created default ERP
2095 * erp_filled pointer to the ERP
2098 static struct dasd_ccw_req *
2099 dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense)
2102 struct dasd_device *device = erp->startdev;
2104 erp->function = dasd_3990_erp_inspect_32;
2106 /* check for SIM sense data */
2107 if ((sense[6] & DASD_SIM_SENSE) == DASD_SIM_SENSE)
2108 dasd_3990_erp_handle_sim(device, sense);
2110 if (sense[25] & DASD_SENSE_BIT_0) {
2112 /* compound program action codes (byte25 bit 0 == '1') */
2113 dasd_3990_erp_compound_retry(erp, sense);
2117 /* single program action codes (byte25 bit 0 == '0') */
2118 switch (sense[25]) {
2120 case 0x00: /* success - use default ERP for retries */
2121 DBF_DEV_EVENT(DBF_DEBUG, device, "%s",
2122 "ERP called for successful request"
2126 case 0x01: /* fatal error */
2127 dev_err(&device->cdev->dev,
2128 "ERP failed for the DASD\n");
2130 erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
2133 case 0x02: /* intervention required */
2134 case 0x03: /* intervention required during dual copy */
2135 erp = dasd_3990_erp_int_req(erp);
2138 case 0x0F: /* length mismatch during update write command
2139 internal error 08 - update write command error*/
2140 dev_err(&device->cdev->dev, "An error occurred in the "
2141 "DASD device driver, reason=%s\n", "08");
2143 erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
2146 case 0x10: /* logging required for other channel program */
2147 erp = dasd_3990_erp_action_10_32(erp, sense);
2150 case 0x15: /* next track outside defined extend
2151 internal error 07 - The next track is not
2152 within the defined storage extent */
2153 dev_err(&device->cdev->dev,
2154 "An error occurred in the DASD device driver, "
2155 "reason=%s\n", "07");
2157 erp = dasd_3990_erp_cleanup(erp, DASD_CQR_FAILED);
2160 case 0x1B: /* unexpected condition during write */
2162 erp = dasd_3990_erp_action_1B_32(erp, sense);
2165 case 0x1C: /* invalid data */
2166 dev_emerg(&device->cdev->dev,
2167 "Data recovered during retry with PCI "
2168 "fetch mode active\n");
2170 /* not possible to handle this situation in Linux */
2172 ("Invalid data - No way to inform application "
2173 "about the possibly incorrect data");
2176 case 0x1D: /* state-change pending */
2177 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
2178 "A State change pending condition exists "
2179 "for the subsystem or device");
2181 erp = dasd_3990_erp_action_4(erp, sense);
2184 case 0x1E: /* busy */
2185 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
2186 "Busy condition exists "
2187 "for the subsystem or device");
2188 erp = dasd_3990_erp_action_4(erp, sense);
2191 default: /* all others errors - default erp */
2198 } /* end dasd_3990_erp_inspect_32 */
2201 *****************************************************************************
2202 * main ERP control functions (24 and 32 byte sense)
2203 *****************************************************************************
2207 * DASD_3990_ERP_CONTROL_CHECK
2210 * Does a generic inspection if a control check occured and sets up
2211 * the related error recovery procedure
2214 * erp pointer to the currently created default ERP
2217 * erp_filled pointer to the erp
2220 static struct dasd_ccw_req *
2221 dasd_3990_erp_control_check(struct dasd_ccw_req *erp)
2223 struct dasd_device *device = erp->startdev;
2225 if (scsw_cstat(&erp->refers->irb.scsw) & (SCHN_STAT_INTF_CTRL_CHK
2226 | SCHN_STAT_CHN_CTRL_CHK)) {
2227 DBF_DEV_EVENT(DBF_WARNING, device, "%s",
2228 "channel or interface control check");
2229 erp = dasd_3990_erp_action_4(erp, NULL);
2235 * DASD_3990_ERP_INSPECT
2238 * Does a detailed inspection for sense data by calling either
2239 * the 24-byte or the 32-byte inspection routine.
2242 * erp pointer to the currently created default ERP
2244 * erp_new contens was possibly modified
2246 static struct dasd_ccw_req *
2247 dasd_3990_erp_inspect(struct dasd_ccw_req *erp)
2250 struct dasd_ccw_req *erp_new = NULL;
2253 /* if this problem occured on an alias retry on base */
2254 erp_new = dasd_3990_erp_inspect_alias(erp);
2258 /* sense data are located in the refers record of the
2259 * already set up new ERP !
2260 * check if concurrent sens is available
2262 sense = dasd_get_sense(&erp->refers->irb);
2264 erp_new = dasd_3990_erp_control_check(erp);
2265 /* distinguish between 24 and 32 byte sense data */
2266 else if (sense[27] & DASD_SENSE_BIT_0) {
2268 /* inspect the 24 byte sense data */
2269 erp_new = dasd_3990_erp_inspect_24(erp, sense);
2273 /* inspect the 32 byte sense data */
2274 erp_new = dasd_3990_erp_inspect_32(erp, sense);
2276 } /* end distinguish between 24 and 32 byte sense data */
2282 * DASD_3990_ERP_ADD_ERP
2285 * This funtion adds an additional request block (ERP) to the head of
2286 * the given cqr (or erp).
2287 * For a command mode cqr the erp is initialized as an default erp
2289 * For transport mode we make a copy of the original TCW (points to
2290 * the original TCCB, TIDALs, etc.) but give it a fresh
2291 * TSB so the original sense data will not be changed.
2294 * cqr head of the current ERP-chain (or single cqr if
2297 * erp pointer to new ERP-chain head
2299 static struct dasd_ccw_req *dasd_3990_erp_add_erp(struct dasd_ccw_req *cqr)
2302 struct dasd_device *device = cqr->startdev;
2304 struct dasd_ccw_req *erp;
2305 int cplength, datasize;
2309 if (cqr->cpmode == 1) {
2311 /* TCW needs to be 64 byte aligned, so leave enough room */
2312 datasize = 64 + sizeof(struct tcw) + sizeof(struct tsb);
2318 /* allocate additional request block */
2319 erp = dasd_alloc_erp_request((char *) &cqr->magic,
2320 cplength, datasize, device);
2322 if (cqr->retries <= 0) {
2323 DBF_DEV_EVENT(DBF_ERR, device, "%s",
2324 "Unable to allocate ERP request");
2325 cqr->status = DASD_CQR_FAILED;
2326 cqr->stopclk = get_clock ();
2328 DBF_DEV_EVENT(DBF_ERR, device,
2329 "Unable to allocate ERP request "
2330 "(%i retries left)",
2332 dasd_block_set_timer(device->block, (HZ << 3));
2338 if (cqr->cpmode == 1) {
2339 /* make a shallow copy of the original tcw but set new tsb */
2341 erp->cpaddr = PTR_ALIGN(erp->data, 64);
2343 tsb = (struct tsb *) &tcw[1];
2344 *tcw = *((struct tcw *)cqr->cpaddr);
2345 tcw->tsb = (long)tsb;
2346 } else if (ccw->cmd_code == DASD_ECKD_CCW_PSF) {
2347 /* PSF cannot be chained from NOOP/TIC */
2348 erp->cpaddr = cqr->cpaddr;
2350 /* initialize request with default TIC to current ERP/CQR */
2352 ccw->cmd_code = CCW_CMD_NOOP;
2353 ccw->flags = CCW_FLAG_CC;
2355 ccw->cmd_code = CCW_CMD_TIC;
2356 ccw->cda = (long)(cqr->cpaddr);
2359 erp->flags = cqr->flags;
2360 erp->function = dasd_3990_erp_add_erp;
2362 erp->startdev = device;
2363 erp->memdev = device;
2364 erp->block = cqr->block;
2365 erp->magic = cqr->magic;
2368 erp->buildclk = get_clock();
2369 erp->status = DASD_CQR_FILLED;
2375 * DASD_3990_ERP_ADDITIONAL_ERP
2378 * An additional ERP is needed to handle the current error.
2379 * Add ERP to the head of the ERP-chain containing the ERP processing
2380 * determined based on the sense data.
2383 * cqr head of the current ERP-chain (or single cqr if
2387 * erp pointer to new ERP-chain head
2389 static struct dasd_ccw_req *
2390 dasd_3990_erp_additional_erp(struct dasd_ccw_req * cqr)
2393 struct dasd_ccw_req *erp = NULL;
2395 /* add erp and initialize with default TIC */
2396 erp = dasd_3990_erp_add_erp(cqr);
2401 /* inspect sense, determine specific ERP if possible */
2404 erp = dasd_3990_erp_inspect(erp);
2409 } /* end dasd_3990_erp_additional_erp */
2412 * DASD_3990_ERP_ERROR_MATCH
2415 * Check if the device status of the given cqr is the same.
2416 * This means that the failed CCW and the relevant sense data
2418 * I don't distinguish between 24 and 32 byte sense because in case of
2419 * 24 byte sense byte 25 and 27 is set as well.
2422 * cqr1 first cqr, which will be compared with the
2426 * match 'boolean' for match found
2427 * returns 1 if match found, otherwise 0.
2429 static int dasd_3990_erp_error_match(struct dasd_ccw_req *cqr1,
2430 struct dasd_ccw_req *cqr2)
2432 char *sense1, *sense2;
2434 if (cqr1->startdev != cqr2->startdev)
2437 sense1 = dasd_get_sense(&cqr1->irb);
2438 sense2 = dasd_get_sense(&cqr2->irb);
2440 /* one request has sense data, the other not -> no match, return 0 */
2441 if (!sense1 != !sense2)
2443 /* no sense data in both cases -> check cstat for IFCC */
2444 if (!sense1 && !sense2) {
2445 if ((scsw_cstat(&cqr1->irb.scsw) & (SCHN_STAT_INTF_CTRL_CHK |
2446 SCHN_STAT_CHN_CTRL_CHK)) ==
2447 (scsw_cstat(&cqr2->irb.scsw) & (SCHN_STAT_INTF_CTRL_CHK |
2448 SCHN_STAT_CHN_CTRL_CHK)))
2449 return 1; /* match with ifcc*/
2451 /* check sense data; byte 0-2,25,27 */
2452 if (!(sense1 && sense2 &&
2453 (memcmp(sense1, sense2, 3) == 0) &&
2454 (sense1[27] == sense2[27]) &&
2455 (sense1[25] == sense2[25]))) {
2457 return 0; /* sense doesn't match */
2460 return 1; /* match */
2462 } /* end dasd_3990_erp_error_match */
2465 * DASD_3990_ERP_IN_ERP
2468 * check if the current error already happened before.
2469 * quick exit if current cqr is not an ERP (cqr->refers=NULL)
2472 * cqr failed cqr (either original cqr or already an erp)
2475 * erp erp-pointer to the already defined error
2476 * recovery procedure OR
2477 * NULL if a 'new' error occurred.
2479 static struct dasd_ccw_req *
2480 dasd_3990_erp_in_erp(struct dasd_ccw_req *cqr)
2483 struct dasd_ccw_req *erp_head = cqr, /* save erp chain head */
2484 *erp_match = NULL; /* save erp chain head */
2485 int match = 0; /* 'boolean' for matching error found */
2487 if (cqr->refers == NULL) { /* return if not in erp */
2491 /* check the erp/cqr chain for current error */
2493 match = dasd_3990_erp_error_match(erp_head, cqr->refers);
2494 erp_match = cqr; /* save possible matching erp */
2495 cqr = cqr->refers; /* check next erp/cqr in queue */
2497 } while ((cqr->refers != NULL) && (!match));
2500 return NULL; /* no match was found */
2503 return erp_match; /* return address of matching erp */
2505 } /* END dasd_3990_erp_in_erp */
2508 * DASD_3990_ERP_FURTHER_ERP (24 & 32 byte sense)
2511 * No retry is left for the current ERP. Check what has to be done
2513 * - do further defined ERP action or
2514 * - wait for interrupt or
2515 * - exit with permanent error
2518 * erp ERP which is in progress with no retry left
2521 * erp modified/additional ERP
2523 static struct dasd_ccw_req *
2524 dasd_3990_erp_further_erp(struct dasd_ccw_req *erp)
2527 struct dasd_device *device = erp->startdev;
2528 char *sense = dasd_get_sense(&erp->irb);
2530 /* check for 24 byte sense ERP */
2531 if ((erp->function == dasd_3990_erp_bus_out) ||
2532 (erp->function == dasd_3990_erp_action_1) ||
2533 (erp->function == dasd_3990_erp_action_4)) {
2535 erp = dasd_3990_erp_action_1(erp);
2537 } else if (erp->function == dasd_3990_erp_action_1_sec) {
2538 erp = dasd_3990_erp_action_1_sec(erp);
2539 } else if (erp->function == dasd_3990_erp_action_5) {
2541 /* retries have not been successful */
2542 /* prepare erp for retry on different channel path */
2543 erp = dasd_3990_erp_action_1(erp);
2545 if (sense && !(sense[2] & DASD_SENSE_BIT_0)) {
2547 /* issue a Diagnostic Control command with an
2548 * Inhibit Write subcommand */
2550 switch (sense[25]) {
2552 case 0x57:{ /* controller */
2553 erp = dasd_3990_erp_DCTL(erp, 0x20);
2557 case 0x58:{ /* channel path */
2558 erp = dasd_3990_erp_DCTL(erp, 0x40);
2562 case 0x59:{ /* storage director */
2563 erp = dasd_3990_erp_DCTL(erp, 0x80);
2567 DBF_DEV_EVENT(DBF_WARNING, device,
2568 "invalid subcommand modifier 0x%x "
2569 "for Diagnostic Control Command",
2574 /* check for 32 byte sense ERP */
2576 ((erp->function == dasd_3990_erp_compound_retry) ||
2577 (erp->function == dasd_3990_erp_compound_path) ||
2578 (erp->function == dasd_3990_erp_compound_code) ||
2579 (erp->function == dasd_3990_erp_compound_config))) {
2581 erp = dasd_3990_erp_compound(erp, sense);
2585 * No retry left and no additional special handling
2588 dev_err(&device->cdev->dev,
2589 "ERP %p has run out of retries and failed\n", erp);
2591 erp->status = DASD_CQR_FAILED;
2596 } /* end dasd_3990_erp_further_erp */
2599 * DASD_3990_ERP_HANDLE_MATCH_ERP
2602 * An error occurred again and an ERP has been detected which is already
2603 * used to handle this error (e.g. retries).
2604 * All prior ERP's are asumed to be successful and therefore removed
2606 * If retry counter of matching erp is already 0, it is checked if further
2607 * action is needed (besides retry) or if the ERP has failed.
2610 * erp_head first ERP in ERP-chain
2611 * erp ERP that handles the actual error.
2615 * erp modified/additional ERP
2617 static struct dasd_ccw_req *
2618 dasd_3990_erp_handle_match_erp(struct dasd_ccw_req *erp_head,
2619 struct dasd_ccw_req *erp)
2622 struct dasd_device *device = erp_head->startdev;
2623 struct dasd_ccw_req *erp_done = erp_head; /* finished req */
2624 struct dasd_ccw_req *erp_free = NULL; /* req to be freed */
2626 /* loop over successful ERPs and remove them from chanq */
2627 while (erp_done != erp) {
2629 if (erp_done == NULL) /* end of chain reached */
2630 panic(PRINTK_HEADER "Programming error in ERP! The "
2631 "original request was lost\n");
2633 /* remove the request from the device queue */
2634 list_del(&erp_done->blocklist);
2636 erp_free = erp_done;
2637 erp_done = erp_done->refers;
2639 /* free the finished erp request */
2640 dasd_free_erp_request(erp_free, erp_free->memdev);
2644 if (erp->retries > 0) {
2646 char *sense = dasd_get_sense(&erp->refers->irb);
2648 /* check for special retries */
2649 if (sense && erp->function == dasd_3990_erp_action_4) {
2651 erp = dasd_3990_erp_action_4(erp, sense);
2654 erp->function == dasd_3990_erp_action_1B_32) {
2656 erp = dasd_3990_update_1B(erp, sense);
2658 } else if (sense && erp->function == dasd_3990_erp_int_req) {
2660 erp = dasd_3990_erp_int_req(erp);
2664 DBF_DEV_EVENT(DBF_DEBUG, device,
2665 "%i retries left for erp %p",
2668 /* handle the request again... */
2669 erp->status = DASD_CQR_FILLED;
2673 /* no retry left - check for further necessary action */
2674 /* if no further actions, handle rest as permanent error */
2675 erp = dasd_3990_erp_further_erp(erp);
2680 } /* end dasd_3990_erp_handle_match_erp */
2683 * DASD_3990_ERP_ACTION
2686 * control routine for 3990 erp actions.
2687 * Has to be called with the queue lock (namely the s390_irq_lock) acquired.
2690 * cqr failed cqr (either original cqr or already an erp)
2693 * erp erp-pointer to the head of the ERP action chain.
2695 * - either a ptr to an additional ERP cqr or
2696 * - the original given cqr (which's status might
2699 struct dasd_ccw_req *
2700 dasd_3990_erp_action(struct dasd_ccw_req * cqr)
2702 struct dasd_ccw_req *erp = NULL;
2703 struct dasd_device *device = cqr->startdev;
2704 struct dasd_ccw_req *temp_erp = NULL;
2706 if (device->features & DASD_FEATURE_ERPLOG) {
2707 /* print current erp_chain */
2708 dev_err(&device->cdev->dev,
2709 "ERP chain at BEGINNING of ERP-ACTION\n");
2710 for (temp_erp = cqr;
2711 temp_erp != NULL; temp_erp = temp_erp->refers) {
2713 dev_err(&device->cdev->dev,
2714 "ERP %p (%02x) refers to %p\n",
2715 temp_erp, temp_erp->status,
2720 /* double-check if current erp/cqr was successful */
2721 if ((scsw_cstat(&cqr->irb.scsw) == 0x00) &&
2722 (scsw_dstat(&cqr->irb.scsw) ==
2723 (DEV_STAT_CHN_END | DEV_STAT_DEV_END))) {
2725 DBF_DEV_EVENT(DBF_DEBUG, device,
2726 "ERP called for successful request %p"
2727 " - NO ERP necessary", cqr);
2729 cqr->status = DASD_CQR_DONE;
2734 /* check if error happened before */
2735 erp = dasd_3990_erp_in_erp(cqr);
2738 /* no matching erp found - set up erp */
2739 erp = dasd_3990_erp_additional_erp(cqr);
2743 /* matching erp found - set all leading erp's to DONE */
2744 erp = dasd_3990_erp_handle_match_erp(cqr, erp);
2747 if (device->features & DASD_FEATURE_ERPLOG) {
2748 /* print current erp_chain */
2749 dev_err(&device->cdev->dev,
2750 "ERP chain at END of ERP-ACTION\n");
2751 for (temp_erp = erp;
2752 temp_erp != NULL; temp_erp = temp_erp->refers) {
2754 dev_err(&device->cdev->dev,
2755 "ERP %p (%02x) refers to %p\n",
2756 temp_erp, temp_erp->status,
2761 /* enqueue ERP request if it's a new one */
2762 if (list_empty(&erp->blocklist)) {
2763 cqr->status = DASD_CQR_IN_ERP;
2764 /* add erp request before the cqr */
2765 list_add_tail(&erp->blocklist, &cqr->blocklist);
2772 } /* end dasd_3990_erp_action */