switch (request->op) { case TO_DSE: case TO_RUN: case TO_WRI: case TO_WTM: case TO_ASSIGN: case TO_UNASSIGN:
tape_34xx_delete_sbid_from(request->device, 0); break; default:
;
} return TAPE_IO_SUCCESS;
}
staticinlineint
tape_34xx_erp_failed(struct tape_request *request, int rc)
{
DBF_EVENT(3, "Error recovery failed for %s (RC=%d)\n",
tape_op_verbose[request->op], rc); return rc;
}
/* *Specialcasesforvarioustape-stateswhenreaching *endofrecordedarea * *FIXME:Maybeaspecialcaseofthespecialcase: *sense[0]==SENSE_EQUIPMENT_CHECK&& *sense[1]==SENSE_DRIVE_ONLINE&& *sense[3]==0x47(VolumeFenced) * *ThiswascausedbycontinuedFSForFSRafteran *'EndOfData'.
*/ if ((
sense[0] == SENSE_DATA_CHECK ||
sense[0] == SENSE_EQUIPMENT_CHECK ||
sense[0] == (SENSE_EQUIPMENT_CHECK | SENSE_DEFERRED_UNIT_CHECK)
) && (
sense[1] == SENSE_DRIVE_ONLINE ||
sense[1] == (SENSE_BEGINNING_OF_TAPE | SENSE_WRITE_MODE)
)) { switch (request->op) { /* *sense[0]==SENSE_DATA_CHECK&& *sense[1]==SENSE_DRIVE_ONLINE *sense[3]==0x36(EndOfData) * *Furtherseeksmightreturna'VolumeFenced'.
*/ case TO_FSF: case TO_FSB: /* Trying to seek beyond end of recorded area */ return tape_34xx_erp_failed(request, -ENOSPC); case TO_BSB: return tape_34xx_erp_retry(request);
/* *sense[0]==SENSE_DATA_CHECK&& *sense[1]==SENSE_DRIVE_ONLINE&& *sense[3]==0x36(EndOfData)
*/ case TO_LBL: /* Block could not be located. */
tape_34xx_delete_sbid_from(device, 0); return tape_34xx_erp_failed(request, -EIO);
case TO_RFO: /* Read beyond end of recorded area -> 0 bytes read */ return tape_34xx_erp_failed(request, 0);
/* *sense[0]==SENSE_EQUIPMENT_CHECK&& *sense[1]==SENSE_DRIVE_ONLINE&& *sense[3]==0x38(PhysicalEndOfVolume)
*/ case TO_WRI: /* Writing at physical end of volume */ return tape_34xx_erp_failed(request, -ENOSPC); default: return tape_34xx_erp_failed(request, 0);
}
}
/* Sensing special bits */ if (sense[0] & SENSE_BUS_OUT_CHECK) return tape_34xx_erp_retry(request);
if (sense[0] & SENSE_DATA_CHECK) { /* *hardwarefailure,damagedtapeorimproper *operatingconditions
*/ switch (sense[3]) { case0x23: /* a read data check occurred */ if ((sense[2] & SENSE_TAPE_SYNC_MODE) ||
inhibit_cu_recovery) // data check is not permanent, may be // recovered. We always use async-mode with // cu-recovery, so this should *never* happen. return tape_34xx_erp_bug(device, request,
irb, -4);
/* data check is permanent, CU recovery has failed */
dev_warn (&device->cdev->dev, "A read error occurred " "that cannot be recovered\n"); return tape_34xx_erp_failed(request, -EIO); case0x25: // a write data check occurred if ((sense[2] & SENSE_TAPE_SYNC_MODE) ||
inhibit_cu_recovery) // data check is not permanent, may be // recovered. We always use async-mode with // cu-recovery, so this should *never* happen. return tape_34xx_erp_bug(device, request,
irb, -5);
// data check is permanent, cu-recovery has failed
dev_warn (&device->cdev->dev, "A write error on the " "tape cannot be recovered\n"); return tape_34xx_erp_failed(request, -EIO); case0x26: /* Data Check (read opposite) occurred. */ return tape_34xx_erp_read_opposite(device, request); case0x28: /* ID-Mark at tape start couldn't be written */
dev_warn (&device->cdev->dev, "Writing the ID-mark " "failed\n"); return tape_34xx_erp_failed(request, -EIO); case0x31: /* Tape void. Tried to read beyond end of device. */
dev_warn (&device->cdev->dev, "Reading the tape beyond" " the end of the recorded area failed\n"); return tape_34xx_erp_failed(request, -ENOSPC); case0x41: /* Record sequence error. */
dev_warn (&device->cdev->dev, "The tape contains an " "incorrect block ID sequence\n"); return tape_34xx_erp_failed(request, -EIO); default: /* all data checks for 3480 should result in one of *theaboveerpa-codes.For3490,otherdata-check
* conditions do exist. */ if (device->cdev->id.driver_info == tape_3480) return tape_34xx_erp_bug(device, request,
irb, -6);
}
}
if (sense[0] & SENSE_OVERRUN) return tape_34xx_erp_overrun(device, request, irb);
if (sense[1] & SENSE_RECORD_SEQUENCE_ERR) return tape_34xx_erp_sequence(device, request, irb);
/* Sensing erpa codes */ switch (sense[3]) { case0x00: /* Unit check with erpa code 0. Report and ignore. */ return TAPE_IO_SUCCESS; case0x21: /* *Datastreamingnotoperational.CUwillswitchto *interlockmode.Reissuethecommand.
*/ return tape_34xx_erp_retry(request); case0x22: /* *Pathequipmentcheck.Mightbedriveadaptererror,buffer *erroronthelowerinterface,internalpathnotusable, *orerrorduringcartridgeload.
*/
dev_warn (&device->cdev->dev, "A path equipment check occurred" " for the tape device\n"); return tape_34xx_erp_failed(request, -EIO); case0x24: /* *Loaddisplaycheck.Loaddisplaywascommandwasissued, *butthedriveisdisplayingadrivecheckmessage.Can *bethreatedas"deviceend".
*/ return tape_34xx_erp_succeeded(request); case0x27: /* *Commandreject.Mayindicateillegalchannelprogramor *bufferover/underrun.Sinceallchannelprogramsare *issuedbythisdriverandoughtbecorrect,weassumea *over/underrunsituationandretrythechannelprogram.
*/ return tape_34xx_erp_retry(request); case0x29: /* *Functionincompatible.Eitherthetapeisidrccompressed *butthehardwareisn'tcapabletodoidrc,oraperform *subsystemfuncisissuedandtheCUisnoton-line.
*/ return tape_34xx_erp_failed(request, -EIO); case0x2a: /* *Unsolicitedenvironmentaldata.Aninternalcounter *overflows,wecanignorethisandreissuethecmd.
*/ return tape_34xx_erp_retry(request); case0x2b: /* *Environmentaldatapresent.Indicateseitherunload *completedokorreadbufferedlogcommandcompletedok.
*/ if (request->op == TO_RUN) { /* Rewind unload completed ok. */
tape_med_state_set(device, MS_UNLOADED); return tape_34xx_erp_succeeded(request);
} /* tape_34xx doesn't use read buffered log commands. */ return tape_34xx_erp_bug(device, request, irb, sense[3]); case0x2c: /* *Permanentequipmentcheck.CUhastriedrecovery,but *didnotsucceed.
*/ return tape_34xx_erp_failed(request, -EIO); case0x2d: /* Data security erase failure. */ if (request->op == TO_DSE) return tape_34xx_erp_failed(request, -EIO); /* Data security erase failure, but no such command issued. */ return tape_34xx_erp_bug(device, request, irb, sense[3]); case0x2e: /* *Notcapable.Thisindicateseitherthatthedrivefails *readingtheformatidmarkorthatformatspecified *isnotsupportedbythedrive.
*/
dev_warn (&device->cdev->dev, "The tape unit cannot process " "the tape format\n"); return tape_34xx_erp_failed(request, -EMEDIUMTYPE); case0x30: /* The medium is write protected. */
dev_warn (&device->cdev->dev, "The tape medium is write-" "protected\n"); return tape_34xx_erp_failed(request, -EACCES); case0x32: // Tension loss. We cannot recover this, it's an I/O error.
dev_warn (&device->cdev->dev, "The tape does not have the " "required tape tension\n"); return tape_34xx_erp_failed(request, -EIO); case0x33: /* *LoadFailure.Thecartridgewasnotinsertedcorrectlyor *thetapeisnotthreadedcorrectly.
*/
dev_warn (&device->cdev->dev, "The tape unit failed to load" " the cartridge\n");
tape_34xx_delete_sbid_from(device, 0); return tape_34xx_erp_failed(request, -EIO); case0x34: /* *Unloadfailure.Thedrivecannotmaintaintapetension *andcontroltapemovementduringanunloadoperation.
*/
dev_warn (&device->cdev->dev, "Automatic unloading of the tape" " cartridge failed\n"); if (request->op == TO_RUN) return tape_34xx_erp_failed(request, -EIO); return tape_34xx_erp_bug(device, request, irb, sense[3]); case0x35: /* *Driveequipmentcheck.Oneofthefollowing: *-cucannotrecoverfromadrivedetectederror *-acheckcodemessageisshownondrivedisplay *-thecartridgeloaderdoesnotrespondcorrectly *-afailureoccursduringanindex,load,orunloadcycle
*/
dev_warn (&device->cdev->dev, "An equipment check has occurred" " on the tape unit\n"); return tape_34xx_erp_failed(request, -EIO); case0x36: if (device->cdev->id.driver_info == tape_3490) /* End of data. */ return tape_34xx_erp_failed(request, -EIO); /* This erpa is reserved for 3480 */ return tape_34xx_erp_bug(device, request, irb, sense[3]); case0x37: /* *Tapelengtherror.Thetapeisshorterthanreportedin *thebeginning-of-tapedata.
*/
dev_warn (&device->cdev->dev, "The tape information states an" " incorrect length\n"); return tape_34xx_erp_failed(request, -EIO); case0x38: /* *Physicalendoftape.Aread/writeoperationreached *thephysicalendoftape.
*/ if (request->op==TO_WRI ||
request->op==TO_DSE ||
request->op==TO_WTM) return tape_34xx_erp_failed(request, -ENOSPC); return tape_34xx_erp_failed(request, -EIO); case0x39: /* Backward at Beginning of tape. */ return tape_34xx_erp_failed(request, -EIO); case0x3a: /* Drive switched to not ready. */
dev_warn (&device->cdev->dev, "The tape unit is not ready\n"); return tape_34xx_erp_failed(request, -EIO); case0x3b: /* Manual rewind or unload. This causes an I/O error. */
dev_warn (&device->cdev->dev, "The tape medium has been " "rewound or unloaded manually\n");
tape_34xx_delete_sbid_from(device, 0); return tape_34xx_erp_failed(request, -EIO); case0x42: /* *Degradedmode.Aconditionthatcancausedegraded *performanceisdetected.
*/
dev_warn (&device->cdev->dev, "The tape subsystem is running " "in degraded mode\n"); return tape_34xx_erp_retry(request); case0x43: /* Drive not ready. */
tape_34xx_delete_sbid_from(device, 0);
tape_med_state_set(device, MS_UNLOADED); /* Some commands commands are successful even in this case */ if (sense[1] & SENSE_DRIVE_ONLINE) { switch(request->op) { case TO_ASSIGN: case TO_UNASSIGN: case TO_DIS: case TO_NOP: return tape_34xx_done(request); break; default: break;
}
} return tape_34xx_erp_failed(request, -ENOMEDIUM); case0x44: /* Locate Block unsuccessful. */ if (request->op != TO_BLOCK && request->op != TO_LBL) /* No locate block was issued. */ return tape_34xx_erp_bug(device, request,
irb, sense[3]); return tape_34xx_erp_failed(request, -EIO); case0x45: /* The drive is assigned to a different channel path. */
dev_warn (&device->cdev->dev, "The tape unit is already " "assigned\n"); return tape_34xx_erp_failed(request, -EIO); case0x46: /* *Drivenoton-line.Drivemaybeswitchedoffline, *thepowersupplymaybeswitchedoffor *thedriveaddressmaynotbesetcorrectly.
*/
dev_warn (&device->cdev->dev, "The tape unit is not online\n"); return tape_34xx_erp_failed(request, -EIO); case0x47: /* Volume fenced. CU reports volume integrity is lost. */
dev_warn (&device->cdev->dev, "The control unit has fenced " "access to the tape volume\n");
tape_34xx_delete_sbid_from(device, 0); return tape_34xx_erp_failed(request, -EIO); case0x48: /* Log sense data and retry request. */ return tape_34xx_erp_retry(request); case0x49: /* Bus out check. A parity check error on the bus was found. */
dev_warn (&device->cdev->dev, "A parity error occurred on the " "tape bus\n"); return tape_34xx_erp_failed(request, -EIO); case0x4a: /* Control unit erp failed. */
dev_warn (&device->cdev->dev, "I/O error recovery failed on " "the tape control unit\n"); return tape_34xx_erp_failed(request, -EIO); case0x4b: /* *CUanddriveincompatible.Thedriverequestsmicro-program *patches,whicharenotavailableontheCU.
*/
dev_warn (&device->cdev->dev, "The tape unit requires a " "firmware update\n"); return tape_34xx_erp_failed(request, -EIO); case0x4c: /* *RecoveredCheck-Onefailure.Cudevelopsahardwareerror, *butisabletorecover.
*/ return tape_34xx_erp_retry(request); case0x4d: if (device->cdev->id.driver_info == tape_3490) /* *Resettingeventreceived.Sincethedriverdoes *notsupportresettingeventrecovery(whichhasto *behandledbytheI/OLayer),retryourcommand.
*/ return tape_34xx_erp_retry(request); /* This erpa is reserved for 3480. */ return tape_34xx_erp_bug(device, request, irb, sense[3]); case0x4e: if (device->cdev->id.driver_info == tape_3490) { /* *Maximumblocksizeexceeded.Thisindicates,that *theblocktobewrittenislargerthanallowedfor *bufferedmode.
*/
dev_warn (&device->cdev->dev, "The maximum block size" " for buffered mode is exceeded\n"); return tape_34xx_erp_failed(request, -ENOBUFS);
} /* This erpa is reserved for 3480. */ return tape_34xx_erp_bug(device, request, irb, sense[3]); case0x50: /* *Readbufferedlog(Overflow).CUisrunninginextended *bufferedlogmode,andacounteroverflows.Thisshould *neverhappen,sincewe'reneverrunninginextended *bufferedlogmode.
*/ return tape_34xx_erp_retry(request); case0x51: /* *Readbufferedlog(EOV).EOFprocessingoccurswhilethe *CUisinextendedbufferedlogmode.Thisshouldnever *happen,sincewe'reneverrunninginextendedbuffered *logmode.
*/ return tape_34xx_erp_retry(request); case0x52: /* End of Volume complete. Rewind unload completed ok. */ if (request->op == TO_RUN) {
tape_med_state_set(device, MS_UNLOADED);
tape_34xx_delete_sbid_from(device, 0); return tape_34xx_erp_succeeded(request);
} return tape_34xx_erp_bug(device, request, irb, sense[3]); case0x53: /* Global command intercept. */ return tape_34xx_erp_retry(request); case0x54: /* Channel interface recovery (temporary). */ return tape_34xx_erp_retry(request); case0x55: /* Channel interface recovery (permanent). */
dev_warn (&device->cdev->dev, "A channel interface error cannot be" " recovered\n"); return tape_34xx_erp_failed(request, -EIO); case0x56: /* Channel protocol error. */
dev_warn (&device->cdev->dev, "A channel protocol error " "occurred\n"); return tape_34xx_erp_failed(request, -EIO); case0x57: /* *3480:Attentionintercept. *3490:Globalstatusintercept.
*/ return tape_34xx_erp_retry(request); case0x5a: /* *Tapelengthincompatible.Thetapeinsertedistoolong, *whichcouldcausedamagetothetapeorthedrive.
*/
dev_warn (&device->cdev->dev, "The tape unit does not support " "the tape length\n"); return tape_34xx_erp_failed(request, -EIO); case0x5b: /* Format 3480 XF incompatible */ if (sense[1] & SENSE_BEGINNING_OF_TAPE) /* The tape will get overwritten. */ return tape_34xx_erp_retry(request);
dev_warn (&device->cdev->dev, "The tape unit does not support" " format 3480 XF\n"); return tape_34xx_erp_failed(request, -EIO); case0x5c: /* Format 3480-2 XF incompatible */
dev_warn (&device->cdev->dev, "The tape unit does not support tape " "format 3480-2 XF\n"); return tape_34xx_erp_failed(request, -EIO); case0x5d: /* Tape length violation. */
dev_warn (&device->cdev->dev, "The tape unit does not support" " the current tape length\n"); return tape_34xx_erp_failed(request, -EMEDIUMTYPE); case0x5e: /* Compaction algorithm incompatible. */
dev_warn (&device->cdev->dev, "The tape unit does not support" " the compaction algorithm\n"); return tape_34xx_erp_failed(request, -EMEDIUMTYPE);
/* The following erpas should have been covered earlier. */ case0x23: /* Read data check. */ case0x25: /* Write data check. */ case0x26: /* Data check (read opposite). */ case0x28: /* Write id mark check. */ case0x31: /* Tape void. */ case0x40: /* Overrun error. */ case0x41: /* Record sequence error. */ /* All other erpas are reserved for future use. */ default: return tape_34xx_erp_bug(device, request, irb, sense[3]);
}
}
/* Sort in according to logical block number. */ if (bid.block < sbid->bid.block) {
tape_34xx_append_new_sbid(bid, l->prev); break;
}
} /* List empty or new block bigger than last entry. */ if (l == sbid_list)
tape_34xx_append_new_sbid(bid, l->prev);
MODULE_DEVICE_TABLE(ccw, tape_34xx_ids);
MODULE_AUTHOR("(C) 2001-2002 IBM Deutschland Entwicklung GmbH");
MODULE_DESCRIPTION("Linux on zSeries channel attached 3480 tape device driver");
MODULE_LICENSE("GPL");
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.105Bemerkung:
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.