[ide] make sure we are looking at the low bits post error

From: Brett Russ <russb@emc.com>

The following code needs to be added to ide_end_drive_cmd(),
since ide_error() calls ide_end_drive_cmd() after ide_dump_status()
has left the registers pointing at the high order part of the LBA.
Using the taskfile ioctl will then lead to hobRegister[] and
subsequently hob_ports[] being loaded with the wrong values.
Signed-off-by: default avatarBartlomiej Zolnierkiewicz <bzolnier@elka.pw.edu.pl>
parent a6a074b9
...@@ -384,6 +384,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err) ...@@ -384,6 +384,8 @@ void ide_end_drive_cmd (ide_drive_t *drive, u8 stat, u8 err)
args->hobRegister[IDE_DATA_OFFSET] = (data >> 8) & 0xFF; args->hobRegister[IDE_DATA_OFFSET] = (data >> 8) & 0xFF;
} }
args->tfRegister[IDE_ERROR_OFFSET] = err; args->tfRegister[IDE_ERROR_OFFSET] = err;
/* be sure we're looking at the low order bits */
hwif->OUTB(drive->ctl & ~0x80, IDE_CONTROL_REG);
args->tfRegister[IDE_NSECTOR_OFFSET] = hwif->INB(IDE_NSECTOR_REG); args->tfRegister[IDE_NSECTOR_OFFSET] = hwif->INB(IDE_NSECTOR_REG);
args->tfRegister[IDE_SECTOR_OFFSET] = hwif->INB(IDE_SECTOR_REG); args->tfRegister[IDE_SECTOR_OFFSET] = hwif->INB(IDE_SECTOR_REG);
args->tfRegister[IDE_LCYL_OFFSET] = hwif->INB(IDE_LCYL_REG); args->tfRegister[IDE_LCYL_OFFSET] = hwif->INB(IDE_LCYL_REG);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment