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>
This commit is contained in:
parent
f6e29e35cc
commit
d32444771b
2 changed files with 16 additions and 11 deletions
|
@ -160,9 +160,9 @@ EXPORT_SYMBOL(default_hwif_mmiops);
|
||||||
|
|
||||||
u32 ide_read_24 (ide_drive_t *drive)
|
u32 ide_read_24 (ide_drive_t *drive)
|
||||||
{
|
{
|
||||||
u8 hcyl = HWIF(drive)->INB(IDE_HCYL_REG);
|
|
||||||
u8 lcyl = HWIF(drive)->INB(IDE_LCYL_REG);
|
|
||||||
u8 sect = HWIF(drive)->INB(IDE_SECTOR_REG);
|
u8 sect = HWIF(drive)->INB(IDE_SECTOR_REG);
|
||||||
|
u8 lcyl = HWIF(drive)->INB(IDE_LCYL_REG);
|
||||||
|
u8 hcyl = HWIF(drive)->INB(IDE_HCYL_REG);
|
||||||
return (hcyl<<16)|(lcyl<<8)|sect;
|
return (hcyl<<16)|(lcyl<<8)|sect;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -524,19 +524,24 @@ static u8 ide_dump_ata_status(ide_drive_t *drive, const char *msg, u8 stat)
|
||||||
(unsigned long long) sectors,
|
(unsigned long long) sectors,
|
||||||
high, low);
|
high, low);
|
||||||
} else {
|
} else {
|
||||||
u8 cur = hwif->INB(IDE_SELECT_REG);
|
u8 sector, lcyl, hcyl, cur;
|
||||||
|
|
||||||
|
sector = hwif->INB(IDE_SECTOR_REG);
|
||||||
|
lcyl = hwif->INB(IDE_LCYL_REG);
|
||||||
|
hcyl = hwif->INB(IDE_HCYL_REG);
|
||||||
|
cur = hwif->INB(IDE_SELECT_REG);
|
||||||
|
|
||||||
if (cur & 0x40) { /* using LBA? */
|
if (cur & 0x40) { /* using LBA? */
|
||||||
printk(", LBAsect=%ld", (unsigned long)
|
printk(", LBAsect=%ld", (unsigned long)
|
||||||
((cur&0xf)<<24)
|
((cur & 0xf) << 24) |
|
||||||
|(hwif->INB(IDE_HCYL_REG)<<16)
|
(hcyl << 16) |
|
||||||
|(hwif->INB(IDE_LCYL_REG)<<8)
|
(lcyl << 8) |
|
||||||
| hwif->INB(IDE_SECTOR_REG));
|
sector);
|
||||||
} else {
|
} else {
|
||||||
printk(", CHS=%d/%d/%d",
|
printk(", CHS=%d/%d/%d",
|
||||||
(hwif->INB(IDE_HCYL_REG)<<8) +
|
(hcyl << 8) + lcyl,
|
||||||
hwif->INB(IDE_LCYL_REG),
|
cur & 0xf,
|
||||||
cur & 0xf,
|
sector);
|
||||||
hwif->INB(IDE_SECTOR_REG));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (HWGROUP(drive) && HWGROUP(drive)->rq)
|
if (HWGROUP(drive) && HWGROUP(drive)->rq)
|
||||||
|
|
Loading…
Add table
Reference in a new issue