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
11 #include <linux/timer.h>
12 #include <linux/slab.h>
13 #include <asm/idals.h>
14 #include <asm/todclk.h>
16 #define PRINTK_HEADER "dasd_erp(3990): "
19 #include "dasd_eckd.h"
23 unsigned char subcommand
; /* e.g Inhibit Write, Enable Write,... */
24 unsigned char modifier
; /* Subcommand modifier */
25 unsigned short res
; /* reserved */
26 } __attribute__ ((packed
));
29 *****************************************************************************
30 * SECTION ERP EXAMINATION
31 *****************************************************************************
35 * DASD_3990_ERP_EXAMINE_24
38 * Checks only for fatal (unrecoverable) error.
39 * A detailed examination of the sense data is done later outside
40 * the interrupt handler.
42 * Each bit configuration leading to an action code 2 (Exit with
43 * programming error or unusual condition indication)
44 * are handled as fatal errorĀ“s.
46 * All other configurations are handled as recoverable errors.
49 * dasd_era_fatal for all fatal (unrecoverable errors)
50 * dasd_era_recover for all others.
53 dasd_3990_erp_examine_24(struct dasd_ccw_req
* cqr
, char *sense
)
56 struct dasd_device
*device
= cqr
->device
;
58 /* check for 'Command Reject' */
59 if ((sense
[0] & SNS0_CMD_REJECT
) &&
60 (!(sense
[2] & SNS2_ENV_DATA_PRESENT
))) {
62 DEV_MESSAGE(KERN_ERR
, device
, "%s",
63 "EXAMINE 24: Command Reject detected - "
66 return dasd_era_fatal
;
69 /* check for 'Invalid Track Format' */
70 if ((sense
[1] & SNS1_INV_TRACK_FORMAT
) &&
71 (!(sense
[2] & SNS2_ENV_DATA_PRESENT
))) {
73 DEV_MESSAGE(KERN_ERR
, device
, "%s",
74 "EXAMINE 24: Invalid Track Format detected "
77 return dasd_era_fatal
;
80 /* check for 'No Record Found' */
81 if (sense
[1] & SNS1_NO_REC_FOUND
) {
83 /* FIXME: fatal error ?!? */
84 DEV_MESSAGE(KERN_ERR
, device
,
85 "EXAMINE 24: No Record Found detected %s",
86 device
->state
<= DASD_STATE_BASIC
?
87 " " : "- fatal error");
89 return dasd_era_fatal
;
92 /* return recoverable for all others */
93 return dasd_era_recover
;
94 } /* END dasd_3990_erp_examine_24 */
97 * DASD_3990_ERP_EXAMINE_32
100 * Checks only for fatal/no/recoverable error.
101 * A detailed examination of the sense data is done later outside
102 * the interrupt handler.
105 * dasd_era_none no error
106 * dasd_era_fatal for all fatal (unrecoverable errors)
107 * dasd_era_recover for recoverable others.
110 dasd_3990_erp_examine_32(struct dasd_ccw_req
* cqr
, char *sense
)
113 struct dasd_device
*device
= cqr
->device
;
117 return dasd_era_none
;
120 DEV_MESSAGE(KERN_ERR
, device
, "%s", "EXAMINE 32: fatal error");
122 return dasd_era_fatal
;
126 return dasd_era_recover
;
129 } /* end dasd_3990_erp_examine_32 */
132 * DASD_3990_ERP_EXAMINE
135 * Checks only for fatal/no/recover error.
136 * A detailed examination of the sense data is done later outside
137 * the interrupt handler.
139 * The logic is based on the 'IBM 3990 Storage Control Reference' manual
140 * 'Chapter 7. Error Recovery Procedures'.
143 * dasd_era_none no error
144 * dasd_era_fatal for all fatal (unrecoverable errors)
145 * dasd_era_recover for all others.
148 dasd_3990_erp_examine(struct dasd_ccw_req
* cqr
, struct irb
* irb
)
151 char *sense
= irb
->ecw
;
152 dasd_era_t era
= dasd_era_recover
;
153 struct dasd_device
*device
= cqr
->device
;
155 /* check for successful execution first */
156 if (irb
->scsw
.cstat
== 0x00 &&
157 irb
->scsw
.dstat
== (DEV_STAT_CHN_END
| DEV_STAT_DEV_END
))
158 return dasd_era_none
;
160 /* distinguish between 24 and 32 byte sense data */
161 if (sense
[27] & DASD_SENSE_BIT_0
) {
163 era
= dasd_3990_erp_examine_24(cqr
, sense
);
167 era
= dasd_3990_erp_examine_32(cqr
, sense
);
171 /* log the erp chain if fatal error occurred */
172 if ((era
== dasd_era_fatal
) && (device
->state
>= DASD_STATE_READY
)) {
173 dasd_log_sense(cqr
, irb
);
174 dasd_log_ccw(cqr
, 0, irb
->scsw
.cpa
);
179 } /* END dasd_3990_erp_examine */
182 *****************************************************************************
183 * SECTION ERP HANDLING
184 *****************************************************************************
187 *****************************************************************************
188 * 24 and 32 byte sense ERP functions
189 *****************************************************************************
193 * DASD_3990_ERP_CLEANUP
196 * Removes the already build but not necessary ERP request and sets
197 * the status of the original cqr / erp to the given (final) status
200 * erp request to be blocked
201 * final_status either DASD_CQR_DONE or DASD_CQR_FAILED
206 static struct dasd_ccw_req
*
207 dasd_3990_erp_cleanup(struct dasd_ccw_req
* erp
, char final_status
)
209 struct dasd_ccw_req
*cqr
= erp
->refers
;
211 dasd_free_erp_request(erp
, erp
->device
);
212 cqr
->status
= final_status
;
215 } /* end dasd_3990_erp_cleanup */
218 * DASD_3990_ERP_BLOCK_QUEUE
221 * Block the given device request queue to prevent from further
222 * processing until the started timer has expired or an related
223 * interrupt was received.
226 dasd_3990_erp_block_queue(struct dasd_ccw_req
* erp
, int expires
)
229 struct dasd_device
*device
= erp
->device
;
231 DEV_MESSAGE(KERN_INFO
, device
,
232 "blocking request queue for %is", expires
);
234 device
->stopped
|= DASD_STOPPED_PENDING
;
235 erp
->status
= DASD_CQR_QUEUED
;
237 dasd_set_timer(device
, expires
);
241 * DASD_3990_ERP_INT_REQ
244 * Handles 'Intervention Required' error.
245 * This means either device offline or not installed.
252 static struct dasd_ccw_req
*
253 dasd_3990_erp_int_req(struct dasd_ccw_req
* erp
)
256 struct dasd_device
*device
= erp
->device
;
258 /* first time set initial retry counter and erp_function */
259 /* and retry once without blocking queue */
260 /* (this enables easier enqueing of the cqr) */
261 if (erp
->function
!= dasd_3990_erp_int_req
) {
264 erp
->function
= dasd_3990_erp_int_req
;
268 /* issue a message and wait for 'device ready' interrupt */
269 DEV_MESSAGE(KERN_ERR
, device
, "%s",
270 "is offline or not installed - "
271 "INTERVENTION REQUIRED!!");
273 dasd_3990_erp_block_queue(erp
, 60*HZ
);
278 } /* end dasd_3990_erp_int_req */
281 * DASD_3990_ERP_ALTERNATE_PATH
284 * Repeat the operation on a different channel path.
285 * If all alternate paths have been tried, the request is posted with a
289 * erp pointer to the current ERP
292 * erp modified pointer to the ERP
295 dasd_3990_erp_alternate_path(struct dasd_ccw_req
* erp
)
297 struct dasd_device
*device
= erp
->device
;
300 /* try alternate valid path */
301 opm
= ccw_device_get_path_mask(device
->cdev
);
302 //FIXME: start with get_opm ?
304 erp
->lpm
= LPM_ANYPATH
& ~(erp
->dstat
->esw
.esw0
.sublog
.lpum
);
306 erp
->lpm
&= ~(erp
->dstat
->esw
.esw0
.sublog
.lpum
);
308 if ((erp
->lpm
& opm
) != 0x00) {
310 DEV_MESSAGE(KERN_DEBUG
, device
,
311 "try alternate lpm=%x (lpum=%x / opm=%x)",
312 erp
->lpm
, erp
->dstat
->esw
.esw0
.sublog
.lpum
, opm
);
314 /* reset status to queued to handle the request again... */
315 erp
->status
= DASD_CQR_QUEUED
;
318 DEV_MESSAGE(KERN_ERR
, device
,
319 "No alternate channel path left (lpum=%x / "
320 "opm=%x) -> permanent error",
321 erp
->dstat
->esw
.esw0
.sublog
.lpum
, opm
);
323 /* post request with permanent error */
324 erp
->status
= DASD_CQR_FAILED
;
326 } /* end dasd_3990_erp_alternate_path */
332 * Setup cqr to do the Diagnostic Control (DCTL) command with an
333 * Inhibit Write subcommand (0x20) and the given modifier.
336 * erp pointer to the current (failed) ERP
337 * modifier subcommand modifier
340 * dctl_cqr pointer to NEW dctl_cqr
343 static struct dasd_ccw_req
*
344 dasd_3990_erp_DCTL(struct dasd_ccw_req
* erp
, char modifier
)
347 struct dasd_device
*device
= erp
->device
;
348 struct DCTL_data
*DCTL_data
;
350 struct dasd_ccw_req
*dctl_cqr
;
352 dctl_cqr
= dasd_alloc_erp_request((char *) &erp
->magic
, 1,
353 sizeof (struct DCTL_data
),
355 if (IS_ERR(dctl_cqr
)) {
356 DEV_MESSAGE(KERN_ERR
, device
, "%s",
357 "Unable to allocate DCTL-CQR");
358 erp
->status
= DASD_CQR_FAILED
;
362 DCTL_data
= dctl_cqr
->data
;
364 DCTL_data
->subcommand
= 0x02; /* Inhibit Write */
365 DCTL_data
->modifier
= modifier
;
367 ccw
= dctl_cqr
->cpaddr
;
368 memset(ccw
, 0, sizeof (struct ccw1
));
369 ccw
->cmd_code
= CCW_CMD_DCTL
;
371 ccw
->cda
= (__u32
)(addr_t
) DCTL_data
;
372 dctl_cqr
->function
= dasd_3990_erp_DCTL
;
373 dctl_cqr
->refers
= erp
;
374 dctl_cqr
->device
= erp
->device
;
375 dctl_cqr
->magic
= erp
->magic
;
376 dctl_cqr
->expires
= 5 * 60 * HZ
;
377 dctl_cqr
->retries
= 2;
379 dctl_cqr
->buildclk
= get_clock();
381 dctl_cqr
->status
= DASD_CQR_FILLED
;
385 } /* end dasd_3990_erp_DCTL */
388 * DASD_3990_ERP_ACTION_1
391 * Setup ERP to do the ERP action 1 (see Reference manual).
392 * Repeat the operation on a different channel path.
393 * If all alternate paths have been tried, the request is posted with a
395 * Note: duplex handling is not implemented (yet).
398 * erp pointer to the current ERP
401 * erp pointer to the ERP
404 static struct dasd_ccw_req
*
405 dasd_3990_erp_action_1(struct dasd_ccw_req
* erp
)
408 erp
->function
= dasd_3990_erp_action_1
;
410 dasd_3990_erp_alternate_path(erp
);
414 } /* end dasd_3990_erp_action_1 */
417 * DASD_3990_ERP_ACTION_4
420 * Setup ERP to do the ERP action 4 (see Reference manual).
421 * Set the current request to PENDING to block the CQR queue for that device
422 * until the state change interrupt appears.
423 * Use a timer (20 seconds) to retry the cqr if the interrupt is still missing.
426 * sense sense data of the actual error
427 * erp pointer to the current ERP
430 * erp pointer to the ERP
433 static struct dasd_ccw_req
*
434 dasd_3990_erp_action_4(struct dasd_ccw_req
* erp
, char *sense
)
437 struct dasd_device
*device
= erp
->device
;
439 /* first time set initial retry counter and erp_function */
440 /* and retry once without waiting for state change pending */
441 /* interrupt (this enables easier enqueing of the cqr) */
442 if (erp
->function
!= dasd_3990_erp_action_4
) {
445 erp
->function
= dasd_3990_erp_action_4
;
449 if (sense
[25] == 0x1D) { /* state change pending */
451 DEV_MESSAGE(KERN_INFO
, device
,
452 "waiting for state change pending "
453 "interrupt, %d retries left",
456 dasd_3990_erp_block_queue(erp
, 30*HZ
);
460 /* no state change pending - retry */
461 DEV_MESSAGE (KERN_INFO
, device
,
462 "redriving request immediately, "
465 erp
->status
= DASD_CQR_QUEUED
;
471 } /* end dasd_3990_erp_action_4 */
474 *****************************************************************************
475 * 24 byte sense ERP functions (only)
476 *****************************************************************************
480 * DASD_3990_ERP_ACTION_5
483 * Setup ERP to do the ERP action 5 (see Reference manual).
484 * NOTE: Further handling is done in xxx_further_erp after the retries.
487 * erp pointer to the current ERP
490 * erp pointer to the ERP
493 static struct dasd_ccw_req
*
494 dasd_3990_erp_action_5(struct dasd_ccw_req
* erp
)
497 /* first of all retry */
499 erp
->function
= dasd_3990_erp_action_5
;
503 } /* end dasd_3990_erp_action_5 */
506 * DASD_3990_HANDLE_ENV_DATA
509 * Handles 24 byte 'Environmental data present'.
510 * Does a analysis of the sense data (message Format)
511 * and prints the error messages.
514 * sense current sense data
520 dasd_3990_handle_env_data(struct dasd_ccw_req
* erp
, char *sense
)
523 struct dasd_device
*device
= erp
->device
;
524 char msg_format
= (sense
[7] & 0xF0);
525 char msg_no
= (sense
[7] & 0x0F);
527 switch (msg_format
) {
528 case 0x00: /* Format 0 - Program or System Checks */
530 if (sense
[1] & 0x10) { /* check message to operator bit */
533 case 0x00: /* No Message */
536 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
537 "FORMAT 0 - Invalid Command");
540 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
541 "FORMAT 0 - Invalid Command "
545 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
546 "FORMAT 0 - CCW Count less than "
550 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
551 "FORMAT 0 - Invalid Parameter");
554 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
555 "FORMAT 0 - Diagnostic of Sepecial"
556 " Command Violates File Mask");
559 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
560 "FORMAT 0 - Channel Returned with "
561 "Incorrect retry CCW");
564 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
565 "FORMAT 0 - Reset Notification");
568 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
569 "FORMAT 0 - Storage Path Restart");
572 DEV_MESSAGE(KERN_WARNING
, device
,
573 "FORMAT 0 - Channel requested "
574 "... %02x", sense
[8]);
577 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
578 "FORMAT 0 - Invalid Defective/"
579 "Alternate Track Pointer");
582 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
583 "FORMAT 0 - DPS Installation "
587 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
588 "FORMAT 0 - Command Invalid on "
589 "Secondary Address");
592 DEV_MESSAGE(KERN_WARNING
, device
,
593 "FORMAT 0 - Status Not As "
594 "Required: reason %02x", sense
[8]);
597 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
598 "FORMAT 0 - Reseved");
602 case 0x00: /* No Message */
605 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
606 "FORMAT 0 - Device Error Source");
609 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
610 "FORMAT 0 - Reserved");
613 DEV_MESSAGE(KERN_WARNING
, device
,
614 "FORMAT 0 - Device Fenced - "
615 "device = %02x", sense
[4]);
618 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
619 "FORMAT 0 - Data Pinned for "
623 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
624 "FORMAT 0 - Reserved");
629 case 0x10: /* Format 1 - Device Equipment Checks */
631 case 0x00: /* No Message */
634 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
635 "FORMAT 1 - Device Status 1 not as "
639 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
640 "FORMAT 1 - Index missing");
643 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
644 "FORMAT 1 - Interruption cannot be reset");
647 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
648 "FORMAT 1 - Device did not respond to "
652 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
653 "FORMAT 1 - Device check-2 error or Set "
654 "Sector is not complete");
657 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
658 "FORMAT 1 - Head address does not "
662 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
663 "FORMAT 1 - Device status 1 not valid");
666 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
667 "FORMAT 1 - Device not ready");
670 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
671 "FORMAT 1 - Track physical address did "
675 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
676 "FORMAT 1 - Missing device address bit");
679 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
680 "FORMAT 1 - Drive motor switch is off");
683 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
684 "FORMAT 1 - Seek incomplete");
687 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
688 "FORMAT 1 - Cylinder address did not "
692 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
693 "FORMAT 1 - Offset active cannot be "
697 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
698 "FORMAT 1 - Reserved");
702 case 0x20: /* Format 2 - 3990 Equipment Checks */
705 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
706 "FORMAT 2 - 3990 check-2 error");
709 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
710 "FORMAT 2 - Support facility errors");
713 DEV_MESSAGE(KERN_WARNING
, device
,
714 "FORMAT 2 - Microcode detected error %02x",
718 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
719 "FORMAT 2 - Reserved");
723 case 0x30: /* Format 3 - 3990 Control Checks */
726 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
727 "FORMAT 3 - Allegiance terminated");
730 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
731 "FORMAT 3 - Reserved");
735 case 0x40: /* Format 4 - Data Checks */
738 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
739 "FORMAT 4 - Home address area error");
742 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
743 "FORMAT 4 - Count area error");
746 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
747 "FORMAT 4 - Key area error");
750 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
751 "FORMAT 4 - Data area error");
754 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
755 "FORMAT 4 - No sync byte in home address "
759 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
760 "FORMAT 4 - No sync byte in count address "
764 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
765 "FORMAT 4 - No sync byte in key area");
768 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
769 "FORMAT 4 - No sync byte in data area");
772 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
773 "FORMAT 4 - Home address area error; "
777 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
778 "FORMAT 4 - Count area error; offset "
782 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
783 "FORMAT 4 - Key area error; offset "
787 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
788 "FORMAT 4 - Data area error; "
792 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
793 "FORMAT 4 - No sync byte in home "
794 "address area; offset active");
797 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
798 "FORMAT 4 - No syn byte in count "
799 "address area; offset active");
802 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
803 "FORMAT 4 - No sync byte in key area; "
807 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
808 "FORMAT 4 - No syn byte in data area; "
812 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
813 "FORMAT 4 - Reserved");
817 case 0x50: /* Format 5 - Data Check with displacement information */
820 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
821 "FORMAT 5 - Data Check in the "
822 "home address area");
825 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
826 "FORMAT 5 - Data Check in the count area");
829 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
830 "FORMAT 5 - Data Check in the key area");
833 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
834 "FORMAT 5 - Data Check in the data area");
837 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
838 "FORMAT 5 - Data Check in the "
839 "home address area; offset active");
842 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
843 "FORMAT 5 - Data Check in the count area; "
847 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
848 "FORMAT 5 - Data Check in the key area; "
852 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
853 "FORMAT 5 - Data Check in the data area; "
857 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
858 "FORMAT 5 - Reserved");
862 case 0x60: /* Format 6 - Usage Statistics/Overrun Errors */
865 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
866 "FORMAT 6 - Overrun on channel A");
869 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
870 "FORMAT 6 - Overrun on channel B");
873 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
874 "FORMAT 6 - Overrun on channel C");
877 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
878 "FORMAT 6 - Overrun on channel D");
881 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
882 "FORMAT 6 - Overrun on channel E");
885 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
886 "FORMAT 6 - Overrun on channel F");
889 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
890 "FORMAT 6 - Overrun on channel G");
893 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
894 "FORMAT 6 - Overrun on channel H");
897 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
898 "FORMAT 6 - Reserved");
902 case 0x70: /* Format 7 - Device Connection Control Checks */
905 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
906 "FORMAT 7 - RCC initiated by a connection "
910 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
911 "FORMAT 7 - RCC 1 sequence not "
915 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
916 "FORMAT 7 - RCC 1 and RCC 2 sequences not "
920 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
921 "FORMAT 7 - Invalid tag-in during "
922 "selection sequence");
925 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
926 "FORMAT 7 - extra RCC required");
929 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
930 "FORMAT 7 - Invalid DCC selection "
931 "response or timeout");
934 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
935 "FORMAT 7 - Missing end operation; device "
936 "transfer complete");
939 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
940 "FORMAT 7 - Missing end operation; device "
941 "transfer incomplete");
944 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
945 "FORMAT 7 - Invalid tag-in for an "
946 "immediate command sequence");
949 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
950 "FORMAT 7 - Invalid tag-in for an "
951 "extended command sequence");
954 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
955 "FORMAT 7 - 3990 microcode time out when "
956 "stopping selection");
959 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
960 "FORMAT 7 - No response to selection "
961 "after a poll interruption");
964 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
965 "FORMAT 7 - Permanent path error (DASD "
966 "controller not available)");
969 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
970 "FORMAT 7 - DASD controller not available"
971 " on disconnected command chain");
974 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
975 "FORMAT 7 - Reserved");
979 case 0x80: /* Format 8 - Additional Device Equipment Checks */
981 case 0x00: /* No Message */
983 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
984 "FORMAT 8 - Error correction code "
988 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
989 "FORMAT 8 - Unexpected end operation "
993 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
994 "FORMAT 8 - End operation with transfer "
998 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
999 "FORMAT 8 - End operation with transfer "
1003 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1004 "FORMAT 8 - DPS checks after a system "
1005 "reset or selective reset");
1008 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1009 "FORMAT 8 - DPS cannot be filled");
1012 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1013 "FORMAT 8 - Short busy time-out during "
1014 "device selection");
1017 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1018 "FORMAT 8 - DASD controller failed to "
1019 "set or reset the long busy latch");
1022 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1023 "FORMAT 8 - No interruption from device "
1024 "during a command chain");
1027 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1028 "FORMAT 8 - Reserved");
1032 case 0x90: /* Format 9 - Device Read, Write, and Seek Checks */
1035 break; /* No Message */
1037 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1038 "FORMAT 9 - Device check-2 error");
1041 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1042 "FORMAT 9 - Head address did not compare");
1045 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1046 "FORMAT 9 - Track physical address did "
1047 "not compare while oriented");
1050 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1051 "FORMAT 9 - Cylinder address did not "
1055 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1056 "FORMAT 9 - Reserved");
1060 case 0xF0: /* Format F - Cache Storage Checks */
1063 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1064 "FORMAT F - Operation Terminated");
1067 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1068 "FORMAT F - Subsystem Processing Error");
1071 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1072 "FORMAT F - Cache or nonvolatile storage "
1073 "equipment failure");
1076 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1077 "FORMAT F - Caching terminated");
1080 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1081 "FORMAT F - Cache fast write access not "
1085 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1086 "FORMAT F - Track format incorrect");
1089 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1090 "FORMAT F - Caching reinitiated");
1093 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1094 "FORMAT F - Nonvolatile storage "
1098 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1099 "FORMAT F - Volume is suspended duplex");
1102 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1103 "FORMAT F - Subsystem status connot be "
1107 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1108 "FORMAT F - Caching status reset to "
1112 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1113 "FORMAT F - DASD Fast Write inhibited");
1116 DEV_MESSAGE(KERN_WARNING
, device
, "%s",
1117 "FORMAT D - Reserved");
1121 default: /* unknown message format - should not happen */
1122 DEV_MESSAGE (KERN_WARNING
, device
,
1123 "unknown message format %02x",
1126 } /* end switch message format */
1128 } /* end dasd_3990_handle_env_data */
1131 * DASD_3990_ERP_COM_REJ
1134 * Handles 24 byte 'Command Reject' error.
1137 * erp current erp_head
1138 * sense current sense data
1141 * erp 'new' erp_head - pointer to new ERP
1143 static struct dasd_ccw_req
*
1144 dasd_3990_erp_com_rej(struct dasd_ccw_req
* erp
, char *sense
)
1147 struct dasd_device
*device
= erp
->device
;
1149 erp
->function
= dasd_3990_erp_com_rej
;
1151 /* env data present (ACTION 10 - retry should work) */
1152 if (sense
[2] & SNS2_ENV_DATA_PRESENT
) {
1154 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1155 "Command Reject - environmental data present");
1157 dasd_3990_handle_env_data(erp
, sense
);
1162 /* fatal error - set status to FAILED */
1163 DEV_MESSAGE(KERN_ERR
, device
, "%s",
1164 "Command Reject - Fatal error");
1166 erp
= dasd_3990_erp_cleanup(erp
, DASD_CQR_FAILED
);
1171 } /* end dasd_3990_erp_com_rej */
1174 * DASD_3990_ERP_BUS_OUT
1177 * Handles 24 byte 'Bus Out Parity Check' error.
1180 * erp current erp_head
1182 * erp new erp_head - pointer to new ERP
1184 static struct dasd_ccw_req
*
1185 dasd_3990_erp_bus_out(struct dasd_ccw_req
* erp
)
1188 struct dasd_device
*device
= erp
->device
;
1190 /* first time set initial retry counter and erp_function */
1191 /* and retry once without blocking queue */
1192 /* (this enables easier enqueing of the cqr) */
1193 if (erp
->function
!= dasd_3990_erp_bus_out
) {
1195 erp
->function
= dasd_3990_erp_bus_out
;
1199 /* issue a message and wait for 'device ready' interrupt */
1200 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1201 "bus out parity error or BOPC requested by "
1204 dasd_3990_erp_block_queue(erp
, 60*HZ
);
1210 } /* end dasd_3990_erp_bus_out */
1213 * DASD_3990_ERP_EQUIP_CHECK
1216 * Handles 24 byte 'Equipment Check' error.
1219 * erp current erp_head
1221 * erp new erp_head - pointer to new ERP
1223 static struct dasd_ccw_req
*
1224 dasd_3990_erp_equip_check(struct dasd_ccw_req
* erp
, char *sense
)
1227 struct dasd_device
*device
= erp
->device
;
1229 erp
->function
= dasd_3990_erp_equip_check
;
1231 if (sense
[1] & SNS1_WRITE_INHIBITED
) {
1233 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1234 "Write inhibited path encountered");
1236 /* vary path offline */
1237 DEV_MESSAGE(KERN_ERR
, device
, "%s",
1238 "Path should be varied off-line. "
1239 "This is not implemented yet \n - please report "
1240 "to linux390@de.ibm.com");
1242 erp
= dasd_3990_erp_action_1(erp
);
1244 } else if (sense
[2] & SNS2_ENV_DATA_PRESENT
) {
1246 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1247 "Equipment Check - " "environmental data present");
1249 dasd_3990_handle_env_data(erp
, sense
);
1251 erp
= dasd_3990_erp_action_4(erp
, sense
);
1253 } else if (sense
[1] & SNS1_PERM_ERR
) {
1255 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1256 "Equipment Check - retry exhausted or "
1259 erp
= dasd_3990_erp_action_1(erp
);
1262 /* all other equipment checks - Action 5 */
1263 /* rest is done when retries == 0 */
1264 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1265 "Equipment check or processing error");
1267 erp
= dasd_3990_erp_action_5(erp
);
1272 } /* end dasd_3990_erp_equip_check */
1275 * DASD_3990_ERP_DATA_CHECK
1278 * Handles 24 byte 'Data Check' error.
1281 * erp current erp_head
1283 * erp new erp_head - pointer to new ERP
1285 static struct dasd_ccw_req
*
1286 dasd_3990_erp_data_check(struct dasd_ccw_req
* erp
, char *sense
)
1289 struct dasd_device
*device
= erp
->device
;
1291 erp
->function
= dasd_3990_erp_data_check
;
1293 if (sense
[2] & SNS2_CORRECTABLE
) { /* correctable data check */
1295 /* issue message that the data has been corrected */
1296 DEV_MESSAGE(KERN_EMERG
, device
, "%s",
1297 "Data recovered during retry with PCI "
1298 "fetch mode active");
1300 /* not possible to handle this situation in Linux */
1301 panic("No way to inform appliction about the possibly "
1304 } else if (sense
[2] & SNS2_ENV_DATA_PRESENT
) {
1306 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1307 "Uncorrectable data check recovered secondary "
1308 "addr of duplex pair");
1310 erp
= dasd_3990_erp_action_4(erp
, sense
);
1312 } else if (sense
[1] & SNS1_PERM_ERR
) {
1314 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1315 "Uncorrectable data check with internal "
1318 erp
= dasd_3990_erp_action_1(erp
);
1321 /* all other data checks */
1322 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1323 "Uncorrectable data check with retry count "
1326 erp
= dasd_3990_erp_action_5(erp
);
1331 } /* end dasd_3990_erp_data_check */
1334 * DASD_3990_ERP_OVERRUN
1337 * Handles 24 byte 'Overrun' error.
1340 * erp current erp_head
1342 * erp new erp_head - pointer to new ERP
1344 static struct dasd_ccw_req
*
1345 dasd_3990_erp_overrun(struct dasd_ccw_req
* erp
, char *sense
)
1348 struct dasd_device
*device
= erp
->device
;
1350 erp
->function
= dasd_3990_erp_overrun
;
1352 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1353 "Overrun - service overrun or overrun"
1354 " error requested by channel");
1356 erp
= dasd_3990_erp_action_5(erp
);
1360 } /* end dasd_3990_erp_overrun */
1363 * DASD_3990_ERP_INV_FORMAT
1366 * Handles 24 byte 'Invalid Track Format' error.
1369 * erp current erp_head
1371 * erp new erp_head - pointer to new ERP
1373 static struct dasd_ccw_req
*
1374 dasd_3990_erp_inv_format(struct dasd_ccw_req
* erp
, char *sense
)
1377 struct dasd_device
*device
= erp
->device
;
1379 erp
->function
= dasd_3990_erp_inv_format
;
1381 if (sense
[2] & SNS2_ENV_DATA_PRESENT
) {
1383 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1384 "Track format error when destaging or "
1387 dasd_3990_handle_env_data(erp
, sense
);
1389 erp
= dasd_3990_erp_action_4(erp
, sense
);
1392 DEV_MESSAGE(KERN_ERR
, device
, "%s",
1393 "Invalid Track Format - Fatal error should have "
1394 "been handled within the interrupt handler");
1396 erp
= dasd_3990_erp_cleanup(erp
, DASD_CQR_FAILED
);
1401 } /* end dasd_3990_erp_inv_format */
1407 * Handles 24 byte 'End-of-Cylinder' error.
1410 * erp already added default erp
1412 * erp pointer to original (failed) cqr.
1414 static struct dasd_ccw_req
*
1415 dasd_3990_erp_EOC(struct dasd_ccw_req
* default_erp
, char *sense
)
1418 struct dasd_device
*device
= default_erp
->device
;
1420 DEV_MESSAGE(KERN_ERR
, device
, "%s",
1421 "End-of-Cylinder - must never happen");
1423 /* implement action 7 - BUG */
1424 return dasd_3990_erp_cleanup(default_erp
, DASD_CQR_FAILED
);
1426 } /* end dasd_3990_erp_EOC */
1429 * DASD_3990_ERP_ENV_DATA
1432 * Handles 24 byte 'Environmental-Data Present' error.
1435 * erp current erp_head
1437 * erp new erp_head - pointer to new ERP
1439 static struct dasd_ccw_req
*
1440 dasd_3990_erp_env_data(struct dasd_ccw_req
* erp
, char *sense
)
1443 struct dasd_device
*device
= erp
->device
;
1445 erp
->function
= dasd_3990_erp_env_data
;
1447 DEV_MESSAGE(KERN_DEBUG
, device
, "%s", "Environmental data present");
1449 dasd_3990_handle_env_data(erp
, sense
);
1451 /* don't retry on disabled interface */
1452 if (sense
[7] != 0x0F) {
1454 erp
= dasd_3990_erp_action_4(erp
, sense
);
1457 erp
= dasd_3990_erp_cleanup(erp
, DASD_CQR_IN_IO
);
1462 } /* end dasd_3990_erp_env_data */
1465 * DASD_3990_ERP_NO_REC
1468 * Handles 24 byte 'No Record Found' error.
1471 * erp already added default ERP
1474 * erp new erp_head - pointer to new ERP
1476 static struct dasd_ccw_req
*
1477 dasd_3990_erp_no_rec(struct dasd_ccw_req
* default_erp
, char *sense
)
1480 struct dasd_device
*device
= default_erp
->device
;
1482 DEV_MESSAGE(KERN_ERR
, device
, "%s",
1483 "No Record Found - Fatal error should "
1484 "have been handled within the interrupt handler");
1486 return dasd_3990_erp_cleanup(default_erp
, DASD_CQR_FAILED
);
1488 } /* end dasd_3990_erp_no_rec */
1491 * DASD_3990_ERP_FILE_PROT
1494 * Handles 24 byte 'File Protected' error.
1495 * Note: Seek related recovery is not implemented because
1496 * wee don't use the seek command yet.
1499 * erp current erp_head
1501 * erp new erp_head - pointer to new ERP
1503 static struct dasd_ccw_req
*
1504 dasd_3990_erp_file_prot(struct dasd_ccw_req
* erp
)
1507 struct dasd_device
*device
= erp
->device
;
1509 DEV_MESSAGE(KERN_ERR
, device
, "%s", "File Protected");
1511 return dasd_3990_erp_cleanup(erp
, DASD_CQR_FAILED
);
1513 } /* end dasd_3990_erp_file_prot */
1516 * DASD_3990_ERP_INSPECT_24
1519 * Does a detailed inspection of the 24 byte sense data
1520 * and sets up a related error recovery action.
1523 * sense sense data of the actual error
1524 * erp pointer to the currently created default ERP
1527 * erp pointer to the (addtitional) ERP
1529 static struct dasd_ccw_req
*
1530 dasd_3990_erp_inspect_24(struct dasd_ccw_req
* erp
, char *sense
)
1533 struct dasd_ccw_req
*erp_filled
= NULL
;
1535 /* Check sense for .... */
1536 /* 'Command Reject' */
1537 if ((erp_filled
== NULL
) && (sense
[0] & SNS0_CMD_REJECT
)) {
1538 erp_filled
= dasd_3990_erp_com_rej(erp
, sense
);
1540 /* 'Intervention Required' */
1541 if ((erp_filled
== NULL
) && (sense
[0] & SNS0_INTERVENTION_REQ
)) {
1542 erp_filled
= dasd_3990_erp_int_req(erp
);
1544 /* 'Bus Out Parity Check' */
1545 if ((erp_filled
== NULL
) && (sense
[0] & SNS0_BUS_OUT_CHECK
)) {
1546 erp_filled
= dasd_3990_erp_bus_out(erp
);
1548 /* 'Equipment Check' */
1549 if ((erp_filled
== NULL
) && (sense
[0] & SNS0_EQUIPMENT_CHECK
)) {
1550 erp_filled
= dasd_3990_erp_equip_check(erp
, sense
);
1553 if ((erp_filled
== NULL
) && (sense
[0] & SNS0_DATA_CHECK
)) {
1554 erp_filled
= dasd_3990_erp_data_check(erp
, sense
);
1557 if ((erp_filled
== NULL
) && (sense
[0] & SNS0_OVERRUN
)) {
1558 erp_filled
= dasd_3990_erp_overrun(erp
, sense
);
1560 /* 'Invalid Track Format' */
1561 if ((erp_filled
== NULL
) && (sense
[1] & SNS1_INV_TRACK_FORMAT
)) {
1562 erp_filled
= dasd_3990_erp_inv_format(erp
, sense
);
1564 /* 'End-of-Cylinder' */
1565 if ((erp_filled
== NULL
) && (sense
[1] & SNS1_EOC
)) {
1566 erp_filled
= dasd_3990_erp_EOC(erp
, sense
);
1568 /* 'Environmental Data' */
1569 if ((erp_filled
== NULL
) && (sense
[2] & SNS2_ENV_DATA_PRESENT
)) {
1570 erp_filled
= dasd_3990_erp_env_data(erp
, sense
);
1572 /* 'No Record Found' */
1573 if ((erp_filled
== NULL
) && (sense
[1] & SNS1_NO_REC_FOUND
)) {
1574 erp_filled
= dasd_3990_erp_no_rec(erp
, sense
);
1576 /* 'File Protected' */
1577 if ((erp_filled
== NULL
) && (sense
[1] & SNS1_FILE_PROTECTED
)) {
1578 erp_filled
= dasd_3990_erp_file_prot(erp
);
1580 /* other (unknown) error - do default ERP */
1581 if (erp_filled
== NULL
) {
1588 } /* END dasd_3990_erp_inspect_24 */
1591 *****************************************************************************
1592 * 32 byte sense ERP functions (only)
1593 *****************************************************************************
1597 * DASD_3990_ERPACTION_10_32
1600 * Handles 32 byte 'Action 10' of Single Program Action Codes.
1601 * Just retry and if retry doesn't work, return with error.
1604 * erp current erp_head
1605 * sense current sense data
1607 * erp modified erp_head
1609 static struct dasd_ccw_req
*
1610 dasd_3990_erp_action_10_32(struct dasd_ccw_req
* erp
, char *sense
)
1613 struct dasd_device
*device
= erp
->device
;
1616 erp
->function
= dasd_3990_erp_action_10_32
;
1618 DEV_MESSAGE(KERN_DEBUG
, device
, "%s", "Perform logging requested");
1622 } /* end dasd_3990_erp_action_10_32 */
1625 * DASD_3990_ERP_ACTION_1B_32
1628 * Handles 32 byte 'Action 1B' of Single Program Action Codes.
1629 * A write operation could not be finished because of an unexpected
1631 * The already created 'default erp' is used to get the link to
1632 * the erp chain, but it can not be used for this recovery
1633 * action because it contains no DE/LO data space.
1636 * default_erp already added default erp.
1637 * sense current sense data
1641 * default_erp in case of imprecise ending or error
1643 static struct dasd_ccw_req
*
1644 dasd_3990_erp_action_1B_32(struct dasd_ccw_req
* default_erp
, char *sense
)
1647 struct dasd_device
*device
= default_erp
->device
;
1649 struct dasd_ccw_req
*cqr
;
1650 struct dasd_ccw_req
*erp
;
1651 struct DE_eckd_data
*DE_data
;
1652 char *LO_data
; /* LO_eckd_data_t */
1655 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1656 "Write not finished because of unexpected condition");
1658 default_erp
->function
= dasd_3990_erp_action_1B_32
;
1660 /* determine the original cqr */
1663 while (cqr
->refers
!= NULL
) {
1667 /* for imprecise ending just do default erp */
1668 if (sense
[1] & 0x01) {
1670 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1671 "Imprecise ending is set - just retry");
1676 /* determine the address of the CCW to be restarted */
1677 /* Imprecise ending is not set -> addr from IRB-SCSW */
1678 cpa
= default_erp
->refers
->dstat
->scsw
.cpa
;
1682 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1683 "Unable to determine address of the CCW "
1686 return dasd_3990_erp_cleanup(default_erp
, DASD_CQR_FAILED
);
1689 /* Build new ERP request including DE/LO */
1690 erp
= dasd_alloc_erp_request((char *) &cqr
->magic
,
1691 2 + 1,/* DE/LO + TIC */
1692 sizeof (struct DE_eckd_data
) +
1693 sizeof (struct LO_eckd_data
), device
);
1696 DEV_MESSAGE(KERN_ERR
, device
, "%s", "Unable to allocate ERP");
1697 return dasd_3990_erp_cleanup(default_erp
, DASD_CQR_FAILED
);
1700 /* use original DE */
1701 DE_data
= erp
->data
;
1702 memcpy(DE_data
, cqr
->data
, sizeof (struct DE_eckd_data
));
1705 LO_data
= erp
->data
+ sizeof (struct DE_eckd_data
);
1707 if ((sense
[3] == 0x01) && (LO_data
[1] & 0x01)) {
1709 DEV_MESSAGE(KERN_ERR
, device
, "%s",
1710 "BUG - this should not happen");
1712 return dasd_3990_erp_cleanup(default_erp
, DASD_CQR_FAILED
);
1715 if ((sense
[7] & 0x3F) == 0x01) {
1716 /* operation code is WRITE DATA -> data area orientation */
1719 } else if ((sense
[7] & 0x3F) == 0x03) {
1720 /* operation code is FORMAT WRITE -> index orientation */
1724 LO_data
[0] = sense
[7]; /* operation */
1727 LO_data
[1] = sense
[8]; /* auxiliary */
1728 LO_data
[2] = sense
[9];
1729 LO_data
[3] = sense
[3]; /* count */
1730 LO_data
[4] = sense
[29]; /* seek_addr.cyl */
1731 LO_data
[5] = sense
[30]; /* seek_addr.cyl 2nd byte */
1732 LO_data
[7] = sense
[31]; /* seek_addr.head 2nd byte */
1734 memcpy(&(LO_data
[8]), &(sense
[11]), 8);
1738 memset(ccw
, 0, sizeof (struct ccw1
));
1739 ccw
->cmd_code
= DASD_ECKD_CCW_DEFINE_EXTENT
;
1740 ccw
->flags
= CCW_FLAG_CC
;
1742 ccw
->cda
= (__u32
)(addr_t
) DE_data
;
1746 memset(ccw
, 0, sizeof (struct ccw1
));
1747 ccw
->cmd_code
= DASD_ECKD_CCW_LOCATE_RECORD
;
1748 ccw
->flags
= CCW_FLAG_CC
;
1750 ccw
->cda
= (__u32
)(addr_t
) LO_data
;
1752 /* TIC to the failed ccw */
1754 ccw
->cmd_code
= CCW_CMD_TIC
;
1757 /* fill erp related fields */
1758 erp
->function
= dasd_3990_erp_action_1B_32
;
1759 erp
->refers
= default_erp
->refers
;
1760 erp
->device
= device
;
1761 erp
->magic
= default_erp
->magic
;
1764 erp
->status
= DASD_CQR_FILLED
;
1766 /* remove the default erp */
1767 dasd_free_erp_request(default_erp
, device
);
1771 } /* end dasd_3990_erp_action_1B_32 */
1774 * DASD_3990_UPDATE_1B
1777 * Handles the update to the 32 byte 'Action 1B' of Single Program
1778 * Action Codes in case the first action was not successful.
1779 * The already created 'previous_erp' is the currently not successful
1783 * previous_erp already created previous erp.
1784 * sense current sense data
1788 static struct dasd_ccw_req
*
1789 dasd_3990_update_1B(struct dasd_ccw_req
* previous_erp
, char *sense
)
1792 struct dasd_device
*device
= previous_erp
->device
;
1794 struct dasd_ccw_req
*cqr
;
1795 struct dasd_ccw_req
*erp
;
1796 char *LO_data
; /* struct LO_eckd_data */
1799 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1800 "Write not finished because of unexpected condition"
1803 /* determine the original cqr */
1806 while (cqr
->refers
!= NULL
) {
1810 /* for imprecise ending just do default erp */
1811 if (sense
[1] & 0x01) {
1813 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1814 "Imprecise ending is set - just retry");
1816 previous_erp
->status
= DASD_CQR_QUEUED
;
1818 return previous_erp
;
1821 /* determine the address of the CCW to be restarted */
1822 /* Imprecise ending is not set -> addr from IRB-SCSW */
1823 cpa
= previous_erp
->dstat
->scsw
.cpa
;
1827 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
1828 "Unable to determine address of the CCW "
1831 previous_erp
->status
= DASD_CQR_FAILED
;
1833 return previous_erp
;
1838 /* update the LO with the new returned sense data */
1839 LO_data
= erp
->data
+ sizeof (struct DE_eckd_data
);
1841 if ((sense
[3] == 0x01) && (LO_data
[1] & 0x01)) {
1843 DEV_MESSAGE(KERN_ERR
, device
, "%s",
1844 "BUG - this should not happen");
1846 previous_erp
->status
= DASD_CQR_FAILED
;
1848 return previous_erp
;
1851 if ((sense
[7] & 0x3F) == 0x01) {
1852 /* operation code is WRITE DATA -> data area orientation */
1855 } else if ((sense
[7] & 0x3F) == 0x03) {
1856 /* operation code is FORMAT WRITE -> index orientation */
1860 LO_data
[0] = sense
[7]; /* operation */
1863 LO_data
[1] = sense
[8]; /* auxiliary */
1864 LO_data
[2] = sense
[9];
1865 LO_data
[3] = sense
[3]; /* count */
1866 LO_data
[4] = sense
[29]; /* seek_addr.cyl */
1867 LO_data
[5] = sense
[30]; /* seek_addr.cyl 2nd byte */
1868 LO_data
[7] = sense
[31]; /* seek_addr.head 2nd byte */
1870 memcpy(&(LO_data
[8]), &(sense
[11]), 8);
1872 /* TIC to the failed ccw */
1873 ccw
= erp
->cpaddr
; /* addr of DE ccw */
1874 ccw
++; /* addr of LE ccw */
1875 ccw
++; /* addr of TIC ccw */
1878 erp
->status
= DASD_CQR_QUEUED
;
1882 } /* end dasd_3990_update_1B */
1885 * DASD_3990_ERP_COMPOUND_RETRY
1888 * Handles the compound ERP action retry code.
1889 * NOTE: At least one retry is done even if zero is specified
1890 * by the sense data. This makes enqueueing of the request
1894 * sense sense data of the actual error
1895 * erp pointer to the currently created ERP
1898 * erp modified ERP pointer
1902 dasd_3990_erp_compound_retry(struct dasd_ccw_req
* erp
, char *sense
)
1905 switch (sense
[25] & 0x03) {
1906 case 0x00: /* no not retry */
1910 case 0x01: /* retry 2 times */
1914 case 0x02: /* retry 10 times */
1918 case 0x03: /* retry 256 times */
1926 erp
->function
= dasd_3990_erp_compound_retry
;
1928 } /* end dasd_3990_erp_compound_retry */
1931 * DASD_3990_ERP_COMPOUND_PATH
1934 * Handles the compound ERP action for retry on alternate
1938 * sense sense data of the actual error
1939 * erp pointer to the currently created ERP
1942 * erp modified ERP pointer
1946 dasd_3990_erp_compound_path(struct dasd_ccw_req
* erp
, char *sense
)
1949 if (sense
[25] & DASD_SENSE_BIT_3
) {
1950 dasd_3990_erp_alternate_path(erp
);
1952 if (erp
->status
== DASD_CQR_FAILED
) {
1953 /* reset the lpm and the status to be able to
1954 * try further actions. */
1958 erp
->status
= DASD_CQR_ERROR
;
1963 erp
->function
= dasd_3990_erp_compound_path
;
1965 } /* end dasd_3990_erp_compound_path */
1968 * DASD_3990_ERP_COMPOUND_CODE
1971 * Handles the compound ERP action for retry code.
1974 * sense sense data of the actual error
1975 * erp pointer to the currently created ERP
1978 * erp NEW ERP pointer
1981 static struct dasd_ccw_req
*
1982 dasd_3990_erp_compound_code(struct dasd_ccw_req
* erp
, char *sense
)
1985 if (sense
[25] & DASD_SENSE_BIT_2
) {
1987 switch (sense
[28]) {
1989 /* issue a Diagnostic Control command with an
1990 * Inhibit Write subcommand and controler modifier */
1991 erp
= dasd_3990_erp_DCTL(erp
, 0x20);
1995 /* wait for 5 seconds and retry again */
1998 dasd_3990_erp_block_queue (erp
, 5*HZ
);
2002 /* should not happen - continue */
2007 erp
->function
= dasd_3990_erp_compound_code
;
2011 } /* end dasd_3990_erp_compound_code */
2014 * DASD_3990_ERP_COMPOUND_CONFIG
2017 * Handles the compound ERP action for configruation
2019 * Note: duplex handling is not implemented (yet).
2022 * sense sense data of the actual error
2023 * erp pointer to the currently created ERP
2026 * erp modified ERP pointer
2030 dasd_3990_erp_compound_config(struct dasd_ccw_req
* erp
, char *sense
)
2033 if ((sense
[25] & DASD_SENSE_BIT_1
) && (sense
[26] & DASD_SENSE_BIT_2
)) {
2035 /* set to suspended duplex state then restart */
2036 struct dasd_device
*device
= erp
->device
;
2038 DEV_MESSAGE(KERN_ERR
, device
, "%s",
2039 "Set device to suspended duplex state should be "
2041 "This is not implemented yet (for compound ERP)"
2042 " - please report to linux390@de.ibm.com");
2046 erp
->function
= dasd_3990_erp_compound_config
;
2048 } /* end dasd_3990_erp_compound_config */
2051 * DASD_3990_ERP_COMPOUND
2054 * Does the further compound program action if
2055 * compound retry was not successful.
2058 * sense sense data of the actual error
2059 * erp pointer to the current (failed) ERP
2062 * erp (additional) ERP pointer
2065 static struct dasd_ccw_req
*
2066 dasd_3990_erp_compound(struct dasd_ccw_req
* erp
, char *sense
)
2069 if ((erp
->function
== dasd_3990_erp_compound_retry
) &&
2070 (erp
->status
== DASD_CQR_ERROR
)) {
2072 dasd_3990_erp_compound_path(erp
, sense
);
2075 if ((erp
->function
== dasd_3990_erp_compound_path
) &&
2076 (erp
->status
== DASD_CQR_ERROR
)) {
2078 erp
= dasd_3990_erp_compound_code(erp
, sense
);
2081 if ((erp
->function
== dasd_3990_erp_compound_code
) &&
2082 (erp
->status
== DASD_CQR_ERROR
)) {
2084 dasd_3990_erp_compound_config(erp
, sense
);
2087 /* if no compound action ERP specified, the request failed */
2088 if (erp
->status
== DASD_CQR_ERROR
) {
2090 erp
->status
= DASD_CQR_FAILED
;
2095 } /* end dasd_3990_erp_compound */
2098 * DASD_3990_ERP_INSPECT_32
2101 * Does a detailed inspection of the 32 byte sense data
2102 * and sets up a related error recovery action.
2105 * sense sense data of the actual error
2106 * erp pointer to the currently created default ERP
2109 * erp_filled pointer to the ERP
2112 static struct dasd_ccw_req
*
2113 dasd_3990_erp_inspect_32(struct dasd_ccw_req
* erp
, char *sense
)
2116 struct dasd_device
*device
= erp
->device
;
2118 erp
->function
= dasd_3990_erp_inspect_32
;
2120 if (sense
[25] & DASD_SENSE_BIT_0
) {
2122 /* compound program action codes (byte25 bit 0 == '1') */
2123 dasd_3990_erp_compound_retry(erp
, sense
);
2127 /* single program action codes (byte25 bit 0 == '0') */
2128 switch (sense
[25]) {
2130 case 0x00: /* success */
2131 DEV_MESSAGE(KERN_DEBUG
, device
,
2132 "ERP called for successful request %p"
2133 " - NO ERP necessary", erp
);
2135 erp
= dasd_3990_erp_cleanup(erp
, DASD_CQR_DONE
);
2139 case 0x01: /* fatal error */
2140 DEV_MESSAGE(KERN_ERR
, device
, "%s",
2141 "Fatal error should have been "
2142 "handled within the interrupt handler");
2144 erp
= dasd_3990_erp_cleanup(erp
, DASD_CQR_FAILED
);
2147 case 0x02: /* intervention required */
2148 case 0x03: /* intervention required during dual copy */
2149 erp
= dasd_3990_erp_int_req(erp
);
2152 case 0x0F: /* length mismatch during update write command */
2153 DEV_MESSAGE(KERN_ERR
, device
, "%s",
2154 "update write command error - should not "
2156 "Please send this message together with "
2157 "the above sense data to linux390@de."
2160 erp
= dasd_3990_erp_cleanup(erp
, DASD_CQR_FAILED
);
2163 case 0x10: /* logging required for other channel program */
2164 erp
= dasd_3990_erp_action_10_32(erp
, sense
);
2167 case 0x15: /* next track outside defined extend */
2168 DEV_MESSAGE(KERN_ERR
, device
, "%s",
2169 "next track outside defined extend - "
2170 "should not happen;\n"
2171 "Please send this message together with "
2172 "the above sense data to linux390@de."
2175 erp
= dasd_3990_erp_cleanup(erp
, DASD_CQR_FAILED
);
2178 case 0x1B: /* unexpected condition during write */
2180 erp
= dasd_3990_erp_action_1B_32(erp
, sense
);
2183 case 0x1C: /* invalid data */
2184 DEV_MESSAGE(KERN_EMERG
, device
, "%s",
2185 "Data recovered during retry with PCI "
2186 "fetch mode active");
2188 /* not possible to handle this situation in Linux */
2190 ("Invalid data - No way to inform appliction about "
2191 "the possibly incorret data");
2194 case 0x1D: /* state-change pending */
2195 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
2196 "A State change pending condition exists "
2197 "for the subsystem or device");
2199 erp
= dasd_3990_erp_action_4(erp
, sense
);
2202 default: /* all others errors - default erp */
2209 } /* end dasd_3990_erp_inspect_32 */
2212 *****************************************************************************
2213 * main ERP control fuctions (24 and 32 byte sense)
2214 *****************************************************************************
2218 * DASD_3990_ERP_INSPECT
2221 * Does a detailed inspection for sense data by calling either
2222 * the 24-byte or the 32-byte inspection routine.
2225 * erp pointer to the currently created default ERP
2227 * erp_new contens was possibly modified
2229 static struct dasd_ccw_req
*
2230 dasd_3990_erp_inspect(struct dasd_ccw_req
* erp
)
2233 struct dasd_ccw_req
*erp_new
= NULL
;
2234 /* sense data are located in the refers record of the */
2235 /* already set up new ERP ! */
2236 char *sense
= erp
->refers
->dstat
->ecw
;
2238 /* distinguish between 24 and 32 byte sense data */
2239 if (sense
[27] & DASD_SENSE_BIT_0
) {
2241 /* inspect the 24 byte sense data */
2242 erp_new
= dasd_3990_erp_inspect_24(erp
, sense
);
2246 /* inspect the 32 byte sense data */
2247 erp_new
= dasd_3990_erp_inspect_32(erp
, sense
);
2249 } /* end distinguish between 24 and 32 byte sense data */
2253 } /* END dasd_3990_erp_inspect */
2256 * DASD_3990_ERP_ADD_ERP
2259 * This funtion adds an additional request block (ERP) to the head of
2260 * the given cqr (or erp).
2261 * This erp is initialized as an default erp (retry TIC)
2264 * cqr head of the current ERP-chain (or single cqr if
2267 * erp pointer to new ERP-chain head
2269 static struct dasd_ccw_req
*
2270 dasd_3990_erp_add_erp(struct dasd_ccw_req
* cqr
)
2273 struct dasd_device
*device
= cqr
->device
;
2276 /* allocate additional request block */
2277 struct dasd_ccw_req
*erp
;
2279 erp
= dasd_alloc_erp_request((char *) &cqr
->magic
, 2, 0, cqr
->device
);
2281 if (cqr
->retries
<= 0) {
2282 DEV_MESSAGE(KERN_ERR
, device
, "%s",
2283 "Unable to allocate ERP request");
2284 cqr
->status
= DASD_CQR_FAILED
;
2285 cqr
->stopclk
= get_clock ();
2287 DEV_MESSAGE (KERN_ERR
, device
,
2288 "Unable to allocate ERP request "
2289 "(%i retries left)",
2291 dasd_set_timer(device
, (HZ
<< 3));
2296 /* initialize request with default TIC to current ERP/CQR */
2298 ccw
->cmd_code
= CCW_CMD_NOOP
;
2299 ccw
->flags
= CCW_FLAG_CC
;
2301 ccw
->cmd_code
= CCW_CMD_TIC
;
2302 ccw
->cda
= (long)(cqr
->cpaddr
);
2303 erp
->function
= dasd_3990_erp_add_erp
;
2305 erp
->device
= cqr
->device
;
2306 erp
->magic
= cqr
->magic
;
2310 erp
->status
= DASD_CQR_FILLED
;
2316 * DASD_3990_ERP_ADDITIONAL_ERP
2319 * An additional ERP is needed to handle the current error.
2320 * Add ERP to the head of the ERP-chain containing the ERP processing
2321 * determined based on the sense data.
2324 * cqr head of the current ERP-chain (or single cqr if
2328 * erp pointer to new ERP-chain head
2330 static struct dasd_ccw_req
*
2331 dasd_3990_erp_additional_erp(struct dasd_ccw_req
* cqr
)
2334 struct dasd_ccw_req
*erp
= NULL
;
2336 /* add erp and initialize with default TIC */
2337 erp
= dasd_3990_erp_add_erp(cqr
);
2339 /* inspect sense, determine specific ERP if possible */
2342 erp
= dasd_3990_erp_inspect(erp
);
2347 } /* end dasd_3990_erp_additional_erp */
2350 * DASD_3990_ERP_ERROR_MATCH
2353 * Check if the device status of the given cqr is the same.
2354 * This means that the failed CCW and the relevant sense data
2356 * I don't distinguish between 24 and 32 byte sense because in case of
2357 * 24 byte sense byte 25 and 27 is set as well.
2360 * cqr1 first cqr, which will be compared with the
2364 * match 'boolean' for match found
2365 * returns 1 if match found, otherwise 0.
2368 dasd_3990_erp_error_match(struct dasd_ccw_req
*cqr1
, struct dasd_ccw_req
*cqr2
)
2371 /* check failed CCW */
2372 if (cqr1
->dstat
->scsw
.cpa
!= cqr2
->dstat
->scsw
.cpa
) {
2373 // return 0; /* CCW doesn't match */
2376 /* check sense data; byte 0-2,25,27 */
2377 if (!((memcmp (cqr1
->dstat
->ecw
, cqr2
->dstat
->ecw
, 3) == 0) &&
2378 (cqr1
->dstat
->ecw
[27] == cqr2
->dstat
->ecw
[27]) &&
2379 (cqr1
->dstat
->ecw
[25] == cqr2
->dstat
->ecw
[25]))) {
2381 return 0; /* sense doesn't match */
2384 return 1; /* match */
2386 } /* end dasd_3990_erp_error_match */
2389 * DASD_3990_ERP_IN_ERP
2392 * check if the current error already happened before.
2393 * quick exit if current cqr is not an ERP (cqr->refers=NULL)
2396 * cqr failed cqr (either original cqr or already an erp)
2399 * erp erp-pointer to the already defined error
2400 * recovery procedure OR
2401 * NULL if a 'new' error occurred.
2403 static struct dasd_ccw_req
*
2404 dasd_3990_erp_in_erp(struct dasd_ccw_req
*cqr
)
2407 struct dasd_ccw_req
*erp_head
= cqr
, /* save erp chain head */
2408 *erp_match
= NULL
; /* save erp chain head */
2409 int match
= 0; /* 'boolean' for matching error found */
2411 if (cqr
->refers
== NULL
) { /* return if not in erp */
2415 /* check the erp/cqr chain for current error */
2417 match
= dasd_3990_erp_error_match(erp_head
, cqr
->refers
);
2418 erp_match
= cqr
; /* save possible matching erp */
2419 cqr
= cqr
->refers
; /* check next erp/cqr in queue */
2421 } while ((cqr
->refers
!= NULL
) && (!match
));
2424 return NULL
; /* no match was found */
2427 return erp_match
; /* return address of matching erp */
2429 } /* END dasd_3990_erp_in_erp */
2432 * DASD_3990_ERP_FURTHER_ERP (24 & 32 byte sense)
2435 * No retry is left for the current ERP. Check what has to be done
2437 * - do further defined ERP action or
2438 * - wait for interrupt or
2439 * - exit with permanent error
2442 * erp ERP which is in progress with no retry left
2445 * erp modified/additional ERP
2447 static struct dasd_ccw_req
*
2448 dasd_3990_erp_further_erp(struct dasd_ccw_req
*erp
)
2451 struct dasd_device
*device
= erp
->device
;
2452 char *sense
= erp
->dstat
->ecw
;
2454 /* check for 24 byte sense ERP */
2455 if ((erp
->function
== dasd_3990_erp_bus_out
) ||
2456 (erp
->function
== dasd_3990_erp_action_1
) ||
2457 (erp
->function
== dasd_3990_erp_action_4
)) {
2459 erp
= dasd_3990_erp_action_1(erp
);
2461 } else if (erp
->function
== dasd_3990_erp_action_5
) {
2463 /* retries have not been successful */
2464 /* prepare erp for retry on different channel path */
2465 erp
= dasd_3990_erp_action_1(erp
);
2467 if (!(sense
[2] & DASD_SENSE_BIT_0
)) {
2469 /* issue a Diagnostic Control command with an
2470 * Inhibit Write subcommand */
2472 switch (sense
[25]) {
2474 case 0x57:{ /* controller */
2475 erp
= dasd_3990_erp_DCTL(erp
, 0x20);
2479 case 0x58:{ /* channel path */
2480 erp
= dasd_3990_erp_DCTL(erp
, 0x40);
2484 case 0x59:{ /* storage director */
2485 erp
= dasd_3990_erp_DCTL(erp
, 0x80);
2489 DEV_MESSAGE(KERN_DEBUG
, device
,
2490 "invalid subcommand modifier 0x%x "
2491 "for Diagnostic Control Command",
2496 /* check for 32 byte sense ERP */
2497 } else if ((erp
->function
== dasd_3990_erp_compound_retry
) ||
2498 (erp
->function
== dasd_3990_erp_compound_path
) ||
2499 (erp
->function
== dasd_3990_erp_compound_code
) ||
2500 (erp
->function
== dasd_3990_erp_compound_config
)) {
2502 erp
= dasd_3990_erp_compound(erp
, sense
);
2505 /* no retry left and no additional special handling necessary */
2506 DEV_MESSAGE(KERN_ERR
, device
,
2507 "no retries left for erp %p - "
2508 "set status to FAILED", erp
);
2510 erp
->status
= DASD_CQR_FAILED
;
2515 } /* end dasd_3990_erp_further_erp */
2518 * DASD_3990_ERP_HANDLE_MATCH_ERP
2521 * An error occurred again and an ERP has been detected which is already
2522 * used to handle this error (e.g. retries).
2523 * All prior ERP's are asumed to be successful and therefore removed
2525 * If retry counter of matching erp is already 0, it is checked if further
2526 * action is needed (besides retry) or if the ERP has failed.
2529 * erp_head first ERP in ERP-chain
2530 * erp ERP that handles the actual error.
2534 * erp modified/additional ERP
2536 static struct dasd_ccw_req
*
2537 dasd_3990_erp_handle_match_erp(struct dasd_ccw_req
*erp_head
,
2538 struct dasd_ccw_req
*erp
)
2541 struct dasd_device
*device
= erp_head
->device
;
2542 struct dasd_ccw_req
*erp_done
= erp_head
; /* finished req */
2543 struct dasd_ccw_req
*erp_free
= NULL
; /* req to be freed */
2545 /* loop over successful ERPs and remove them from chanq */
2546 while (erp_done
!= erp
) {
2548 if (erp_done
== NULL
) /* end of chain reached */
2549 panic(PRINTK_HEADER
"Programming error in ERP! The "
2550 "original request was lost\n");
2552 /* remove the request from the device queue */
2553 list_del(&erp_done
->list
);
2555 erp_free
= erp_done
;
2556 erp_done
= erp_done
->refers
;
2558 /* free the finished erp request */
2559 dasd_free_erp_request(erp_free
, erp_free
->device
);
2563 if (erp
->retries
> 0) {
2565 char *sense
= erp
->refers
->dstat
->ecw
;
2567 /* check for special retries */
2568 if (erp
->function
== dasd_3990_erp_action_4
) {
2570 erp
= dasd_3990_erp_action_4(erp
, sense
);
2572 } else if (erp
->function
== dasd_3990_erp_action_1B_32
) {
2574 erp
= dasd_3990_update_1B(erp
, sense
);
2576 } else if (erp
->function
== dasd_3990_erp_int_req
) {
2578 erp
= dasd_3990_erp_int_req(erp
);
2582 DEV_MESSAGE(KERN_DEBUG
, device
,
2583 "%i retries left for erp %p",
2586 /* handle the request again... */
2587 erp
->status
= DASD_CQR_QUEUED
;
2591 /* no retry left - check for further necessary action */
2592 /* if no further actions, handle rest as permanent error */
2593 erp
= dasd_3990_erp_further_erp(erp
);
2598 } /* end dasd_3990_erp_handle_match_erp */
2601 * DASD_3990_ERP_ACTION
2604 * controll routine for 3990 erp actions.
2605 * Has to be called with the queue lock (namely the s390_irq_lock) acquired.
2608 * cqr failed cqr (either original cqr or already an erp)
2611 * erp erp-pointer to the head of the ERP action chain.
2613 * - either a ptr to an additional ERP cqr or
2614 * - the original given cqr (which's status might
2617 struct dasd_ccw_req
*
2618 dasd_3990_erp_action(struct dasd_ccw_req
* cqr
)
2621 struct dasd_ccw_req
*erp
= NULL
;
2622 struct dasd_device
*device
= cqr
->device
;
2623 __u32 cpa
= cqr
->dstat
->scsw
.cpa
;
2626 /* print current erp_chain */
2627 DEV_MESSAGE(KERN_DEBUG
, device
, "%s",
2628 "ERP chain at BEGINNING of ERP-ACTION");
2630 struct dasd_ccw_req
*temp_erp
= NULL
;
2632 for (temp_erp
= cqr
;
2633 temp_erp
!= NULL
; temp_erp
= temp_erp
->refers
) {
2635 DEV_MESSAGE(KERN_DEBUG
, device
,
2636 " erp %p refers to %p",
2637 temp_erp
, temp_erp
->refers
);
2640 #endif /* ERP_DEBUG */
2642 /* double-check if current erp/cqr was successfull */
2643 if ((cqr
->dstat
->scsw
.cstat
== 0x00) &&
2644 (cqr
->dstat
->scsw
.dstat
== (DEV_STAT_CHN_END
|DEV_STAT_DEV_END
))) {
2646 DEV_MESSAGE(KERN_DEBUG
, device
,
2647 "ERP called for successful request %p"
2648 " - NO ERP necessary", cqr
);
2650 cqr
->status
= DASD_CQR_DONE
;
2654 /* check if sense data are available */
2655 if (!cqr
->dstat
->ecw
) {
2656 DEV_MESSAGE(KERN_DEBUG
, device
,
2657 "ERP called witout sense data avail ..."
2658 "request %p - NO ERP possible", cqr
);
2660 cqr
->status
= DASD_CQR_FAILED
;
2666 /* check if error happened before */
2667 erp
= dasd_3990_erp_in_erp(cqr
);
2670 /* no matching erp found - set up erp */
2671 erp
= dasd_3990_erp_additional_erp(cqr
);
2673 /* matching erp found - set all leading erp's to DONE */
2674 erp
= dasd_3990_erp_handle_match_erp(cqr
, erp
);
2678 /* print current erp_chain */
2679 DEV_MESSAGE(KERN_DEBUG
, device
, "%s", "ERP chain at END of ERP-ACTION");
2681 struct dasd_ccw_req
*temp_erp
= NULL
;
2682 for (temp_erp
= erp
;
2683 temp_erp
!= NULL
; temp_erp
= temp_erp
->refers
) {
2685 DEV_MESSAGE(KERN_DEBUG
, device
,
2686 " erp %p refers to %p",
2687 temp_erp
, temp_erp
->refers
);
2690 #endif /* ERP_DEBUG */
2692 if (erp
->status
== DASD_CQR_FAILED
)
2693 dasd_log_ccw(erp
, 1, cpa
);
2695 /* enqueue added ERP request */
2696 if (erp
->status
== DASD_CQR_FILLED
) {
2697 erp
->status
= DASD_CQR_QUEUED
;
2698 list_add(&erp
->list
, &device
->ccw_queue
);
2703 } /* end dasd_3990_erp_action */
2706 * Overrides for Emacs so that we follow Linus's tabbing style.
2707 * Emacs will notice this stuff at the end of the file and automatically
2708 * adjust the settings for this buffer only. This must remain at the end
2710 * ---------------------------------------------------------------------------
2713 * c-brace-imaginary-offset: 0
2714 * c-brace-offset: -4
2715 * c-argdecl-indent: 4
2716 * c-label-offset: -4
2717 * c-continued-statement-offset: 4
2718 * c-continued-brace-offset: 0
2719 * indent-tabs-mode: 1