i386: fix TSC calibration using PIT

Condition was accidentally reversed, so PIT calibration always failed
when PIT was present and always succeeded when PIT was missing, but in
the latter case resulted in absurdly fast clock.

Reported and tested by Vitaly Kuznetsov <vkuznets@redhat.com>
This commit is contained in:
Michael Chang 2015-12-01 18:49:38 +03:00 committed by Andrei Borzenkov
parent 346a494d7c
commit a03c1034f6

View file

@ -49,7 +49,7 @@ grub_pit_wait (void)
| GRUB_PIT_SPK_TMR2,
GRUB_PIT_SPEAKER_PORT);
if ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH)) {
if ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH) == 0x00) {
ret = 1;
/* Wait. */
while ((grub_inb (GRUB_PIT_SPEAKER_PORT) & GRUB_PIT_SPK_TMR2_LATCH) == 0x00);