Lines Matching +full:sense +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0
30 * 24 and 32 byte sense ERP functions
51 struct dasd_ccw_req *cqr = erp->refers; in dasd_3990_erp_cleanup()
53 dasd_free_erp_request(erp, erp->memdev); in dasd_3990_erp_cleanup()
54 cqr->status = final_status; in dasd_3990_erp_cleanup()
70 struct dasd_device *device = erp->startdev; in dasd_3990_erp_block_queue()
76 spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags); in dasd_3990_erp_block_queue()
78 spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags); in dasd_3990_erp_block_queue()
79 erp->status = DASD_CQR_FILLED; in dasd_3990_erp_block_queue()
80 if (erp->block) in dasd_3990_erp_block_queue()
81 dasd_block_set_timer(erp->block, expires); in dasd_3990_erp_block_queue()
102 struct dasd_device *device = erp->startdev; in dasd_3990_erp_int_req()
107 if (erp->function != dasd_3990_erp_int_req) { in dasd_3990_erp_int_req()
109 erp->retries = 256; in dasd_3990_erp_int_req()
110 erp->function = dasd_3990_erp_int_req; in dasd_3990_erp_int_req()
115 dev_err(&device->cdev->dev, in dasd_3990_erp_int_req()
116 "is offline or not installed - " in dasd_3990_erp_int_req()
143 struct dasd_device *device = erp->startdev; in dasd_3990_erp_alternate_path()
148 spin_lock_irqsave(get_ccwdev_lock(device->cdev), flags); in dasd_3990_erp_alternate_path()
149 opm = ccw_device_get_path_mask(device->cdev); in dasd_3990_erp_alternate_path()
150 spin_unlock_irqrestore(get_ccwdev_lock(device->cdev), flags); in dasd_3990_erp_alternate_path()
151 if (erp->lpm == 0) in dasd_3990_erp_alternate_path()
152 erp->lpm = dasd_path_get_opm(device) & in dasd_3990_erp_alternate_path()
153 ~(erp->irb.esw.esw0.sublog.lpum); in dasd_3990_erp_alternate_path()
155 erp->lpm &= ~(erp->irb.esw.esw0.sublog.lpum); in dasd_3990_erp_alternate_path()
157 if ((erp->lpm & opm) != 0x00) { in dasd_3990_erp_alternate_path()
161 erp->lpm, erp->irb.esw.esw0.sublog.lpum, opm); in dasd_3990_erp_alternate_path()
164 erp->status = DASD_CQR_FILLED; in dasd_3990_erp_alternate_path()
165 erp->retries = 10; in dasd_3990_erp_alternate_path()
167 dev_err(&device->cdev->dev, in dasd_3990_erp_alternate_path()
169 "/opm=%x)\n", erp->irb.esw.esw0.sublog.lpum, opm); in dasd_3990_erp_alternate_path()
172 erp->status = DASD_CQR_FAILED; in dasd_3990_erp_alternate_path()
195 struct dasd_device *device = erp->startdev; in dasd_3990_erp_DCTL()
200 dctl_cqr = dasd_alloc_erp_request(erp->magic, 1, in dasd_3990_erp_DCTL()
204 dev_err(&device->cdev->dev, in dasd_3990_erp_DCTL()
205 "Unable to allocate DCTL-CQR\n"); in dasd_3990_erp_DCTL()
206 erp->status = DASD_CQR_FAILED; in dasd_3990_erp_DCTL()
210 DCTL_data = dctl_cqr->data; in dasd_3990_erp_DCTL()
212 DCTL_data->subcommand = 0x02; /* Inhibit Write */ in dasd_3990_erp_DCTL()
213 DCTL_data->modifier = modifier; in dasd_3990_erp_DCTL()
215 ccw = dctl_cqr->cpaddr; in dasd_3990_erp_DCTL()
217 ccw->cmd_code = CCW_CMD_DCTL; in dasd_3990_erp_DCTL()
218 ccw->count = 4; in dasd_3990_erp_DCTL()
219 ccw->cda = virt_to_dma32(DCTL_data); in dasd_3990_erp_DCTL()
220 dctl_cqr->flags = erp->flags; in dasd_3990_erp_DCTL()
221 dctl_cqr->function = dasd_3990_erp_DCTL; in dasd_3990_erp_DCTL()
222 dctl_cqr->refers = erp; in dasd_3990_erp_DCTL()
223 dctl_cqr->startdev = device; in dasd_3990_erp_DCTL()
224 dctl_cqr->memdev = device; in dasd_3990_erp_DCTL()
225 dctl_cqr->magic = erp->magic; in dasd_3990_erp_DCTL()
226 dctl_cqr->expires = 5 * 60 * HZ; in dasd_3990_erp_DCTL()
227 dctl_cqr->retries = 2; in dasd_3990_erp_DCTL()
229 dctl_cqr->buildclk = get_tod_clock(); in dasd_3990_erp_DCTL()
231 dctl_cqr->status = DASD_CQR_FILLED; in dasd_3990_erp_DCTL()
260 erp->function = dasd_3990_erp_action_1_sec; in dasd_3990_erp_action_1_sec()
267 erp->function = dasd_3990_erp_action_1; in dasd_3990_erp_action_1()
269 if (erp->status == DASD_CQR_FAILED && in dasd_3990_erp_action_1()
270 !test_bit(DASD_CQR_VERIFY_PATH, &erp->flags)) { in dasd_3990_erp_action_1()
271 erp->status = DASD_CQR_FILLED; in dasd_3990_erp_action_1()
272 erp->retries = 10; in dasd_3990_erp_action_1()
273 erp->lpm = dasd_path_get_opm(erp->startdev); in dasd_3990_erp_action_1()
274 erp->function = dasd_3990_erp_action_1_sec; in dasd_3990_erp_action_1()
290 * sense sense data of the actual error
298 dasd_3990_erp_action_4(struct dasd_ccw_req * erp, char *sense) in dasd_3990_erp_action_4() argument
301 struct dasd_device *device = erp->startdev; in dasd_3990_erp_action_4()
306 if (erp->function != dasd_3990_erp_action_4) { in dasd_3990_erp_action_4()
311 erp->retries = 256; in dasd_3990_erp_action_4()
312 erp->function = dasd_3990_erp_action_4; in dasd_3990_erp_action_4()
315 if (sense && (sense[25] == 0x1D)) { /* state change pending */ in dasd_3990_erp_action_4()
320 erp->retries); in dasd_3990_erp_action_4()
324 } else if (sense && (sense[25] == 0x1E)) { /* busy */ in dasd_3990_erp_action_4()
326 "busy - redriving request later, " in dasd_3990_erp_action_4()
328 erp->retries); in dasd_3990_erp_action_4()
331 /* no state change pending - retry */ in dasd_3990_erp_action_4()
335 erp->retries); in dasd_3990_erp_action_4()
336 erp->status = DASD_CQR_FILLED; in dasd_3990_erp_action_4()
346 * 24 byte sense ERP functions (only)
369 erp->retries = 10; in dasd_3990_erp_action_5()
370 erp->function = dasd_3990_erp_action_5; in dasd_3990_erp_action_5()
381 * Does a analysis of the sense data (message Format)
385 * sense current sense data
391 dasd_3990_handle_env_data(struct dasd_ccw_req * erp, char *sense) in dasd_3990_handle_env_data() argument
394 struct dasd_device *device = erp->startdev; in dasd_3990_handle_env_data()
395 char msg_format = (sense[7] & 0xF0); in dasd_3990_handle_env_data()
396 char msg_no = (sense[7] & 0x0F); in dasd_3990_handle_env_data()
399 case 0x00: /* Format 0 - Program or System Checks */ in dasd_3990_handle_env_data()
401 if (sense[1] & 0x10) { /* check message to operator bit */ in dasd_3990_handle_env_data()
407 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
408 "FORMAT 0 - Invalid Command\n"); in dasd_3990_handle_env_data()
411 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
412 "FORMAT 0 - Invalid Command " in dasd_3990_handle_env_data()
416 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
417 "FORMAT 0 - CCW Count less than " in dasd_3990_handle_env_data()
421 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
422 "FORMAT 0 - Invalid Parameter\n"); in dasd_3990_handle_env_data()
425 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
426 "FORMAT 0 - Diagnostic of Special" in dasd_3990_handle_env_data()
430 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
431 "FORMAT 0 - Channel Returned with " in dasd_3990_handle_env_data()
435 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
436 "FORMAT 0 - Reset Notification\n"); in dasd_3990_handle_env_data()
439 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
440 "FORMAT 0 - Storage Path Restart\n"); in dasd_3990_handle_env_data()
443 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
444 "FORMAT 0 - Channel requested " in dasd_3990_handle_env_data()
445 "... %02x\n", sense[8]); in dasd_3990_handle_env_data()
448 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
449 "FORMAT 0 - Invalid Defective/" in dasd_3990_handle_env_data()
453 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
454 "FORMAT 0 - DPS Installation " in dasd_3990_handle_env_data()
458 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
459 "FORMAT 0 - Command Invalid on " in dasd_3990_handle_env_data()
463 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
464 "FORMAT 0 - Status Not As " in dasd_3990_handle_env_data()
466 sense[8]); in dasd_3990_handle_env_data()
469 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
470 "FORMAT 0 - Reserved\n"); in dasd_3990_handle_env_data()
477 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
478 "FORMAT 0 - Device Error " in dasd_3990_handle_env_data()
482 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
483 "FORMAT 0 - Reserved\n"); in dasd_3990_handle_env_data()
486 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
487 "FORMAT 0 - Device Fenced - " in dasd_3990_handle_env_data()
488 "device = %02x\n", sense[4]); in dasd_3990_handle_env_data()
491 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
492 "FORMAT 0 - Data Pinned for " in dasd_3990_handle_env_data()
496 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
497 "FORMAT 0 - Reserved\n"); in dasd_3990_handle_env_data()
502 case 0x10: /* Format 1 - Device Equipment Checks */ in dasd_3990_handle_env_data()
507 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
508 "FORMAT 1 - Device Status 1 not as " in dasd_3990_handle_env_data()
512 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
513 "FORMAT 1 - Index missing\n"); in dasd_3990_handle_env_data()
516 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
517 "FORMAT 1 - Interruption cannot be " in dasd_3990_handle_env_data()
521 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
522 "FORMAT 1 - Device did not respond to " in dasd_3990_handle_env_data()
526 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
527 "FORMAT 1 - Device check-2 error or Set " in dasd_3990_handle_env_data()
531 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
532 "FORMAT 1 - Head address does not " in dasd_3990_handle_env_data()
536 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
537 "FORMAT 1 - Device status 1 not valid\n"); in dasd_3990_handle_env_data()
540 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
541 "FORMAT 1 - Device not ready\n"); in dasd_3990_handle_env_data()
544 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
545 "FORMAT 1 - Track physical address did " in dasd_3990_handle_env_data()
549 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
550 "FORMAT 1 - Missing device address bit\n"); in dasd_3990_handle_env_data()
553 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
554 "FORMAT 1 - Drive motor switch is off\n"); in dasd_3990_handle_env_data()
557 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
558 "FORMAT 1 - Seek incomplete\n"); in dasd_3990_handle_env_data()
561 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
562 "FORMAT 1 - Cylinder address did not " in dasd_3990_handle_env_data()
566 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
567 "FORMAT 1 - Offset active cannot be " in dasd_3990_handle_env_data()
571 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
572 "FORMAT 1 - Reserved\n"); in dasd_3990_handle_env_data()
576 case 0x20: /* Format 2 - 3990 Equipment Checks */ in dasd_3990_handle_env_data()
579 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
580 "FORMAT 2 - 3990 check-2 error\n"); in dasd_3990_handle_env_data()
583 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
584 "FORMAT 2 - Support facility errors\n"); in dasd_3990_handle_env_data()
587 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
588 "FORMAT 2 - Microcode detected error " in dasd_3990_handle_env_data()
590 sense[8]); in dasd_3990_handle_env_data()
593 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
594 "FORMAT 2 - Reserved\n"); in dasd_3990_handle_env_data()
598 case 0x30: /* Format 3 - 3990 Control Checks */ in dasd_3990_handle_env_data()
601 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
602 "FORMAT 3 - Allegiance terminated\n"); in dasd_3990_handle_env_data()
605 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
606 "FORMAT 3 - Reserved\n"); in dasd_3990_handle_env_data()
610 case 0x40: /* Format 4 - Data Checks */ in dasd_3990_handle_env_data()
613 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
614 "FORMAT 4 - Home address area error\n"); in dasd_3990_handle_env_data()
617 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
618 "FORMAT 4 - Count area error\n"); in dasd_3990_handle_env_data()
621 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
622 "FORMAT 4 - Key area error\n"); in dasd_3990_handle_env_data()
625 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
626 "FORMAT 4 - Data area error\n"); in dasd_3990_handle_env_data()
629 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
630 "FORMAT 4 - No sync byte in home address " in dasd_3990_handle_env_data()
634 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
635 "FORMAT 4 - No sync byte in count address " in dasd_3990_handle_env_data()
639 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
640 "FORMAT 4 - No sync byte in key area\n"); in dasd_3990_handle_env_data()
643 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
644 "FORMAT 4 - No sync byte in data area\n"); in dasd_3990_handle_env_data()
647 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
648 "FORMAT 4 - Home address area error; " in dasd_3990_handle_env_data()
652 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
653 "FORMAT 4 - Count area error; offset " in dasd_3990_handle_env_data()
657 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
658 "FORMAT 4 - Key area error; offset " in dasd_3990_handle_env_data()
662 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
663 "FORMAT 4 - Data area error; " in dasd_3990_handle_env_data()
667 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
668 "FORMAT 4 - No sync byte in home " in dasd_3990_handle_env_data()
672 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
673 "FORMAT 4 - No sync byte in count " in dasd_3990_handle_env_data()
677 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
678 "FORMAT 4 - No sync byte in key area; " in dasd_3990_handle_env_data()
682 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
683 "FORMAT 4 - No sync byte in data area; " in dasd_3990_handle_env_data()
687 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
688 "FORMAT 4 - Reserved\n"); in dasd_3990_handle_env_data()
692 case 0x50: /* Format 5 - Data Check with displacement information */ in dasd_3990_handle_env_data()
695 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
696 "FORMAT 5 - Data Check in the " in dasd_3990_handle_env_data()
700 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
701 "FORMAT 5 - Data Check in the count " in dasd_3990_handle_env_data()
705 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
706 "FORMAT 5 - Data Check in the key area\n"); in dasd_3990_handle_env_data()
709 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
710 "FORMAT 5 - Data Check in the data " in dasd_3990_handle_env_data()
714 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
715 "FORMAT 5 - Data Check in the " in dasd_3990_handle_env_data()
719 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
720 "FORMAT 5 - Data Check in the count area; " in dasd_3990_handle_env_data()
724 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
725 "FORMAT 5 - Data Check in the key area; " in dasd_3990_handle_env_data()
729 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
730 "FORMAT 5 - Data Check in the data area; " in dasd_3990_handle_env_data()
734 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
735 "FORMAT 5 - Reserved\n"); in dasd_3990_handle_env_data()
739 case 0x60: /* Format 6 - Usage Statistics/Overrun Errors */ in dasd_3990_handle_env_data()
742 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
743 "FORMAT 6 - Overrun on channel A\n"); in dasd_3990_handle_env_data()
746 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
747 "FORMAT 6 - Overrun on channel B\n"); in dasd_3990_handle_env_data()
750 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
751 "FORMAT 6 - Overrun on channel C\n"); in dasd_3990_handle_env_data()
754 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
755 "FORMAT 6 - Overrun on channel D\n"); in dasd_3990_handle_env_data()
758 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
759 "FORMAT 6 - Overrun on channel E\n"); in dasd_3990_handle_env_data()
762 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
763 "FORMAT 6 - Overrun on channel F\n"); in dasd_3990_handle_env_data()
766 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
767 "FORMAT 6 - Overrun on channel G\n"); in dasd_3990_handle_env_data()
770 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
771 "FORMAT 6 - Overrun on channel H\n"); in dasd_3990_handle_env_data()
774 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
775 "FORMAT 6 - Reserved\n"); in dasd_3990_handle_env_data()
779 case 0x70: /* Format 7 - Device Connection Control Checks */ in dasd_3990_handle_env_data()
782 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
783 "FORMAT 7 - RCC initiated by a connection " in dasd_3990_handle_env_data()
787 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
788 "FORMAT 7 - RCC 1 sequence not " in dasd_3990_handle_env_data()
792 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
793 "FORMAT 7 - RCC 1 and RCC 2 sequences not " in dasd_3990_handle_env_data()
797 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
798 "FORMAT 7 - Invalid tag-in during " in dasd_3990_handle_env_data()
802 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
803 "FORMAT 7 - extra RCC required\n"); in dasd_3990_handle_env_data()
806 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
807 "FORMAT 7 - Invalid DCC selection " in dasd_3990_handle_env_data()
811 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
812 "FORMAT 7 - Missing end operation; device " in dasd_3990_handle_env_data()
816 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
817 "FORMAT 7 - Missing end operation; device " in dasd_3990_handle_env_data()
821 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
822 "FORMAT 7 - Invalid tag-in for an " in dasd_3990_handle_env_data()
826 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
827 "FORMAT 7 - Invalid tag-in for an " in dasd_3990_handle_env_data()
831 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
832 "FORMAT 7 - 3990 microcode time out when " in dasd_3990_handle_env_data()
836 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
837 "FORMAT 7 - No response to selection " in dasd_3990_handle_env_data()
841 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
842 "FORMAT 7 - Permanent path error (DASD " in dasd_3990_handle_env_data()
846 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
847 "FORMAT 7 - DASD controller not available" in dasd_3990_handle_env_data()
851 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
852 "FORMAT 7 - Reserved\n"); in dasd_3990_handle_env_data()
856 case 0x80: /* Format 8 - Additional Device Equipment Checks */ in dasd_3990_handle_env_data()
860 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
861 "FORMAT 8 - Error correction code " in dasd_3990_handle_env_data()
865 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
866 "FORMAT 8 - Unexpected end operation " in dasd_3990_handle_env_data()
870 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
871 "FORMAT 8 - End operation with transfer " in dasd_3990_handle_env_data()
875 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
876 "FORMAT 8 - End operation with transfer " in dasd_3990_handle_env_data()
880 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
881 "FORMAT 8 - DPS checks after a system " in dasd_3990_handle_env_data()
885 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
886 "FORMAT 8 - DPS cannot be filled\n"); in dasd_3990_handle_env_data()
889 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
890 "FORMAT 8 - Short busy time-out during " in dasd_3990_handle_env_data()
894 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
895 "FORMAT 8 - DASD controller failed to " in dasd_3990_handle_env_data()
899 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
900 "FORMAT 8 - No interruption from device " in dasd_3990_handle_env_data()
904 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
905 "FORMAT 8 - Reserved\n"); in dasd_3990_handle_env_data()
909 case 0x90: /* Format 9 - Device Read, Write, and Seek Checks */ in dasd_3990_handle_env_data()
914 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
915 "FORMAT 9 - Device check-2 error\n"); in dasd_3990_handle_env_data()
918 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
919 "FORMAT 9 - Head address did not " in dasd_3990_handle_env_data()
923 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
924 "FORMAT 9 - Track physical address did " in dasd_3990_handle_env_data()
928 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
929 "FORMAT 9 - Cylinder address did not " in dasd_3990_handle_env_data()
933 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
934 "FORMAT 9 - Reserved\n"); in dasd_3990_handle_env_data()
938 case 0xF0: /* Format F - Cache Storage Checks */ in dasd_3990_handle_env_data()
941 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
942 "FORMAT F - Operation Terminated\n"); in dasd_3990_handle_env_data()
945 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
946 "FORMAT F - Subsystem Processing Error\n"); in dasd_3990_handle_env_data()
949 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
950 "FORMAT F - Cache or nonvolatile storage " in dasd_3990_handle_env_data()
954 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
955 "FORMAT F - Caching terminated\n"); in dasd_3990_handle_env_data()
958 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
959 "FORMAT F - Cache fast write access not " in dasd_3990_handle_env_data()
963 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
964 "FORMAT F - Track format incorrect\n"); in dasd_3990_handle_env_data()
967 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
968 "FORMAT F - Caching reinitiated\n"); in dasd_3990_handle_env_data()
971 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
972 "FORMAT F - Nonvolatile storage " in dasd_3990_handle_env_data()
976 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
977 "FORMAT F - Volume is suspended duplex\n"); in dasd_3990_handle_env_data()
979 dasd_eer_write(device, erp->refers, in dasd_3990_handle_env_data()
983 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
984 "FORMAT F - Subsystem status cannot be " in dasd_3990_handle_env_data()
988 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
989 "FORMAT F - Caching status reset to " in dasd_3990_handle_env_data()
993 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
994 "FORMAT F - DASD Fast Write inhibited\n"); in dasd_3990_handle_env_data()
997 dev_warn(&device->cdev->dev, in dasd_3990_handle_env_data()
998 "FORMAT F - Reserved\n"); in dasd_3990_handle_env_data()
1003 dev_err(&device->cdev->dev, in dasd_3990_handle_env_data()
1018 * sense current sense data
1021 * erp 'new' erp_head - pointer to new ERP
1024 dasd_3990_erp_com_rej(struct dasd_ccw_req * erp, char *sense) in dasd_3990_erp_com_rej() argument
1027 struct dasd_device *device = erp->startdev; in dasd_3990_erp_com_rej()
1029 erp->function = dasd_3990_erp_com_rej; in dasd_3990_erp_com_rej()
1031 /* env data present (ACTION 10 - retry should work) */ in dasd_3990_erp_com_rej()
1032 if (sense[2] & SNS2_ENV_DATA_PRESENT) { in dasd_3990_erp_com_rej()
1035 "Command Reject - environmental data present"); in dasd_3990_erp_com_rej()
1037 dasd_3990_handle_env_data(erp, sense); in dasd_3990_erp_com_rej()
1039 erp->retries = 5; in dasd_3990_erp_com_rej()
1041 } else if (sense[1] & SNS1_WRITE_INHIBITED) { in dasd_3990_erp_com_rej()
1042 dev_err(&device->cdev->dev, "An I/O request was rejected" in dasd_3990_erp_com_rej()
1045 } else if (sense[7] == SNS7_INVALID_ON_SEC) { in dasd_3990_erp_com_rej()
1046 dev_err(&device->cdev->dev, "An I/O request was rejected on a copy pair secondary device\n"); in dasd_3990_erp_com_rej()
1047 /* suppress dump of sense data for this error */ in dasd_3990_erp_com_rej()
1048 set_bit(DASD_CQR_SUPPRESS_CR, &erp->refers->flags); in dasd_3990_erp_com_rej()
1051 if (!test_bit(DASD_CQR_SUPPRESS_CR, &erp->flags)) in dasd_3990_erp_com_rej()
1052 dev_err(&device->cdev->dev, in dasd_3990_erp_com_rej()
1071 * erp new erp_head - pointer to new ERP
1077 struct dasd_device *device = erp->startdev; in dasd_3990_erp_bus_out()
1082 if (erp->function != dasd_3990_erp_bus_out) { in dasd_3990_erp_bus_out()
1083 erp->retries = 256; in dasd_3990_erp_bus_out()
1084 erp->function = dasd_3990_erp_bus_out; in dasd_3990_erp_bus_out()
1110 * erp new erp_head - pointer to new ERP
1113 dasd_3990_erp_equip_check(struct dasd_ccw_req * erp, char *sense) in dasd_3990_erp_equip_check() argument
1116 struct dasd_device *device = erp->startdev; in dasd_3990_erp_equip_check()
1118 erp->function = dasd_3990_erp_equip_check; in dasd_3990_erp_equip_check()
1120 if (sense[1] & SNS1_WRITE_INHIBITED) { in dasd_3990_erp_equip_check()
1121 dev_err(&device->cdev->dev, "Write inhibited path encountered\n"); in dasd_3990_erp_equip_check()
1125 } else if (sense[2] & SNS2_ENV_DATA_PRESENT) { in dasd_3990_erp_equip_check()
1128 "Equipment Check - " "environmental data present"); in dasd_3990_erp_equip_check()
1130 dasd_3990_handle_env_data(erp, sense); in dasd_3990_erp_equip_check()
1132 erp = dasd_3990_erp_action_4(erp, sense); in dasd_3990_erp_equip_check()
1134 } else if (sense[1] & SNS1_PERM_ERR) { in dasd_3990_erp_equip_check()
1137 "Equipment Check - retry exhausted or " in dasd_3990_erp_equip_check()
1143 /* all other equipment checks - Action 5 */ in dasd_3990_erp_equip_check()
1163 * erp new erp_head - pointer to new ERP
1166 dasd_3990_erp_data_check(struct dasd_ccw_req * erp, char *sense) in dasd_3990_erp_data_check() argument
1169 struct dasd_device *device = erp->startdev; in dasd_3990_erp_data_check()
1171 erp->function = dasd_3990_erp_data_check; in dasd_3990_erp_data_check()
1173 if (sense[2] & SNS2_CORRECTABLE) { /* correctable data check */ in dasd_3990_erp_data_check()
1176 dev_emerg(&device->cdev->dev, in dasd_3990_erp_data_check()
1178 "fetch mode active\n"); in dasd_3990_erp_data_check()
1184 } else if (sense[2] & SNS2_ENV_DATA_PRESENT) { in dasd_3990_erp_data_check()
1190 erp = dasd_3990_erp_action_4(erp, sense); in dasd_3990_erp_data_check()
1192 } else if (sense[1] & SNS1_PERM_ERR) { in dasd_3990_erp_data_check()
1222 * erp new erp_head - pointer to new ERP
1225 dasd_3990_erp_overrun(struct dasd_ccw_req * erp, char *sense) in dasd_3990_erp_overrun() argument
1228 struct dasd_device *device = erp->startdev; in dasd_3990_erp_overrun()
1230 erp->function = dasd_3990_erp_overrun; in dasd_3990_erp_overrun()
1233 "Overrun - service overrun or overrun" in dasd_3990_erp_overrun()
1251 * erp new erp_head - pointer to new ERP
1254 dasd_3990_erp_inv_format(struct dasd_ccw_req * erp, char *sense) in dasd_3990_erp_inv_format() argument
1257 struct dasd_device *device = erp->startdev; in dasd_3990_erp_inv_format()
1259 erp->function = dasd_3990_erp_inv_format; in dasd_3990_erp_inv_format()
1261 if (sense[2] & SNS2_ENV_DATA_PRESENT) { in dasd_3990_erp_inv_format()
1267 dasd_3990_handle_env_data(erp, sense); in dasd_3990_erp_inv_format()
1269 erp = dasd_3990_erp_action_4(erp, sense); in dasd_3990_erp_inv_format()
1272 dev_err(&device->cdev->dev, "Track format is not valid\n"); in dasd_3990_erp_inv_format()
1284 * Handles 24 byte 'End-of-Cylinder' error.
1292 dasd_3990_erp_EOC(struct dasd_ccw_req * default_erp, char *sense) in dasd_3990_erp_EOC() argument
1295 struct dasd_device *device = default_erp->startdev; in dasd_3990_erp_EOC()
1297 dev_err(&device->cdev->dev, in dasd_3990_erp_EOC()
1300 /* implement action 7 - BUG */ in dasd_3990_erp_EOC()
1309 * Handles 24 byte 'Environmental-Data Present' error.
1314 * erp new erp_head - pointer to new ERP
1317 dasd_3990_erp_env_data(struct dasd_ccw_req * erp, char *sense) in dasd_3990_erp_env_data() argument
1320 struct dasd_device *device = erp->startdev; in dasd_3990_erp_env_data()
1322 erp->function = dasd_3990_erp_env_data; in dasd_3990_erp_env_data()
1326 dasd_3990_handle_env_data(erp, sense); in dasd_3990_erp_env_data()
1329 if (sense[7] != 0x0F) { in dasd_3990_erp_env_data()
1330 erp = dasd_3990_erp_action_4(erp, sense); in dasd_3990_erp_env_data()
1332 erp->status = DASD_CQR_FILLED; in dasd_3990_erp_env_data()
1349 * erp new erp_head - pointer to new ERP
1352 dasd_3990_erp_no_rec(struct dasd_ccw_req * default_erp, char *sense) in dasd_3990_erp_no_rec() argument
1355 struct dasd_device *device = default_erp->startdev; in dasd_3990_erp_no_rec()
1362 if (!test_bit(DASD_CQR_SUPPRESS_NRF, &default_erp->flags)) in dasd_3990_erp_no_rec()
1363 dev_err(&device->cdev->dev, in dasd_3990_erp_no_rec()
1381 * erp new erp_head - pointer to new ERP
1387 struct dasd_device *device = erp->startdev; in dasd_3990_erp_file_prot()
1389 dev_err(&device->cdev->dev, in dasd_3990_erp_file_prot()
1414 struct dasd_ccw_req *cqr = erp->refers; in dasd_3990_erp_inspect_alias()
1415 char *sense; in dasd_3990_erp_inspect_alias() local
1417 if (cqr->block && in dasd_3990_erp_inspect_alias()
1418 (cqr->block->base != cqr->startdev)) { in dasd_3990_erp_inspect_alias()
1420 sense = dasd_get_sense(&erp->refers->irb); in dasd_3990_erp_inspect_alias()
1424 if (!test_bit(DASD_FLAG_OFFLINE, &cqr->startdev->flags) && sense in dasd_3990_erp_inspect_alias()
1425 && (sense[0] == 0x10) && (sense[7] == 0x0F) in dasd_3990_erp_inspect_alias()
1426 && (sense[8] == 0x67)) { in dasd_3990_erp_inspect_alias()
1432 dasd_alias_remove_device(cqr->startdev); in dasd_3990_erp_inspect_alias()
1435 dasd_reload_device(cqr->startdev); in dasd_3990_erp_inspect_alias()
1438 if (cqr->startdev->features & DASD_FEATURE_ERPLOG) { in dasd_3990_erp_inspect_alias()
1439 DBF_DEV_EVENT(DBF_ERR, cqr->startdev, in dasd_3990_erp_inspect_alias()
1442 dev_name(&cqr->block->base->cdev->dev)); in dasd_3990_erp_inspect_alias()
1445 erp->startdev = cqr->block->base; in dasd_3990_erp_inspect_alias()
1446 erp->function = dasd_3990_erp_inspect_alias; in dasd_3990_erp_inspect_alias()
1457 * Does a detailed inspection of the 24 byte sense data
1461 * sense sense data of the actual error
1468 dasd_3990_erp_inspect_24(struct dasd_ccw_req * erp, char *sense) in dasd_3990_erp_inspect_24() argument
1473 /* Check sense for .... */ in dasd_3990_erp_inspect_24()
1475 if ((erp_filled == NULL) && (sense[0] & SNS0_CMD_REJECT)) { in dasd_3990_erp_inspect_24()
1476 erp_filled = dasd_3990_erp_com_rej(erp, sense); in dasd_3990_erp_inspect_24()
1479 if ((erp_filled == NULL) && (sense[0] & SNS0_INTERVENTION_REQ)) { in dasd_3990_erp_inspect_24()
1483 if ((erp_filled == NULL) && (sense[0] & SNS0_BUS_OUT_CHECK)) { in dasd_3990_erp_inspect_24()
1487 if ((erp_filled == NULL) && (sense[0] & SNS0_EQUIPMENT_CHECK)) { in dasd_3990_erp_inspect_24()
1488 erp_filled = dasd_3990_erp_equip_check(erp, sense); in dasd_3990_erp_inspect_24()
1491 if ((erp_filled == NULL) && (sense[0] & SNS0_DATA_CHECK)) { in dasd_3990_erp_inspect_24()
1492 erp_filled = dasd_3990_erp_data_check(erp, sense); in dasd_3990_erp_inspect_24()
1495 if ((erp_filled == NULL) && (sense[0] & SNS0_OVERRUN)) { in dasd_3990_erp_inspect_24()
1496 erp_filled = dasd_3990_erp_overrun(erp, sense); in dasd_3990_erp_inspect_24()
1499 if ((erp_filled == NULL) && (sense[1] & SNS1_INV_TRACK_FORMAT)) { in dasd_3990_erp_inspect_24()
1500 erp_filled = dasd_3990_erp_inv_format(erp, sense); in dasd_3990_erp_inspect_24()
1502 /* 'End-of-Cylinder' */ in dasd_3990_erp_inspect_24()
1503 if ((erp_filled == NULL) && (sense[1] & SNS1_EOC)) { in dasd_3990_erp_inspect_24()
1504 erp_filled = dasd_3990_erp_EOC(erp, sense); in dasd_3990_erp_inspect_24()
1507 if ((erp_filled == NULL) && (sense[2] & SNS2_ENV_DATA_PRESENT)) { in dasd_3990_erp_inspect_24()
1508 erp_filled = dasd_3990_erp_env_data(erp, sense); in dasd_3990_erp_inspect_24()
1511 if ((erp_filled == NULL) && (sense[1] & SNS1_NO_REC_FOUND)) { in dasd_3990_erp_inspect_24()
1512 erp_filled = dasd_3990_erp_no_rec(erp, sense); in dasd_3990_erp_inspect_24()
1515 if ((erp_filled == NULL) && (sense[1] & SNS1_FILE_PROTECTED)) { in dasd_3990_erp_inspect_24()
1518 /* other (unknown) error - do default ERP */ in dasd_3990_erp_inspect_24()
1530 * 32 byte sense ERP functions (only)
1543 * sense current sense data
1548 dasd_3990_erp_action_10_32(struct dasd_ccw_req * erp, char *sense) in dasd_3990_erp_action_10_32() argument
1551 struct dasd_device *device = erp->startdev; in dasd_3990_erp_action_10_32()
1553 erp->retries = 256; in dasd_3990_erp_action_10_32()
1554 erp->function = dasd_3990_erp_action_10_32; in dasd_3990_erp_action_10_32()
1575 * sense current sense data
1582 dasd_3990_erp_action_1B_32(struct dasd_ccw_req * default_erp, char *sense) in dasd_3990_erp_action_1B_32() argument
1585 struct dasd_device *device = default_erp->startdev; in dasd_3990_erp_action_1B_32()
1597 default_erp->function = dasd_3990_erp_action_1B_32; in dasd_3990_erp_action_1B_32()
1602 while (cqr->refers != NULL) { in dasd_3990_erp_action_1B_32()
1603 cqr = cqr->refers; in dasd_3990_erp_action_1B_32()
1606 if (scsw_is_tm(&cqr->irb.scsw)) { in dasd_3990_erp_action_1B_32()
1608 "32 bit sense, action 1B is not defined" in dasd_3990_erp_action_1B_32()
1609 " in transport mode - just retry"); in dasd_3990_erp_action_1B_32()
1614 if (sense[1] & 0x01) { in dasd_3990_erp_action_1B_32()
1616 "Imprecise ending is set - just retry"); in dasd_3990_erp_action_1B_32()
1622 /* Imprecise ending is not set -> addr from IRB-SCSW */ in dasd_3990_erp_action_1B_32()
1623 cpa = default_erp->refers->irb.scsw.cmd.cpa; in dasd_3990_erp_action_1B_32()
1634 erp = dasd_alloc_erp_request(cqr->magic, in dasd_3990_erp_action_1B_32()
1646 DE_data = erp->data; in dasd_3990_erp_action_1B_32()
1647 oldccw = cqr->cpaddr; in dasd_3990_erp_action_1B_32()
1648 if (oldccw->cmd_code == DASD_ECKD_CCW_PFX) { in dasd_3990_erp_action_1B_32()
1649 PFX_data = cqr->data; in dasd_3990_erp_action_1B_32()
1650 memcpy(DE_data, &PFX_data->define_extent, in dasd_3990_erp_action_1B_32()
1653 memcpy(DE_data, cqr->data, sizeof(struct DE_eckd_data)); in dasd_3990_erp_action_1B_32()
1656 LO_data = erp->data + sizeof(struct DE_eckd_data); in dasd_3990_erp_action_1B_32()
1658 if ((sense[3] == 0x01) && (LO_data[1] & 0x01)) { in dasd_3990_erp_action_1B_32()
1663 if ((sense[7] & 0x3F) == 0x01) { in dasd_3990_erp_action_1B_32()
1664 /* operation code is WRITE DATA -> data area orientation */ in dasd_3990_erp_action_1B_32()
1667 } else if ((sense[7] & 0x3F) == 0x03) { in dasd_3990_erp_action_1B_32()
1668 /* operation code is FORMAT WRITE -> index orientation */ in dasd_3990_erp_action_1B_32()
1672 LO_data[0] = sense[7]; /* operation */ in dasd_3990_erp_action_1B_32()
1675 LO_data[1] = sense[8]; /* auxiliary */ in dasd_3990_erp_action_1B_32()
1676 LO_data[2] = sense[9]; in dasd_3990_erp_action_1B_32()
1677 LO_data[3] = sense[3]; /* count */ in dasd_3990_erp_action_1B_32()
1678 LO_data[4] = sense[29]; /* seek_addr.cyl */ in dasd_3990_erp_action_1B_32()
1679 LO_data[5] = sense[30]; /* seek_addr.cyl 2nd byte */ in dasd_3990_erp_action_1B_32()
1680 LO_data[7] = sense[31]; /* seek_addr.head 2nd byte */ in dasd_3990_erp_action_1B_32()
1682 memcpy(&(LO_data[8]), &(sense[11]), 8); in dasd_3990_erp_action_1B_32()
1685 ccw = erp->cpaddr; in dasd_3990_erp_action_1B_32()
1687 ccw->cmd_code = DASD_ECKD_CCW_DEFINE_EXTENT; in dasd_3990_erp_action_1B_32()
1688 ccw->flags = CCW_FLAG_CC; in dasd_3990_erp_action_1B_32()
1689 ccw->count = 16; in dasd_3990_erp_action_1B_32()
1690 ccw->cda = virt_to_dma32(DE_data); in dasd_3990_erp_action_1B_32()
1695 ccw->cmd_code = DASD_ECKD_CCW_LOCATE_RECORD; in dasd_3990_erp_action_1B_32()
1696 ccw->flags = CCW_FLAG_CC; in dasd_3990_erp_action_1B_32()
1697 ccw->count = 16; in dasd_3990_erp_action_1B_32()
1698 ccw->cda = virt_to_dma32(LO_data); in dasd_3990_erp_action_1B_32()
1702 ccw->cmd_code = CCW_CMD_TIC; in dasd_3990_erp_action_1B_32()
1703 ccw->cda = cpa; in dasd_3990_erp_action_1B_32()
1706 erp->flags = default_erp->flags; in dasd_3990_erp_action_1B_32()
1707 erp->function = dasd_3990_erp_action_1B_32; in dasd_3990_erp_action_1B_32()
1708 erp->refers = default_erp->refers; in dasd_3990_erp_action_1B_32()
1709 erp->startdev = device; in dasd_3990_erp_action_1B_32()
1710 erp->memdev = device; in dasd_3990_erp_action_1B_32()
1711 erp->magic = default_erp->magic; in dasd_3990_erp_action_1B_32()
1712 erp->expires = default_erp->expires; in dasd_3990_erp_action_1B_32()
1713 erp->retries = 256; in dasd_3990_erp_action_1B_32()
1714 erp->buildclk = get_tod_clock(); in dasd_3990_erp_action_1B_32()
1715 erp->status = DASD_CQR_FILLED; in dasd_3990_erp_action_1B_32()
1735 * sense current sense data
1740 dasd_3990_update_1B(struct dasd_ccw_req * previous_erp, char *sense) in dasd_3990_update_1B() argument
1743 struct dasd_device *device = previous_erp->startdev; in dasd_3990_update_1B()
1752 " - follow on"); in dasd_3990_update_1B()
1757 while (cqr->refers != NULL) { in dasd_3990_update_1B()
1758 cqr = cqr->refers; in dasd_3990_update_1B()
1761 if (scsw_is_tm(&cqr->irb.scsw)) { in dasd_3990_update_1B()
1763 "32 bit sense, action 1B, update," in dasd_3990_update_1B()
1764 " in transport mode - just retry"); in dasd_3990_update_1B()
1769 if (sense[1] & 0x01) { in dasd_3990_update_1B()
1771 "Imprecise ending is set - just retry"); in dasd_3990_update_1B()
1773 previous_erp->status = DASD_CQR_FILLED; in dasd_3990_update_1B()
1779 /* Imprecise ending is not set -> addr from IRB-SCSW */ in dasd_3990_update_1B()
1780 cpa = previous_erp->irb.scsw.cmd.cpa; in dasd_3990_update_1B()
1783 dev_err(&device->cdev->dev, in dasd_3990_update_1B()
1786 previous_erp->status = DASD_CQR_FAILED; in dasd_3990_update_1B()
1793 /* update the LO with the new returned sense data */ in dasd_3990_update_1B()
1794 LO_data = erp->data + sizeof(struct DE_eckd_data); in dasd_3990_update_1B()
1796 if ((sense[3] == 0x01) && (LO_data[1] & 0x01)) { in dasd_3990_update_1B()
1798 previous_erp->status = DASD_CQR_FAILED; in dasd_3990_update_1B()
1803 if ((sense[7] & 0x3F) == 0x01) { in dasd_3990_update_1B()
1804 /* operation code is WRITE DATA -> data area orientation */ in dasd_3990_update_1B()
1807 } else if ((sense[7] & 0x3F) == 0x03) { in dasd_3990_update_1B()
1808 /* operation code is FORMAT WRITE -> index orientation */ in dasd_3990_update_1B()
1812 LO_data[0] = sense[7]; /* operation */ in dasd_3990_update_1B()
1815 LO_data[1] = sense[8]; /* auxiliary */ in dasd_3990_update_1B()
1816 LO_data[2] = sense[9]; in dasd_3990_update_1B()
1817 LO_data[3] = sense[3]; /* count */ in dasd_3990_update_1B()
1818 LO_data[4] = sense[29]; /* seek_addr.cyl */ in dasd_3990_update_1B()
1819 LO_data[5] = sense[30]; /* seek_addr.cyl 2nd byte */ in dasd_3990_update_1B()
1820 LO_data[7] = sense[31]; /* seek_addr.head 2nd byte */ in dasd_3990_update_1B()
1822 memcpy(&(LO_data[8]), &(sense[11]), 8); in dasd_3990_update_1B()
1825 ccw = erp->cpaddr; /* addr of DE ccw */ in dasd_3990_update_1B()
1828 ccw->cda = cpa; in dasd_3990_update_1B()
1830 erp->status = DASD_CQR_FILLED; in dasd_3990_update_1B()
1842 * by the sense data. This makes enqueueing of the request
1846 * sense sense data of the actual error
1854 dasd_3990_erp_compound_retry(struct dasd_ccw_req * erp, char *sense) in dasd_3990_erp_compound_retry() argument
1857 switch (sense[25] & 0x03) { in dasd_3990_erp_compound_retry()
1859 erp->retries = 1; in dasd_3990_erp_compound_retry()
1863 erp->retries = 2; in dasd_3990_erp_compound_retry()
1867 erp->retries = 10; in dasd_3990_erp_compound_retry()
1871 erp->retries = 256; in dasd_3990_erp_compound_retry()
1878 erp->function = dasd_3990_erp_compound_retry; in dasd_3990_erp_compound_retry()
1890 * sense sense data of the actual error
1898 dasd_3990_erp_compound_path(struct dasd_ccw_req * erp, char *sense) in dasd_3990_erp_compound_path() argument
1900 if (sense[25] & DASD_SENSE_BIT_3) { in dasd_3990_erp_compound_path()
1903 if (erp->status == DASD_CQR_FAILED && in dasd_3990_erp_compound_path()
1904 !test_bit(DASD_CQR_VERIFY_PATH, &erp->flags)) { in dasd_3990_erp_compound_path()
1907 erp->lpm = dasd_path_get_opm(erp->startdev); in dasd_3990_erp_compound_path()
1908 erp->status = DASD_CQR_NEED_ERP; in dasd_3990_erp_compound_path()
1912 erp->function = dasd_3990_erp_compound_path; in dasd_3990_erp_compound_path()
1923 * sense sense data of the actual error
1931 dasd_3990_erp_compound_code(struct dasd_ccw_req * erp, char *sense) in dasd_3990_erp_compound_code() argument
1934 if (sense[25] & DASD_SENSE_BIT_2) { in dasd_3990_erp_compound_code()
1936 switch (sense[28]) { in dasd_3990_erp_compound_code()
1945 erp->retries = 1; in dasd_3990_erp_compound_code()
1951 /* should not happen - continue */ in dasd_3990_erp_compound_code()
1956 erp->function = dasd_3990_erp_compound_code; in dasd_3990_erp_compound_code()
1971 * sense sense data of the actual error
1979 dasd_3990_erp_compound_config(struct dasd_ccw_req * erp, char *sense) in dasd_3990_erp_compound_config() argument
1982 if ((sense[25] & DASD_SENSE_BIT_1) && (sense[26] & DASD_SENSE_BIT_2)) { in dasd_3990_erp_compound_config()
1983 struct dasd_device *device = erp->startdev; in dasd_3990_erp_compound_config()
1984 dev_err(&device->cdev->dev, in dasd_3990_erp_compound_config()
1988 erp->function = dasd_3990_erp_compound_config; in dasd_3990_erp_compound_config()
2000 * sense sense data of the actual error
2008 dasd_3990_erp_compound(struct dasd_ccw_req * erp, char *sense) in dasd_3990_erp_compound() argument
2011 if ((erp->function == dasd_3990_erp_compound_retry) && in dasd_3990_erp_compound()
2012 (erp->status == DASD_CQR_NEED_ERP)) { in dasd_3990_erp_compound()
2014 dasd_3990_erp_compound_path(erp, sense); in dasd_3990_erp_compound()
2017 if ((erp->function == dasd_3990_erp_compound_path) && in dasd_3990_erp_compound()
2018 (erp->status == DASD_CQR_NEED_ERP)) { in dasd_3990_erp_compound()
2020 erp = dasd_3990_erp_compound_code(erp, sense); in dasd_3990_erp_compound()
2023 if ((erp->function == dasd_3990_erp_compound_code) && in dasd_3990_erp_compound()
2024 (erp->status == DASD_CQR_NEED_ERP)) { in dasd_3990_erp_compound()
2026 dasd_3990_erp_compound_config(erp, sense); in dasd_3990_erp_compound()
2030 if (erp->status == DASD_CQR_NEED_ERP) in dasd_3990_erp_compound()
2031 erp->status = DASD_CQR_FAILED; in dasd_3990_erp_compound()
2041 * inspects the SIM SENSE data and starts an appropriate action
2044 * sense sense data of the actual error
2050 dasd_3990_erp_handle_sim(struct dasd_device *device, char *sense) in dasd_3990_erp_handle_sim() argument
2052 /* print message according to log or message to operator mode */ in dasd_3990_erp_handle_sim()
2053 if ((sense[24] & DASD_SIM_MSG_TO_OP) || (sense[1] & 0x10)) { in dasd_3990_erp_handle_sim()
2055 dev_err(&device->cdev->dev, "SIM - SRC: " in dasd_3990_erp_handle_sim()
2056 "%02x%02x%02x%02x\n", sense[22], in dasd_3990_erp_handle_sim()
2057 sense[23], sense[11], sense[12]); in dasd_3990_erp_handle_sim()
2058 } else if (sense[24] & DASD_SIM_LOG) { in dasd_3990_erp_handle_sim()
2060 dev_warn(&device->cdev->dev, "log SIM - SRC: " in dasd_3990_erp_handle_sim()
2061 "%02x%02x%02x%02x\n", sense[22], in dasd_3990_erp_handle_sim()
2062 sense[23], sense[11], sense[12]); in dasd_3990_erp_handle_sim()
2070 * Does a detailed inspection of the 32 byte sense data
2074 * sense sense data of the actual error
2082 dasd_3990_erp_inspect_32(struct dasd_ccw_req * erp, char *sense) in dasd_3990_erp_inspect_32() argument
2085 struct dasd_device *device = erp->startdev; in dasd_3990_erp_inspect_32()
2087 erp->function = dasd_3990_erp_inspect_32; in dasd_3990_erp_inspect_32()
2089 /* check for SIM sense data */ in dasd_3990_erp_inspect_32()
2090 if ((sense[6] & DASD_SIM_SENSE) == DASD_SIM_SENSE) in dasd_3990_erp_inspect_32()
2091 dasd_3990_erp_handle_sim(device, sense); in dasd_3990_erp_inspect_32()
2093 if (sense[25] & DASD_SENSE_BIT_0) { in dasd_3990_erp_inspect_32()
2096 dasd_3990_erp_compound_retry(erp, sense); in dasd_3990_erp_inspect_32()
2101 switch (sense[25]) { in dasd_3990_erp_inspect_32()
2103 case 0x00: /* success - use default ERP for retries */ in dasd_3990_erp_inspect_32()
2106 " - just retry"); in dasd_3990_erp_inspect_32()
2110 dev_err(&device->cdev->dev, in dasd_3990_erp_inspect_32()
2122 dev_err(&device->cdev->dev, in dasd_3990_erp_inspect_32()
2129 erp = dasd_3990_erp_action_10_32(erp, sense); in dasd_3990_erp_inspect_32()
2133 dev_err(&device->cdev->dev, in dasd_3990_erp_inspect_32()
2141 erp = dasd_3990_erp_action_1B_32(erp, sense); in dasd_3990_erp_inspect_32()
2145 dev_emerg(&device->cdev->dev, in dasd_3990_erp_inspect_32()
2147 "fetch mode active\n"); in dasd_3990_erp_inspect_32()
2151 ("Invalid data - No way to inform application " in dasd_3990_erp_inspect_32()
2155 case 0x1D: /* state-change pending */ in dasd_3990_erp_inspect_32()
2160 erp = dasd_3990_erp_action_4(erp, sense); in dasd_3990_erp_inspect_32()
2167 erp = dasd_3990_erp_action_4(erp, sense); in dasd_3990_erp_inspect_32()
2170 default: /* all others errors - default erp */ in dasd_3990_erp_inspect_32()
2183 if (!(device->features & DASD_FEATURE_PATH_AUTODISABLE)) { in dasd_3990_erp_disable_path()
2184 dev_err(&device->cdev->dev, in dasd_3990_erp_disable_path()
2186 device->path[pos].cssid, device->path[pos].chpid, lpum); in dasd_3990_erp_disable_path()
2192 dev_err(&device->cdev->dev, in dasd_3990_erp_disable_path()
2194 device->path[pos].cssid, device->path[pos].chpid, lpum); in dasd_3990_erp_disable_path()
2198 dev_err(&device->cdev->dev, in dasd_3990_erp_disable_path()
2199 "Path %x.%02x (pathmask %02x) is disabled - IFCC threshold exceeded\n", in dasd_3990_erp_disable_path()
2200 device->path[pos].cssid, device->path[pos].chpid, lpum); in dasd_3990_erp_disable_path()
2205 device->path[pos].errorclk = 0; in dasd_3990_erp_disable_path()
2206 atomic_set(&device->path[pos].error_count, 0); in dasd_3990_erp_disable_path()
2211 struct dasd_device *device = erp->startdev; in dasd_3990_erp_account_error()
2212 __u8 lpum = erp->refers->irb.esw.esw1.lpum; in dasd_3990_erp_account_error()
2216 if (!device->path_thrhld) in dasd_3990_erp_account_error()
2224 if ((tod_to_ns(clk - device->path[pos].errorclk) / NSEC_PER_SEC) in dasd_3990_erp_account_error()
2225 >= device->path_interval) { in dasd_3990_erp_account_error()
2226 atomic_set(&device->path[pos].error_count, 0); in dasd_3990_erp_account_error()
2227 device->path[pos].errorclk = 0; in dasd_3990_erp_account_error()
2229 atomic_inc(&device->path[pos].error_count); in dasd_3990_erp_account_error()
2230 device->path[pos].errorclk = clk; in dasd_3990_erp_account_error()
2232 if (atomic_read(&device->path[pos].error_count) >= in dasd_3990_erp_account_error()
2233 device->path_thrhld) in dasd_3990_erp_account_error()
2239 * main ERP control functions (24 and 32 byte sense)
2260 struct dasd_device *device = erp->startdev; in dasd_3990_erp_control_check()
2262 if (scsw_cstat(&erp->refers->irb.scsw) & (SCHN_STAT_INTF_CTRL_CHK in dasd_3990_erp_control_check()
2276 * Does a detailed inspection for sense data by calling either
2277 * the 24-byte or the 32-byte inspection routine.
2289 char *sense; in dasd_3990_erp_inspect() local
2296 /* sense data are located in the refers record of the in dasd_3990_erp_inspect()
2300 sense = dasd_get_sense(&erp->refers->irb); in dasd_3990_erp_inspect()
2301 if (!sense) in dasd_3990_erp_inspect()
2303 /* distinguish between 24 and 32 byte sense data */ in dasd_3990_erp_inspect()
2304 else if (sense[27] & DASD_SENSE_BIT_0) { in dasd_3990_erp_inspect()
2306 /* inspect the 24 byte sense data */ in dasd_3990_erp_inspect()
2307 erp_new = dasd_3990_erp_inspect_24(erp, sense); in dasd_3990_erp_inspect()
2311 /* inspect the 32 byte sense data */ in dasd_3990_erp_inspect()
2312 erp_new = dasd_3990_erp_inspect_32(erp, sense); in dasd_3990_erp_inspect()
2314 } /* end distinguish between 24 and 32 byte sense data */ in dasd_3990_erp_inspect()
2325 * For a command mode cqr the erp is initialized as an default erp
2327 * For transport mode we make a copy of the original TCW (points to
2329 * TSB so the original sense data will not be changed.
2332 * cqr head of the current ERP-chain (or single cqr if
2335 * erp pointer to new ERP-chain head
2340 struct dasd_device *device = cqr->startdev; in dasd_3990_erp_add_erp()
2347 if (cqr->cpmode == 1) { in dasd_3990_erp_add_erp()
2357 erp = dasd_alloc_erp_request(cqr->magic, in dasd_3990_erp_add_erp()
2360 if (cqr->retries <= 0) { in dasd_3990_erp_add_erp()
2363 cqr->status = DASD_CQR_FAILED; in dasd_3990_erp_add_erp()
2364 cqr->stopclk = get_tod_clock(); in dasd_3990_erp_add_erp()
2369 cqr->retries); in dasd_3990_erp_add_erp()
2370 dasd_block_set_timer(device->block, (HZ << 3)); in dasd_3990_erp_add_erp()
2375 ccw = cqr->cpaddr; in dasd_3990_erp_add_erp()
2376 if (cqr->cpmode == 1) { in dasd_3990_erp_add_erp()
2378 erp->cpmode = 1; in dasd_3990_erp_add_erp()
2379 erp->cpaddr = PTR_ALIGN(erp->data, 64); in dasd_3990_erp_add_erp()
2380 tcw = erp->cpaddr; in dasd_3990_erp_add_erp()
2382 *tcw = *((struct tcw *)cqr->cpaddr); in dasd_3990_erp_add_erp()
2383 tcw->tsb = virt_to_dma64(tsb); in dasd_3990_erp_add_erp()
2384 } else if (ccw->cmd_code == DASD_ECKD_CCW_PSF) { in dasd_3990_erp_add_erp()
2386 erp->cpaddr = cqr->cpaddr; in dasd_3990_erp_add_erp()
2389 ccw = erp->cpaddr; in dasd_3990_erp_add_erp()
2390 ccw->cmd_code = CCW_CMD_NOOP; in dasd_3990_erp_add_erp()
2391 ccw->flags = CCW_FLAG_CC; in dasd_3990_erp_add_erp()
2393 ccw->cmd_code = CCW_CMD_TIC; in dasd_3990_erp_add_erp()
2394 ccw->cda = virt_to_dma32(cqr->cpaddr); in dasd_3990_erp_add_erp()
2397 erp->flags = cqr->flags; in dasd_3990_erp_add_erp()
2398 erp->function = dasd_3990_erp_add_erp; in dasd_3990_erp_add_erp()
2399 erp->refers = cqr; in dasd_3990_erp_add_erp()
2400 erp->startdev = device; in dasd_3990_erp_add_erp()
2401 erp->memdev = device; in dasd_3990_erp_add_erp()
2402 erp->block = cqr->block; in dasd_3990_erp_add_erp()
2403 erp->magic = cqr->magic; in dasd_3990_erp_add_erp()
2404 erp->expires = cqr->expires; in dasd_3990_erp_add_erp()
2405 erp->retries = device->default_retries; in dasd_3990_erp_add_erp()
2406 erp->buildclk = get_tod_clock(); in dasd_3990_erp_add_erp()
2407 erp->status = DASD_CQR_FILLED; in dasd_3990_erp_add_erp()
2417 * Add ERP to the head of the ERP-chain containing the ERP processing
2418 * determined based on the sense data.
2421 * cqr head of the current ERP-chain (or single cqr if
2425 * erp pointer to new ERP-chain head
2439 /* inspect sense, determine specific ERP if possible */ in dasd_3990_erp_additional_erp()
2454 * This means that the failed CCW and the relevant sense data
2456 * I don't distinguish between 24 and 32 byte sense because in case of
2457 * 24 byte sense byte 25 and 27 is set as well.
2472 if (cqr1->startdev != cqr2->startdev) in dasd_3990_erp_error_match()
2475 sense1 = dasd_get_sense(&cqr1->irb); in dasd_3990_erp_error_match()
2476 sense2 = dasd_get_sense(&cqr2->irb); in dasd_3990_erp_error_match()
2478 /* one request has sense data, the other not -> no match, return 0 */ in dasd_3990_erp_error_match()
2481 /* no sense data in both cases -> check cstat for IFCC */ in dasd_3990_erp_error_match()
2483 if ((scsw_cstat(&cqr1->irb.scsw) & (SCHN_STAT_INTF_CTRL_CHK | in dasd_3990_erp_error_match()
2485 (scsw_cstat(&cqr2->irb.scsw) & (SCHN_STAT_INTF_CTRL_CHK | in dasd_3990_erp_error_match()
2489 /* check sense data; byte 0-2,25,27 */ in dasd_3990_erp_error_match()
2495 return 0; /* sense doesn't match */ in dasd_3990_erp_error_match()
2507 * quick exit if current cqr is not an ERP (cqr->refers=NULL)
2513 * erp erp-pointer to the already defined error
2525 if (cqr->refers == NULL) { /* return if not in erp */ in dasd_3990_erp_in_erp()
2531 match = dasd_3990_erp_error_match(erp_head, cqr->refers); in dasd_3990_erp_in_erp()
2533 cqr = cqr->refers; /* check next erp/cqr in queue */ in dasd_3990_erp_in_erp()
2535 } while ((cqr->refers != NULL) && (!match)); in dasd_3990_erp_in_erp()
2546 * DASD_3990_ERP_FURTHER_ERP (24 & 32 byte sense)
2551 * - do further defined ERP action or
2552 * - wait for interrupt or
2553 * - exit with permanent error
2565 struct dasd_device *device = erp->startdev; in dasd_3990_erp_further_erp()
2566 char *sense = dasd_get_sense(&erp->irb); in dasd_3990_erp_further_erp() local
2568 /* check for 24 byte sense ERP */ in dasd_3990_erp_further_erp()
2569 if ((erp->function == dasd_3990_erp_bus_out) || in dasd_3990_erp_further_erp()
2570 (erp->function == dasd_3990_erp_action_1) || in dasd_3990_erp_further_erp()
2571 (erp->function == dasd_3990_erp_action_4)) { in dasd_3990_erp_further_erp()
2575 } else if (erp->function == dasd_3990_erp_action_1_sec) { in dasd_3990_erp_further_erp()
2577 } else if (erp->function == dasd_3990_erp_action_5) { in dasd_3990_erp_further_erp()
2583 if (sense && !(sense[2] & DASD_SENSE_BIT_0)) { in dasd_3990_erp_further_erp()
2588 switch (sense[25]) { in dasd_3990_erp_further_erp()
2608 sense[25]); in dasd_3990_erp_further_erp()
2612 /* check for 32 byte sense ERP */ in dasd_3990_erp_further_erp()
2613 } else if (sense && in dasd_3990_erp_further_erp()
2614 ((erp->function == dasd_3990_erp_compound_retry) || in dasd_3990_erp_further_erp()
2615 (erp->function == dasd_3990_erp_compound_path) || in dasd_3990_erp_further_erp()
2616 (erp->function == dasd_3990_erp_compound_code) || in dasd_3990_erp_further_erp()
2617 (erp->function == dasd_3990_erp_compound_config))) { in dasd_3990_erp_further_erp()
2619 erp = dasd_3990_erp_compound(erp, sense); in dasd_3990_erp_further_erp()
2626 dev_err(&device->cdev->dev, in dasd_3990_erp_further_erp()
2629 erp->status = DASD_CQR_FAILED; in dasd_3990_erp_further_erp()
2648 * erp_head first ERP in ERP-chain
2660 struct dasd_device *device = erp_head->startdev; in dasd_3990_erp_handle_match_erp()
2671 list_del(&erp_done->blocklist); in dasd_3990_erp_handle_match_erp()
2674 erp_done = erp_done->refers; in dasd_3990_erp_handle_match_erp()
2677 dasd_free_erp_request(erp_free, erp_free->memdev); in dasd_3990_erp_handle_match_erp()
2681 if (erp->retries > 0) { in dasd_3990_erp_handle_match_erp()
2683 char *sense = dasd_get_sense(&erp->refers->irb); in dasd_3990_erp_handle_match_erp() local
2686 if (sense && erp->function == dasd_3990_erp_action_4) { in dasd_3990_erp_handle_match_erp()
2688 erp = dasd_3990_erp_action_4(erp, sense); in dasd_3990_erp_handle_match_erp()
2690 } else if (sense && in dasd_3990_erp_handle_match_erp()
2691 erp->function == dasd_3990_erp_action_1B_32) { in dasd_3990_erp_handle_match_erp()
2693 erp = dasd_3990_update_1B(erp, sense); in dasd_3990_erp_handle_match_erp()
2695 } else if (sense && erp->function == dasd_3990_erp_int_req) { in dasd_3990_erp_handle_match_erp()
2703 erp->retries, erp); in dasd_3990_erp_handle_match_erp()
2706 erp->status = DASD_CQR_FILLED; in dasd_3990_erp_handle_match_erp()
2710 /* no retry left - check for further necessary action */ in dasd_3990_erp_handle_match_erp()
2730 * erp erp-pointer to the head of the ERP action chain.
2732 * - either a ptr to an additional ERP cqr or
2733 * - the original given cqr (which's status might
2740 struct dasd_device *device = cqr->startdev; in dasd_3990_erp_action()
2743 if (device->features & DASD_FEATURE_ERPLOG) { in dasd_3990_erp_action()
2745 dev_err(&device->cdev->dev, in dasd_3990_erp_action()
2746 "ERP chain at BEGINNING of ERP-ACTION\n"); in dasd_3990_erp_action()
2748 temp_erp != NULL; temp_erp = temp_erp->refers) { in dasd_3990_erp_action()
2749 dev_err(&device->cdev->dev, in dasd_3990_erp_action()
2751 temp_erp, temp_erp->status, temp_erp->refers); in dasd_3990_erp_action()
2755 /* double-check if current erp/cqr was successful */ in dasd_3990_erp_action()
2756 if ((scsw_cstat(&cqr->irb.scsw) == 0x00) && in dasd_3990_erp_action()
2757 (scsw_dstat(&cqr->irb.scsw) == in dasd_3990_erp_action()
2762 " - NO ERP necessary", cqr); in dasd_3990_erp_action()
2764 cqr->status = DASD_CQR_DONE; in dasd_3990_erp_action()
2773 /* no matching erp found - set up erp */ in dasd_3990_erp_action()
2778 /* matching erp found - set all leading erp's to DONE */ in dasd_3990_erp_action()
2788 if (test_bit(DASD_CQR_VERIFY_PATH, &erp->flags) && cqr->lpm) { in dasd_3990_erp_action()
2789 erp->lpm = cqr->lpm; in dasd_3990_erp_action()
2792 if (device->features & DASD_FEATURE_ERPLOG) { in dasd_3990_erp_action()
2794 dev_err(&device->cdev->dev, in dasd_3990_erp_action()
2795 "ERP chain at END of ERP-ACTION\n"); in dasd_3990_erp_action()
2797 temp_erp != NULL; temp_erp = temp_erp->refers) { in dasd_3990_erp_action()
2798 dev_err(&device->cdev->dev, in dasd_3990_erp_action()
2800 temp_erp, temp_erp->status, temp_erp->refers); in dasd_3990_erp_action()
2805 if (list_empty(&erp->blocklist)) { in dasd_3990_erp_action()
2806 cqr->status = DASD_CQR_IN_ERP; in dasd_3990_erp_action()
2808 list_add_tail(&erp->blocklist, &cqr->blocklist); in dasd_3990_erp_action()