Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105037
b: refs/heads/master
c: 8fccf89
h: refs/heads/master
i:
  105035: 19ed31e
v: v3
  • Loading branch information
Borislav Petkov authored and Bartlomiej Zolnierkiewicz committed Jul 23, 2008
1 parent 6884bad commit f03867d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 08feacf3bcc20c33e6a2a91d85d8190dd219d967
refs/heads/master: 8fccf8995c6d462db50265a5f7fa9a288a5a4590
18 changes: 13 additions & 5 deletions trunk/drivers/ide/ide-atapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
void (*io_buffers)(ide_drive_t *, struct ide_atapi_pc *, unsigned, int))
{
ide_hwif_t *hwif = drive->hwif;
struct request *rq = hwif->hwgroup->rq;
const struct ide_tp_ops *tp_ops = hwif->tp_ops;
xfer_func_t *xferfunc;
unsigned int temp;
Expand Down Expand Up @@ -64,8 +65,9 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
local_irq_enable_in_hardirq();

if (drive->media == ide_tape && !scsi &&
(stat & ERR_STAT) && pc->c[0] == REQUEST_SENSE)
(stat & ERR_STAT) && rq->cmd[0] == REQUEST_SENSE)
stat &= ~ERR_STAT;

if ((stat & ERR_STAT) || (pc->flags & PC_FLAG_DMA_ERROR)) {
/* Error detected */
debug_log("%s: I/O error\n", drive->name);
Expand All @@ -76,16 +78,17 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
goto cmd_finished;
}

if (pc->c[0] == REQUEST_SENSE) {
if (rq->cmd[0] == REQUEST_SENSE) {
printk(KERN_ERR "%s: I/O error in request sense"
" command\n", drive->name);
return ide_do_reset(drive);
}

debug_log("[cmd %x]: check condition\n", pc->c[0]);
debug_log("[cmd %x]: check condition\n", rq->cmd[0]);

/* Retry operation */
retry_pc(drive);

/* queued, but not started */
return ide_stopped;
}
Expand All @@ -96,8 +99,10 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
dsc_handle(drive);
return ide_stopped;
}

/* Command finished - Call the callback function */
drive->pc_callback(drive);

return ide_stopped;
}

Expand All @@ -116,6 +121,7 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
printk(KERN_ERR "%s: CoD != 0 in %s\n", drive->name, __func__);
return ide_do_reset(drive);
}

if (((ireason & IO) == IO) == !!(pc->flags & PC_FLAG_WRITING)) {
/* Hopefully, we will never get here */
printk(KERN_ERR "%s: We wanted to %s, but the device wants us "
Expand All @@ -124,6 +130,7 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
(ireason & IO) ? "Read" : "Write");
return ide_do_reset(drive);
}

if (!(pc->flags & PC_FLAG_WRITING)) {
/* Reading - Check that we have enough space */
temp = pc->xferred + bcount;
Expand Down Expand Up @@ -174,7 +181,7 @@ ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc,
pc->cur_pos += bcount;

debug_log("[cmd %x] transferred %d bytes on that intr.\n",
pc->c[0], bcount);
rq->cmd[0], bcount);

/* And set the interrupt handler again */
ide_set_handler(drive, handler, timeout, expiry);
Expand Down Expand Up @@ -220,6 +227,7 @@ ide_startstop_t ide_transfer_pc(ide_drive_t *drive, struct ide_atapi_pc *pc,
ide_expiry_t *expiry)
{
ide_hwif_t *hwif = drive->hwif;
struct request *rq = hwif->hwgroup->rq;
ide_startstop_t startstop;
u8 ireason;

Expand Down Expand Up @@ -250,7 +258,7 @@ ide_startstop_t ide_transfer_pc(ide_drive_t *drive, struct ide_atapi_pc *pc,

/* Send the actual packet */
if ((pc->flags & PC_FLAG_ZIP_DRIVE) == 0)
hwif->tp_ops->output_data(drive, NULL, pc->c, 12);
hwif->tp_ops->output_data(drive, NULL, rq->cmd, 12);

return ide_started;
}
Expand Down

0 comments on commit f03867d

Please sign in to comment.