diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-25 16:17:17 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2008-01-25 16:17:17 -0500 |
commit | d32444771b154c3ec37ebf6439004653560c2411 (patch) | |
tree | 953c1a943c6e0fa44898f5ba5ca1c45e65c2ae1c /drivers/ide/ide-lib.c | |
parent | f6e29e35cc0f9facf2eb0b0454f9b09021b5aa6f (diff) |
ide: fix registers loading order in ide_dump_ata_status()
Fix registers loading order in ide_dump_ata_status()/ide_read_24().
Load registers in this order:
* IDE_SECTOR_REG
* IDE_LCYL_REG
* IDE_HCYL_REG
* IDE_SELECT_REG
It shouldn't affect anything (just a usual paranoia to separate changes
which change the way in which hardware is accessed from code cleanups).
Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-lib.c')
-rw-r--r-- | drivers/ide/ide-lib.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/drivers/ide/ide-lib.c b/drivers/ide/ide-lib.c index 562f5efae9c6..001085845a79 100644 --- a/drivers/ide/ide-lib.c +++ b/drivers/ide/ide-lib.c | |||
@@ -524,19 +524,24 @@ static u8 ide_dump_ata_status(ide_drive_t *drive, const char *msg, u8 stat) | |||
524 | (unsigned long long) sectors, | 524 | (unsigned long long) sectors, |
525 | high, low); | 525 | high, low); |
526 | } else { | 526 | } else { |
527 | u8 cur = hwif->INB(IDE_SELECT_REG); | 527 | u8 sector, lcyl, hcyl, cur; |
528 | |||
529 | sector = hwif->INB(IDE_SECTOR_REG); | ||
530 | lcyl = hwif->INB(IDE_LCYL_REG); | ||
531 | hcyl = hwif->INB(IDE_HCYL_REG); | ||
532 | cur = hwif->INB(IDE_SELECT_REG); | ||
533 | |||
528 | if (cur & 0x40) { /* using LBA? */ | 534 | if (cur & 0x40) { /* using LBA? */ |
529 | printk(", LBAsect=%ld", (unsigned long) | 535 | printk(", LBAsect=%ld", (unsigned long) |
530 | ((cur&0xf)<<24) | 536 | ((cur & 0xf) << 24) | |
531 | |(hwif->INB(IDE_HCYL_REG)<<16) | 537 | (hcyl << 16) | |
532 | |(hwif->INB(IDE_LCYL_REG)<<8) | 538 | (lcyl << 8) | |
533 | | hwif->INB(IDE_SECTOR_REG)); | 539 | sector); |
534 | } else { | 540 | } else { |
535 | printk(", CHS=%d/%d/%d", | 541 | printk(", CHS=%d/%d/%d", |
536 | (hwif->INB(IDE_HCYL_REG)<<8) + | 542 | (hcyl << 8) + lcyl, |
537 | hwif->INB(IDE_LCYL_REG), | 543 | cur & 0xf, |
538 | cur & 0xf, | 544 | sector); |
539 | hwif->INB(IDE_SECTOR_REG)); | ||
540 | } | 545 | } |
541 | } | 546 | } |
542 | if (HWGROUP(drive) && HWGROUP(drive)->rq) | 547 | if (HWGROUP(drive) && HWGROUP(drive)->rq) |