2 #include <linux/kernel.h>
3 #include <linux/export.h>
42 if (rq->errors >=
ERROR_MAX || blk_noretry_request(rq)) {
68 if ((stat & ATA_BUSY) ||
97 return ide_ata_error(drive, rq, stat, err);
98 return ide_atapi_error(drive, rq, stat, err);
121 rq = drive->
hwif->rq;
126 if (rq->cmd_type != REQ_TYPE_FS) {
127 if (rq->cmd_type == REQ_TYPE_ATA_TASKFILE) {
132 }
else if (blk_pm_request(rq)) {
142 return __ide_error(drive, rq, stat, err);
146 static inline void ide_complete_drive_reset(
ide_drive_t *drive,
int err)
150 if (rq && rq->cmd_type == REQ_TYPE_SPECIAL &&
152 if (err <= 0 && rq->
errors == 0)
177 if (
OK_STAT(stat, 0, ATA_BUSY))
190 return do_reset1(drive, 1);
194 ide_complete_drive_reset(drive, 0);
198 static void ide_reset_report_error(
ide_hwif_t *hwif,
u8 err)
200 static const char *err_master_vals[] =
201 {
NULL,
"passed",
"formatter device error",
202 "sector buffer error",
"ECC circuitry error",
203 "controlling MPU error" };
205 u8 err_master = err & 0x7f;
208 if (err_master && err_master < 6)
239 tmp = hwif->
tp_ops->read_status(hwif);
241 if (!
OK_STAT(tmp, 0, ATA_BUSY)) {
258 ide_reset_report_error(hwif, tmp);
265 ide_complete_drive_reset(drive, err);
292 ide_disk_pre_reset(drive);
360 spin_unlock_irqrestore(&hwif->
lock, flags);
373 timeout = tdrive->
sleep;
380 spin_unlock_irqrestore(&hwif->
lock, flags);
393 if (io_ports->ctl_addr == 0) {
394 spin_unlock_irqrestore(&hwif->
lock, flags);
395 ide_complete_drive_reset(drive, -
ENXIO);
430 spin_unlock_irqrestore(&hwif->
lock, flags);
440 return do_reset1(drive, 0);