Skip to content

Commit

Permalink
ide-disk: fix taskfile registers loading order in __ide_do_rw_disk()
Browse files Browse the repository at this point in the history
Load IDE_SECTOR_REG after IDE_FEATURE_REG and IDE_NSECTOR_REG when using CHS.

This patch is basically a preparation for the next one which converts
__ide_do_rw_disk() to use struct ide_taskfile.

It shouldn't affect anything (just a usual paranoia to separate changes
which change the way in which hardware is accessed from code cleanups).

Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jan 25, 2008
1 parent 7a3b751 commit d00e42d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@ static ide_startstop_t __ide_do_rw_disk(ide_drive_t *drive, struct request *rq,
unsigned int sect,head,cyl,track;
track = (int)block / drive->sect;
sect = (int)block % drive->sect + 1;
hwif->OUTB(sect, IDE_SECTOR_REG);
head = track % drive->head;
cyl = track / drive->head;

pr_debug("%s: CHS=%u/%u/%u\n", drive->name, cyl, head, sect);

hwif->OUTB(0x00, IDE_FEATURE_REG);
hwif->OUTB(nsectors.b.low, IDE_NSECTOR_REG);
hwif->OUTB(sect, IDE_SECTOR_REG);
hwif->OUTB(cyl, IDE_LCYL_REG);
hwif->OUTB(cyl>>8, IDE_HCYL_REG);
hwif->OUTB(head|drive->select.all,IDE_SELECT_REG);
Expand Down

0 comments on commit d00e42d

Please sign in to comment.