Lines Matching refs:rq
7 static ide_startstop_t ide_ata_error(ide_drive_t *drive, struct request *rq, in ide_ata_error() argument
15 rq->errors |= ERROR_RESET; in ide_ata_error()
28 rq->errors = ERROR_MAX; in ide_ata_error()
31 rq->errors |= ERROR_RECAL; in ide_ata_error()
35 if ((stat & ATA_DRQ) && rq_data_dir(rq) == READ && in ide_ata_error()
42 if (rq->errors >= ERROR_MAX || blk_noretry_request(rq)) { in ide_ata_error()
43 ide_kill_rq(drive, rq); in ide_ata_error()
48 rq->errors |= ERROR_RESET; in ide_ata_error()
50 if ((rq->errors & ERROR_RESET) == ERROR_RESET) { in ide_ata_error()
51 ++rq->errors; in ide_ata_error()
55 if ((rq->errors & ERROR_RECAL) == ERROR_RECAL) in ide_ata_error()
58 ++rq->errors; in ide_ata_error()
63 static ide_startstop_t ide_atapi_error(ide_drive_t *drive, struct request *rq, in ide_atapi_error() argument
71 rq->errors |= ERROR_RESET; in ide_atapi_error()
80 if (rq->errors >= ERROR_MAX) { in ide_atapi_error()
81 ide_kill_rq(drive, rq); in ide_atapi_error()
83 if ((rq->errors & ERROR_RESET) == ERROR_RESET) { in ide_atapi_error()
84 ++rq->errors; in ide_atapi_error()
87 ++rq->errors; in ide_atapi_error()
93 static ide_startstop_t __ide_error(ide_drive_t *drive, struct request *rq, in __ide_error() argument
97 return ide_ata_error(drive, rq, stat, err); in __ide_error()
98 return ide_atapi_error(drive, rq, stat, err); in __ide_error()
116 struct request *rq; in ide_error() local
121 rq = drive->hwif->rq; in ide_error()
122 if (rq == NULL) in ide_error()
126 if (rq->cmd_type != REQ_TYPE_FS) { in ide_error()
127 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) { in ide_error()
128 struct ide_cmd *cmd = rq->special; in ide_error()
132 } else if (ata_pm_request(rq)) { in ide_error()
133 rq->errors = 1; in ide_error()
134 ide_complete_pm_rq(drive, rq); in ide_error()
137 rq->errors = err; in ide_error()
138 ide_complete_rq(drive, err ? -EIO : 0, blk_rq_bytes(rq)); in ide_error()
142 return __ide_error(drive, rq, stat, err); in ide_error()
148 struct request *rq = drive->hwif->rq; in ide_complete_drive_reset() local
150 if (rq && rq->cmd_type == REQ_TYPE_DRV_PRIV && in ide_complete_drive_reset()
151 rq->cmd[0] == REQ_DRIVE_RESET) { in ide_complete_drive_reset()
152 if (err <= 0 && rq->errors == 0) in ide_complete_drive_reset()
153 rq->errors = -EIO; in ide_complete_drive_reset()
154 ide_complete_rq(drive, err ? err : 0, blk_rq_bytes(rq)); in ide_complete_drive_reset()