Re: [PATCH] timer: Handle decrements of PIT counter

2020-06-26 Thread Kevin O'Connor
On Fri, Jun 26, 2020 at 04:09:57PM +0300, Roman Bolshakov wrote: > On Tue, Jun 23, 2020 at 11:00:24PM -0400, Kevin O'Connor wrote: > > Good catch. Could we fix it using the patch below instead though? > > > > -Kevin > > > > > > --- a/src/hw/timer.c > > +++ b/src/hw/timer.c > > @@ -180,7 +180,7

Re: [PATCH] timer: Handle decrements of PIT counter

2020-06-26 Thread Roman Bolshakov
On Tue, Jun 23, 2020 at 11:00:24PM -0400, Kevin O'Connor wrote: > On Sat, Jun 13, 2020 at 02:19:12PM +0300, Roman Bolshakov wrote: > > There's a fallback to PIT if TSC is not present but it doesn't work > > properly. It prevents boot from floppy on isapc and 486 cpu [1][2]. > > > > SeaBIOS configu

Re: [PATCH] timer: Handle decrements of PIT counter

2020-06-23 Thread Kevin O'Connor
On Sat, Jun 13, 2020 at 02:19:12PM +0300, Roman Bolshakov wrote: > There's a fallback to PIT if TSC is not present but it doesn't work > properly. It prevents boot from floppy on isapc and 486 cpu [1][2]. > > SeaBIOS configures PIT in Mode 2. PIT counter is decremented in the mode > but timer_adju

[PATCH] timer: Handle decrements of PIT counter

2020-06-13 Thread Roman Bolshakov
There's a fallback to PIT if TSC is not present but it doesn't work properly. It prevents boot from floppy on isapc and 486 cpu [1][2]. SeaBIOS configures PIT in Mode 2. PIT counter is decremented in the mode but timer_adjust_bits() thinks that the counter overflows and increases 32-bit tick count