* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1)
@ 2005-06-02 18:27 Parag Warudkar
2005-06-02 18:39 ` Nishanth Aravamudan
2005-06-02 18:40 ` john stultz
0 siblings, 2 replies; 42+ messages in thread
From: Parag Warudkar @ 2005-06-02 18:27 UTC (permalink / raw)
To: john stultz
Cc: Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert,
Ulrich Windl, Christoph Lameter, Dominik Brodowski,
David Mosberger, Andrew Morton, paulus, schwidefsky,
keith maanthey, Chris McDermott, Max Asbock, mahuja,
Nishanth Aravamudan, Darren Hart, Darrick J. Wong,
Anton Blanchard, donf, mpm, benh
> If you grab Linus' current tree it should apply.
>
> Sorry about the confusion.
> -john
I ignored the reject since it was from an #include section - the build went fine. I am even able to use it successfully. Couple things -
Very happy to report that I no longer get those annoying - "losing some ticks ..." "your time source is unreliable or some driver is hogging interrupts" messages - Not sure what change in TOD subsystem cured it - or was it just the removal of the printk? ;)
Sadly, it somehow feels noticeably slower than vanilla 2.6.12-rc5. Especially using X/KDE - It is surely usable but not snappy. I will do more research to find out exactly why - but before that is such as loss of snappiness possible due to the TOD changes?
Thanks
Parag
^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-02 18:27 [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) Parag Warudkar @ 2005-06-02 18:39 ` Nishanth Aravamudan 2005-06-02 23:05 ` Parag Warudkar 2005-06-02 18:40 ` john stultz 1 sibling, 1 reply; 42+ messages in thread From: Nishanth Aravamudan @ 2005-06-02 18:39 UTC (permalink / raw) To: Parag Warudkar Cc: john stultz, Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On 02.06.2005 [18:27:51 +0000], Parag Warudkar wrote: > > If you grab Linus' current tree it should apply. > > > > Sorry about the confusion. > > -john > > I ignored the reject since it was from an #include section - the build > went fine. I am even able to use it successfully. Couple things - > > Very happy to report that I no longer get those annoying - "losing > some ticks ..." "your time source is unreliable or some driver is > hogging interrupts" messages - Not sure what change in TOD subsystem > cured it - or was it just the removal of the printk? ;) > > Sadly, it somehow feels noticeably slower than vanilla 2.6.12-rc5. > Especially using X/KDE - It is surely usable but not snappy. I will do > more research to find out exactly why - but before that is such as > loss of snappiness possible due to the TOD changes? Which timesource is being used? cat /sys/devices/system/timesource/timesource0/timesource Thanks, Nish ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-02 18:39 ` Nishanth Aravamudan @ 2005-06-02 23:05 ` Parag Warudkar 2005-06-02 23:20 ` john stultz 0 siblings, 1 reply; 42+ messages in thread From: Parag Warudkar @ 2005-06-02 23:05 UTC (permalink / raw) To: Nishanth Aravamudan Cc: john stultz, Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Thursday 02 June 2005 14:39, Nishanth Aravamudan wrote: > Which timesource is being used? > > cat /sys/devices/system/timesource/timesource0/timesource tux-gentoo parag # cat /sys/devices/system/timesource/timesource0/timesource jiffies tsc tsc-interp *acpi_pm I am not attaching the dmesg output as it is fairly big and the only relevant line seems to be Jun 1 20:56:18 tux-gentoo [ 20.302560] Time: acpi_pm timesource has been installed. Parag -- Q: Would you like to see the WINE list? A: What's on it, anything expensive? Q: No, just Solitaire and MineSweeper for now, but the WINE is free. -- Kevin M. Bealer, about the WINdows Emulator ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-02 23:05 ` Parag Warudkar @ 2005-06-02 23:20 ` john stultz 2005-06-02 23:33 ` Parag Warudkar ` (2 more replies) 0 siblings, 3 replies; 42+ messages in thread From: john stultz @ 2005-06-02 23:20 UTC (permalink / raw) To: Parag Warudkar Cc: Nishanth Aravamudan, Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Thu, 2005-06-02 at 19:05 -0400, Parag Warudkar wrote: > On Thursday 02 June 2005 14:39, Nishanth Aravamudan wrote: > > Which timesource is being used? > > > > cat /sys/devices/system/timesource/timesource0/timesource > > tux-gentoo parag # cat /sys/devices/system/timesource/timesource0/timesource > jiffies tsc tsc-interp *acpi_pm You can change the timesource at runtime by doing something like: echo "tsc" > /sys/devices/system/timesource/timesource0/timesource The "*" denotes the current timesource, so you'll see it move the next time you cat the timesource sysfs file. Could you see if the slowness you're feeling is correlated to the acpi_pm timesource? It is quite a bit slower to access then the TSC, but I'd be surprised if you can actually feel the difference. This is on an x86-64 system, correct? thanks -john ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-02 23:20 ` john stultz @ 2005-06-02 23:33 ` Parag Warudkar 2005-06-02 23:50 ` Parag Warudkar 2005-06-03 13:32 ` Parag Warudkar 2 siblings, 0 replies; 42+ messages in thread From: Parag Warudkar @ 2005-06-02 23:33 UTC (permalink / raw) To: john stultz Cc: Nishanth Aravamudan, Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Thursday 02 June 2005 19:20, john stultz wrote: > Could you see if the slowness you're feeling is correlated to the > acpi_pm timesource? It is quite a bit slower to access then the TSC, but > I'd be surprised if you can actually feel the difference. Will try that. > > This is on an x86-64 system, correct? Yes, correct. Parag -- It is exactly because a man cannot do a thing that he is a proper judge of it. -- Oscar Wilde ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-02 23:20 ` john stultz 2005-06-02 23:33 ` Parag Warudkar @ 2005-06-02 23:50 ` Parag Warudkar 2005-06-03 7:05 ` Ulrich Windl ` (2 more replies) 2005-06-03 13:32 ` Parag Warudkar 2 siblings, 3 replies; 42+ messages in thread From: Parag Warudkar @ 2005-06-02 23:50 UTC (permalink / raw) To: john stultz Cc: Nishanth Aravamudan, Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Thursday 02 June 2005 19:20, john stultz wrote: > Could you see if the slowness you're feeling is correlated to the > acpi_pm timesource? Speaking of which, the below code from arch/i386/timer_pm.c looks particularly more taxing to me - 3 times read from ioport in a loop - not sure how many time that executes. static inline u32 read_pmtmr(void) { u32 v1=0,v2=0,v3=0; /* It has been reported that because of various broken * chipsets (ICH4, PIIX4 and PIIX4E) where the ACPI PM time * source is not latched, so you must read it multiple * times to insure a safe value is read. */ do { v1 = inl(pmtmr_ioport); v2 = inl(pmtmr_ioport); v3 = inl(pmtmr_ioport); } while ((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1) || (v3 > v1 && v3 < v2)); Shouldn't that loop be limited to the broken chipsets - why would correct people with correctly working chipsets carry this extra burden? (Or is it insignificant?) -- Because we don't think about future generations, they will never forget us. -- Henrik Tikkanen ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-02 23:50 ` Parag Warudkar @ 2005-06-03 7:05 ` Ulrich Windl 2005-06-03 15:24 ` john stultz 2005-06-03 16:30 ` Andi Kleen 2 siblings, 0 replies; 42+ messages in thread From: Ulrich Windl @ 2005-06-03 7:05 UTC (permalink / raw) To: Parag Warudkar Cc: Nishanth Aravamudan, Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh Possibly the code could auto-detect the brokenness during initialization by executing inl(pmtmr_ioport) a few hundred times and watch for monotony. Regards, Ulrich On 2 Jun 2005 at 19:50, Parag Warudkar wrote: > On Thursday 02 June 2005 19:20, john stultz wrote: > > Could you see if the slowness you're feeling is correlated to the > > acpi_pm timesource? > > Speaking of which, the below code from arch/i386/timer_pm.c looks particularly > more taxing to me - 3 times read from ioport in a loop - not sure how many > time that executes. > > static inline u32 read_pmtmr(void) > { > u32 v1=0,v2=0,v3=0; > /* It has been reported that because of various broken > * chipsets (ICH4, PIIX4 and PIIX4E) where the ACPI PM time > * source is not latched, so you must read it multiple > * times to insure a safe value is read. > */ > do { > v1 = inl(pmtmr_ioport); > v2 = inl(pmtmr_ioport); > v3 = inl(pmtmr_ioport); > } while ((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1) > || (v3 > v1 && v3 < v2)); > > Shouldn't that loop be limited to the broken chipsets - why would correct > people with correctly working chipsets carry this extra burden? (Or is it > insignificant?) > > -- > Because we don't think about future generations, they will never forget us. > -- Henrik Tikkanen ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-02 23:50 ` Parag Warudkar 2005-06-03 7:05 ` Ulrich Windl @ 2005-06-03 15:24 ` john stultz 2005-06-05 17:05 ` Dominik Brodowski 2005-06-03 16:30 ` Andi Kleen 2 siblings, 1 reply; 42+ messages in thread From: john stultz @ 2005-06-03 15:24 UTC (permalink / raw) To: Parag Warudkar Cc: Nishanth Aravamudan, Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Thu, 2005-06-02 at 19:50 -0400, Parag Warudkar wrote: > On Thursday 02 June 2005 19:20, john stultz wrote: > > Could you see if the slowness you're feeling is correlated to the > > acpi_pm timesource? > > Speaking of which, the below code from arch/i386/timer_pm.c looks particularly > more taxing to me - 3 times read from ioport in a loop - not sure how many > time that executes. > > static inline u32 read_pmtmr(void) > { > u32 v1=0,v2=0,v3=0; > /* It has been reported that because of various broken > * chipsets (ICH4, PIIX4 and PIIX4E) where the ACPI PM time > * source is not latched, so you must read it multiple > * times to insure a safe value is read. > */ > do { > v1 = inl(pmtmr_ioport); > v2 = inl(pmtmr_ioport); > v3 = inl(pmtmr_ioport); > } while ((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1) > || (v3 > v1 && v3 < v2)); > > Shouldn't that loop be limited to the broken chipsets - why would correct > people with correctly working chipsets carry this extra burden? (Or is it > insignificant?) Yea, that would be nice to only do the triple read on the affected systems. Although outside of the comment I don't have any real data as to which system suffer from the issue. I'd have to defer to Dominik on this one. thanks -john ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-03 15:24 ` john stultz @ 2005-06-05 17:05 ` Dominik Brodowski 2005-06-06 3:04 ` Parag Warudkar ` (2 more replies) 0 siblings, 3 replies; 42+ messages in thread From: Dominik Brodowski @ 2005-06-05 17:05 UTC (permalink / raw) To: john stultz Cc: Parag Warudkar, Nishanth Aravamudan, Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Fri, Jun 03, 2005 at 08:24:35AM -0700, john stultz wrote: > On Thu, 2005-06-02 at 19:50 -0400, Parag Warudkar wrote: > > On Thursday 02 June 2005 19:20, john stultz wrote: > > > Could you see if the slowness you're feeling is correlated to the > > > acpi_pm timesource? > > > > Speaking of which, the below code from arch/i386/timer_pm.c looks particularly > > more taxing to me - 3 times read from ioport in a loop - not sure how many > > time that executes. > > > > static inline u32 read_pmtmr(void) > > { > > u32 v1=0,v2=0,v3=0; > > /* It has been reported that because of various broken > > * chipsets (ICH4, PIIX4 and PIIX4E) where the ACPI PM time > > * source is not latched, so you must read it multiple > > * times to insure a safe value is read. > > */ > > do { > > v1 = inl(pmtmr_ioport); > > v2 = inl(pmtmr_ioport); > > v3 = inl(pmtmr_ioport); > > } while ((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1) > > || (v3 > v1 && v3 < v2)); > > > > Shouldn't that loop be limited to the broken chipsets - why would correct > > people with correctly working chipsets carry this extra burden? (Or is it > > insignificant?) > > Yea, that would be nice to only do the triple read on the affected > systems. Although outside of the comment I don't have any real data as > to which system suffer from the issue. IIRC (from the comment above) several chipsets suffer from this inconsistency, namely the widely used PIIX4(E) and ICH(4 only? or also other ICH-ones?). Therefore, we'd need at least some sort of boot-time check to decide which method to use... and based on the method, we can adjust the priority maybe? Thanks, Dominik ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-05 17:05 ` Dominik Brodowski @ 2005-06-06 3:04 ` Parag Warudkar 2005-06-06 3:14 ` Dominik Brodowski 2005-06-10 0:48 ` George Anzinger 2005-06-06 9:21 ` Andi Kleen 2005-06-06 22:53 ` john stultz 2 siblings, 2 replies; 42+ messages in thread From: Parag Warudkar @ 2005-06-06 3:04 UTC (permalink / raw) To: Dominik Brodowski Cc: john stultz, Nishanth Aravamudan, Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh [-- Attachment #1: Type: text/plain, Size: 868 bytes --] On Sunday 05 June 2005 13:05, Dominik Brodowski wrote: > IIRC (from the comment above) several chipsets suffer from this > inconsistency, namely the widely used PIIX4(E) and ICH(4 only? or also > other ICH-ones?). Therefore, we'd need at least some sort of boot-time > check to decide which method to use... and based on the method, we can > adjust the priority maybe? To begin with, will the simple proof-of-concept patch like below work? (It tests the chipset read in the same do{}while loop - if the loop executes only once, it considers the chipset good - in which case it executes the faster read_pmtmr_fast function.) Or does it need wider testing under different circumstances to conclude that chipset is good? I tested the patch under Virtual PC which emulates a PIIX4 chipset. Test passes there, meaning the do {}while loop executes only once. Parag [-- Attachment #2: timer_pm.c.patch --] [-- Type: text/x-diff, Size: 3564 bytes --] --- linux-2.6-orig/arch/i386/kernel/timers/timer_pm.c 2005-03-02 02:37:48.000000000 -0500 +++ linux-2.6.12-rc5/arch/i386/kernel/timers/timer_pm.c 2005-06-05 23:01:15.000000000 -0400 @@ -35,6 +35,10 @@ * in arch/i386/acpi/boot.c */ u32 pmtmr_ioport = 0; +struct pmtmr_rd_func { + u32 (*read_pmtmr) (void); +}pmtmr_rd_func; + /* value of the Power timer at last timer interrupt */ static u32 offset_tick; @@ -45,6 +49,11 @@ #define ACPI_PM_MASK 0xFFFFFF /* limit it to 24 bits */ +static inline u32 read_pmtmr_fast(void) +{ + return inl(pmtmr_ioport); +} + /*helper function to safely read acpi pm timesource*/ static inline u32 read_pmtmr(void) { @@ -76,14 +85,14 @@ unsigned long count, delta; mach_prepare_counter(); - value1 = read_pmtmr(); + value1 = pmtmr_rd_func.read_pmtmr(); mach_countup(&count); - value2 = read_pmtmr(); + value2 = pmtmr_rd_func.read_pmtmr(); delta = (value2 - value1) & ACPI_PM_MASK; /* Check that the PMTMR delta is within 5% of what we expect */ - if (delta < (PMTMR_EXPECTED_RATE * 19) / 20 || - delta > (PMTMR_EXPECTED_RATE * 21) / 20) { + if (delta < (PMTMR_EXPECTED_RATE * 18) / 20 || + delta > (PMTMR_EXPECTED_RATE * 22) / 20) { printk(KERN_INFO "PM-Timer running at invalid rate: %lu%% of normal - aborting.\n", 100UL * delta / PMTMR_EXPECTED_RATE); return -1; } @@ -95,9 +104,16 @@ static int init_pmtmr(char* override) { u32 value1, value2; - unsigned int i; + u32 v1=0,v2=0,v3=0; + unsigned int i, loop_cnt=0; - if (override[0] && strncmp(override,"pmtmr",5)) + /* Use slower but probably more correct read function by + * default. This is overriden with a fast one if it is + * suitable to do so below. + */ + pmtmr_rd_func.read_pmtmr = read_pmtmr; + + if (override[0] && strncmp(override,"pmtmr",5)) return -ENODEV; if (!pmtmr_ioport) @@ -106,9 +122,32 @@ /* we use the TSC for delay_pmtmr, so make sure it exists */ if (!cpu_has_tsc) return -ENODEV; + /* It has been reported that because of various broken + * chipsets (ICH4, PIIX4 and PIIX4E) where the ACPI PM time + * source is not latched, so you must read it multiple + * times to insure a safe value is read. + */ + do { + v1 = inl(pmtmr_ioport); + v2 = inl(pmtmr_ioport); + v3 = inl(pmtmr_ioport); + loop_cnt++; + } while ((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1) + || (v3 > v1 && v3 < v2)); + + if(loop_cnt == 1) { + /*We have a good chipset*/ + printk(KERN_INFO "PM Timer: Chipset passes port read test\n"); + pmtmr_rd_func.read_pmtmr = read_pmtmr_fast; + } + + else { + printk(KERN_INFO "PM Timer: Chipset fails port read test:"); + printk(KERN_INFO "Working around it."); + } /* "verify" this timing source */ - value1 = read_pmtmr(); + value1 = pmtmr_rd_func.read_pmtmr(); for (i = 0; i < 10000; i++) { value2 = read_pmtmr(); if (value2 == value1) @@ -156,7 +195,7 @@ write_seqlock(&monotonic_lock); - offset_tick = read_pmtmr(); + offset_tick = pmtmr_rd_func.read_pmtmr(); /* calculate tick interval */ delta = (offset_tick - last_offset) & ACPI_PM_MASK; @@ -202,7 +241,7 @@ } while (read_seqretry(&monotonic_lock, seq)); /* Read the pmtmr */ - this_offset = read_pmtmr(); + this_offset = pmtmr_rd_func.read_pmtmr(); /* convert to nanoseconds */ ret = (this_offset - last_offset) & ACPI_PM_MASK; @@ -232,7 +271,7 @@ u32 now, offset, delta = 0; offset = offset_tick; - now = read_pmtmr(); + now = pmtmr_rd_func.read_pmtmr(); delta = (now - offset)&ACPI_PM_MASK; return (unsigned long) offset_delay + cyc2us(delta); ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-06 3:04 ` Parag Warudkar @ 2005-06-06 3:14 ` Dominik Brodowski 2005-06-10 0:48 ` George Anzinger 1 sibling, 0 replies; 42+ messages in thread From: Dominik Brodowski @ 2005-06-06 3:14 UTC (permalink / raw) To: Parag Warudkar Cc: john stultz, Nishanth Aravamudan, Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh Hi, On Sun, Jun 05, 2005 at 11:04:34PM -0400, Parag Warudkar wrote: > tests the chipset read in the same do{}while loop - if the loop executes only > once, it considers the chipset good - in which case it executes the faster > read_pmtmr_fast function.) Or does it need wider testing under different > circumstances to conclude that chipset is good? I fear that we need to run the loop a couple of times at least -- IIRC many accesses were correct, but some failed. Will investigate soon. > I tested the patch under Virtual PC which emulates a PIIX4 chipset. Test > passes there, meaning the do {}while loop executes only once. Possibly this is a bug-free emulation? Dominik ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-06 3:04 ` Parag Warudkar 2005-06-06 3:14 ` Dominik Brodowski @ 2005-06-10 0:48 ` George Anzinger 1 sibling, 0 replies; 42+ messages in thread From: George Anzinger @ 2005-06-10 0:48 UTC (permalink / raw) To: Parag Warudkar Cc: Dominik Brodowski, john stultz, Nishanth Aravamudan, Andi Kleen, lkml, Tim Schmielau, albert, Ulrich Windl, Christoph Lameter, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh Parag Warudkar wrote: > On Sunday 05 June 2005 13:05, Dominik Brodowski wrote: > >>IIRC (from the comment above) several chipsets suffer from this >>inconsistency, namely the widely used PIIX4(E) and ICH(4 only? or also >>other ICH-ones?). Therefore, we'd need at least some sort of boot-time >>check to decide which method to use... and based on the method, we can >>adjust the priority maybe? > > > To begin with, will the simple proof-of-concept patch like below work? (It > tests the chipset read in the same do{}while loop - if the loop executes only > once, it considers the chipset good - in which case it executes the faster > read_pmtmr_fast function.) Or does it need wider testing under different > circumstances to conclude that chipset is good? > > I tested the patch under Virtual PC which emulates a PIIX4 chipset. Test > passes there, meaning the do {}while loop executes only once. As I understand the problem it is that the counter is, sometimes, read while it is is rippling the carry up to the higher bits. This will only happen if the read is done just as the hardware is bumping the count and even then only if there is a carry. Exactly where in the carry sequency this happens is likely just a guess. In the HRT patch I take care of this by testing the read against a prior read (up to 1/HZ away). If the number is bigger and to too much bigger, I just do one read. Here is the full routine: quick_get_cpuctr(void) { static unsigned long last_read = 0; static int qgc_max = 0; int i; unsigned long rd_delta, rd_ans, rd = inl(acpi_pm_tmr_address); /* * This will be REALLY big if ever we move backward in time... */ rd_delta = (rd - last_read) & SIZE_MASK; last_read = rd; rd_ans = (rd - last_update) & SIZE_MASK; if (likely((rd_ans < (arch_cycles_per_jiffy << 1)) && (rd_delta < (arch_cycles_per_jiffy << 1)))) return rd_ans; for (i = 0; i < 10; i++) { rd = inl(acpi_pm_tmr_address); rd_delta = (rd - last_read) & SIZE_MASK; last_read = rd; if (unlikely(i > qgc_max)) qgc_max = i; /* * On my test machine (800MHZ dual PIII) this is always * seven. Seems long, but we will give it some slack... * We note that rd_delta (and all the vars) unsigned so * a backward movement will show as a really big number. */ if (likely(rd_delta < 20)) return (rd - last_update) & SIZE_MASK; } return (rd - last_update) & SIZE_MASK; } George -- > > Parag > > > ------------------------------------------------------------------------ > > --- linux-2.6-orig/arch/i386/kernel/timers/timer_pm.c 2005-03-02 02:37:48.000000000 -0500 > +++ linux-2.6.12-rc5/arch/i386/kernel/timers/timer_pm.c 2005-06-05 23:01:15.000000000 -0400 > @@ -35,6 +35,10 @@ > * in arch/i386/acpi/boot.c */ > u32 pmtmr_ioport = 0; > > +struct pmtmr_rd_func { > + u32 (*read_pmtmr) (void); > +}pmtmr_rd_func; > + > > /* value of the Power timer at last timer interrupt */ > static u32 offset_tick; > @@ -45,6 +49,11 @@ > > #define ACPI_PM_MASK 0xFFFFFF /* limit it to 24 bits */ > > +static inline u32 read_pmtmr_fast(void) > +{ > + return inl(pmtmr_ioport); > +} > + > /*helper function to safely read acpi pm timesource*/ > static inline u32 read_pmtmr(void) > { > @@ -76,14 +85,14 @@ > unsigned long count, delta; > > mach_prepare_counter(); > - value1 = read_pmtmr(); > + value1 = pmtmr_rd_func.read_pmtmr(); > mach_countup(&count); > - value2 = read_pmtmr(); > + value2 = pmtmr_rd_func.read_pmtmr(); > delta = (value2 - value1) & ACPI_PM_MASK; > > /* Check that the PMTMR delta is within 5% of what we expect */ > - if (delta < (PMTMR_EXPECTED_RATE * 19) / 20 || > - delta > (PMTMR_EXPECTED_RATE * 21) / 20) { > + if (delta < (PMTMR_EXPECTED_RATE * 18) / 20 || > + delta > (PMTMR_EXPECTED_RATE * 22) / 20) { > printk(KERN_INFO "PM-Timer running at invalid rate: %lu%% of normal - aborting.\n", 100UL * delta / PMTMR_EXPECTED_RATE); > return -1; > } > @@ -95,9 +104,16 @@ > static int init_pmtmr(char* override) > { > u32 value1, value2; > - unsigned int i; > + u32 v1=0,v2=0,v3=0; > + unsigned int i, loop_cnt=0; > > - if (override[0] && strncmp(override,"pmtmr",5)) > + /* Use slower but probably more correct read function by > + * default. This is overriden with a fast one if it is > + * suitable to do so below. > + */ > + pmtmr_rd_func.read_pmtmr = read_pmtmr; > + > + if (override[0] && strncmp(override,"pmtmr",5)) > return -ENODEV; > > if (!pmtmr_ioport) > @@ -106,9 +122,32 @@ > /* we use the TSC for delay_pmtmr, so make sure it exists */ > if (!cpu_has_tsc) > return -ENODEV; > + /* It has been reported that because of various broken > + * chipsets (ICH4, PIIX4 and PIIX4E) where the ACPI PM time > + * source is not latched, so you must read it multiple > + * times to insure a safe value is read. > + */ > + do { > + v1 = inl(pmtmr_ioport); > + v2 = inl(pmtmr_ioport); > + v3 = inl(pmtmr_ioport); > + loop_cnt++; > + } while ((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1) > + || (v3 > v1 && v3 < v2)); > + > + if(loop_cnt == 1) { > + /*We have a good chipset*/ > + printk(KERN_INFO "PM Timer: Chipset passes port read test\n"); > + pmtmr_rd_func.read_pmtmr = read_pmtmr_fast; > + } > + > + else { > + printk(KERN_INFO "PM Timer: Chipset fails port read test:"); > + printk(KERN_INFO "Working around it."); > + } > > /* "verify" this timing source */ > - value1 = read_pmtmr(); > + value1 = pmtmr_rd_func.read_pmtmr(); > for (i = 0; i < 10000; i++) { > value2 = read_pmtmr(); > if (value2 == value1) > @@ -156,7 +195,7 @@ > > write_seqlock(&monotonic_lock); > > - offset_tick = read_pmtmr(); > + offset_tick = pmtmr_rd_func.read_pmtmr(); > > /* calculate tick interval */ > delta = (offset_tick - last_offset) & ACPI_PM_MASK; > @@ -202,7 +241,7 @@ > } while (read_seqretry(&monotonic_lock, seq)); > > /* Read the pmtmr */ > - this_offset = read_pmtmr(); > + this_offset = pmtmr_rd_func.read_pmtmr(); > > /* convert to nanoseconds */ > ret = (this_offset - last_offset) & ACPI_PM_MASK; > @@ -232,7 +271,7 @@ > u32 now, offset, delta = 0; > > offset = offset_tick; > - now = read_pmtmr(); > + now = pmtmr_rd_func.read_pmtmr(); > delta = (now - offset)&ACPI_PM_MASK; > > return (unsigned long) offset_delay + cyc2us(delta); -- George Anzinger george@mvista.com HRT (High-res-timers): http://sourceforge.net/projects/high-res-timers/ ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-05 17:05 ` Dominik Brodowski 2005-06-06 3:04 ` Parag Warudkar @ 2005-06-06 9:21 ` Andi Kleen 2005-06-06 9:24 ` Dominik Brodowski 2005-06-06 13:32 ` Vojtech Pavlik 2005-06-06 22:53 ` john stultz 2 siblings, 2 replies; 42+ messages in thread From: Andi Kleen @ 2005-06-06 9:21 UTC (permalink / raw) To: Dominik Brodowski, john stultz, Parag Warudkar, Nishanth Aravamudan, Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh > IIRC (from the comment above) several chipsets suffer from this > inconsistency, namely the widely used PIIX4(E) and ICH(4 only? or also other > ICH-ones?). Therefore, we'd need at least some sort of boot-time check to > decide which method to use... and based on the method, we can adjust the > priority maybe? At least on x86-64 there are no ICH4s or PIIX4Es. Actually I think there was one early prototype machine from Intel with ICH4, but I am willing to ignore these. So please dont do any such things on the x86-64 version. Also didnt ICH4 already have HPET? it might not be enabled on many boxes, but given the chip datasheet one can write enable code to fix that. -Andi ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-06 9:21 ` Andi Kleen @ 2005-06-06 9:24 ` Dominik Brodowski 2005-06-06 9:30 ` Andi Kleen 2005-06-06 13:32 ` Vojtech Pavlik 1 sibling, 1 reply; 42+ messages in thread From: Dominik Brodowski @ 2005-06-06 9:24 UTC (permalink / raw) To: Andi Kleen Cc: john stultz, Parag Warudkar, Nishanth Aravamudan, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Mon, Jun 06, 2005 at 11:21:59AM +0200, Andi Kleen wrote: > > IIRC (from the comment above) several chipsets suffer from this > > inconsistency, namely the widely used PIIX4(E) and ICH(4 only? or also other > > ICH-ones?). Therefore, we'd need at least some sort of boot-time check to > > decide which method to use... and based on the method, we can adjust the > > priority maybe? > > At least on x86-64 there are no ICH4s or PIIX4Es. Actually I think > there was one early prototype machine from Intel with ICH4, but I am willing > to ignore these. So please dont do any such things on the x86-64 version. > > Also didnt ICH4 already have HPET? it might not be enabled on many > boxes, but given the chip datasheet one can write enable code to > fix that. At least on my notebook, which has an ICH4-M, there is no HPET. AFAIK it resides on a separate chip which may or may not exist. I'd be glad if the opposite were true, though :) Dominik ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-06 9:24 ` Dominik Brodowski @ 2005-06-06 9:30 ` Andi Kleen 0 siblings, 0 replies; 42+ messages in thread From: Andi Kleen @ 2005-06-06 9:30 UTC (permalink / raw) To: Dominik Brodowski, Andi Kleen, john stultz, Parag Warudkar, Nishanth Aravamudan, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh > At least on my notebook, which has an ICH4-M, there is no HPET. AFAIK it > resides on a separate chip which may or may not exist. I'd be glad if the > opposite were true, though :) No it is on the southbridge. But it is often not enabled in the BIOS (so it is not reported in ACPI) but that can be fixed. -Andi ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-06 9:21 ` Andi Kleen 2005-06-06 9:24 ` Dominik Brodowski @ 2005-06-06 13:32 ` Vojtech Pavlik 1 sibling, 0 replies; 42+ messages in thread From: Vojtech Pavlik @ 2005-06-06 13:32 UTC (permalink / raw) To: Andi Kleen Cc: Dominik Brodowski, john stultz, Parag Warudkar, Nishanth Aravamudan, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Mon, Jun 06, 2005 at 11:21:59AM +0200, Andi Kleen wrote: > > IIRC (from the comment above) several chipsets suffer from this > > inconsistency, namely the widely used PIIX4(E) and ICH(4 only? or also other > > ICH-ones?). Therefore, we'd need at least some sort of boot-time check to > > decide which method to use... and based on the method, we can adjust the > > priority maybe? > > At least on x86-64 there are no ICH4s or PIIX4Es. Actually I think > there was one early prototype machine from Intel with ICH4, but I am willing > to ignore these. So please dont do any such things on the x86-64 version. > > Also didnt ICH4 already have HPET? it might not be enabled on many > boxes, but given the chip datasheet one can write enable code to > fix that. I believe the HPET is implemented in the northbridge (MCH) in Intel systems. -- Vojtech Pavlik SuSE Labs, SuSE CR ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-05 17:05 ` Dominik Brodowski 2005-06-06 3:04 ` Parag Warudkar 2005-06-06 9:21 ` Andi Kleen @ 2005-06-06 22:53 ` john stultz 2 siblings, 0 replies; 42+ messages in thread From: john stultz @ 2005-06-06 22:53 UTC (permalink / raw) To: Dominik Brodowski Cc: Parag Warudkar, Nishanth Aravamudan, Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Sun, 2005-06-05 at 19:05 +0200, Dominik Brodowski wrote: > On Fri, Jun 03, 2005 at 08:24:35AM -0700, john stultz wrote: > > On Thu, 2005-06-02 at 19:50 -0400, Parag Warudkar wrote: > > > On Thursday 02 June 2005 19:20, john stultz wrote: > > > > Could you see if the slowness you're feeling is correlated to the > > > > acpi_pm timesource? > > > > > > Speaking of which, the below code from arch/i386/timer_pm.c looks particularly > > > more taxing to me - 3 times read from ioport in a loop - not sure how many > > > time that executes. > > > > > > static inline u32 read_pmtmr(void) > > > { > > > u32 v1=0,v2=0,v3=0; > > > /* It has been reported that because of various broken > > > * chipsets (ICH4, PIIX4 and PIIX4E) where the ACPI PM time > > > * source is not latched, so you must read it multiple > > > * times to insure a safe value is read. > > > */ > > > do { > > > v1 = inl(pmtmr_ioport); > > > v2 = inl(pmtmr_ioport); > > > v3 = inl(pmtmr_ioport); > > > } while ((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1) > > > || (v3 > v1 && v3 < v2)); > > > > > > Shouldn't that loop be limited to the broken chipsets - why would correct > > > people with correctly working chipsets carry this extra burden? (Or is it > > > insignificant?) > > > > Yea, that would be nice to only do the triple read on the affected > > systems. Although outside of the comment I don't have any real data as > > to which system suffer from the issue. > > IIRC (from the comment above) several chipsets suffer from this > inconsistency, namely the widely used PIIX4(E) and ICH(4 only? or also other > ICH-ones?). Therefore, we'd need at least some sort of boot-time check to > decide which method to use... and based on the method, we can adjust the > priority maybe? Well, I'm not sure if this would be reasonably auto-detectable by just reading the pmtmr in a loop. That could take awhile. But some form of DMI blacklist should cover us. Ok, I'll work on this for the next release. thanks -john ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-02 23:50 ` Parag Warudkar 2005-06-03 7:05 ` Ulrich Windl 2005-06-03 15:24 ` john stultz @ 2005-06-03 16:30 ` Andi Kleen 2005-06-03 18:27 ` john stultz 2005-06-04 18:40 ` Parag Warudkar 2 siblings, 2 replies; 42+ messages in thread From: Andi Kleen @ 2005-06-03 16:30 UTC (permalink / raw) To: Parag Warudkar Cc: john stultz, Nishanth Aravamudan, Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Thu, Jun 02, 2005 at 07:50:33PM -0400, Parag Warudkar wrote: > On Thursday 02 June 2005 19:20, john stultz wrote: > > Could you see if the slowness you're feeling is correlated to the > > acpi_pm timesource? > > Speaking of which, the below code from arch/i386/timer_pm.c looks particularly > more taxing to me - 3 times read from ioport in a loop - not sure how many > time that executes. > > static inline u32 read_pmtmr(void) > { > u32 v1=0,v2=0,v3=0; > /* It has been reported that because of various broken > * chipsets (ICH4, PIIX4 and PIIX4E) where the ACPI PM time > * source is not latched, so you must read it multiple > * times to insure a safe value is read. > */ > do { > v1 = inl(pmtmr_ioport); > v2 = inl(pmtmr_ioport); > v3 = inl(pmtmr_ioport); > } while ((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1) > || (v3 > v1 && v3 < v2)); > > Shouldn't that loop be limited to the broken chipsets - why would correct > people with correctly working chipsets carry this extra burden? (Or is it > insignificant?) It is not insignificant and makes a lot of difference. On the x86-64 version of pmtimer I dropped it completely and so far nobody complained. However I wonder why this new time system is using pmtimer by default at all. That is very broken because pmtimer is one of the slowest. I would suggest to duplicate the time source selection I have in the latest x86-64 (-rc5) time.c, that is optimal for all machines I know about (except that you might need to add cyclone and a non TSC fallback for i386) -Andi ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-03 16:30 ` Andi Kleen @ 2005-06-03 18:27 ` john stultz 2005-06-03 19:02 ` Christoph Lameter 2005-06-05 11:27 ` Andi Kleen 2005-06-04 18:40 ` Parag Warudkar 1 sibling, 2 replies; 42+ messages in thread From: john stultz @ 2005-06-03 18:27 UTC (permalink / raw) To: Andi Kleen Cc: Parag Warudkar, Nishanth Aravamudan, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Fri, 2005-06-03 at 18:30 +0200, Andi Kleen wrote: > On Thu, Jun 02, 2005 at 07:50:33PM -0400, Parag Warudkar wrote: > > On Thursday 02 June 2005 19:20, john stultz wrote: > > > Could you see if the slowness you're feeling is correlated to the > > > acpi_pm timesource? > > > > Speaking of which, the below code from arch/i386/timer_pm.c looks particularly > > more taxing to me - 3 times read from ioport in a loop - not sure how many > > time that executes. > > > > static inline u32 read_pmtmr(void) > > { > > u32 v1=0,v2=0,v3=0; > > /* It has been reported that because of various broken > > * chipsets (ICH4, PIIX4 and PIIX4E) where the ACPI PM time > > * source is not latched, so you must read it multiple > > * times to insure a safe value is read. > > */ > > do { > > v1 = inl(pmtmr_ioport); > > v2 = inl(pmtmr_ioport); > > v3 = inl(pmtmr_ioport); > > } while ((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1) > > || (v3 > v1 && v3 < v2)); > > > > Shouldn't that loop be limited to the broken chipsets - why would correct > > people with correctly working chipsets carry this extra burden? (Or is it > > insignificant?) > > It is not insignificant and makes a lot of difference. On the x86-64 > version of pmtimer I dropped it completely and so far nobody > complained. Alright, I'll add a single read function and keep the triple read function around just in case. Maybe we can use some sort of dmi blacklist to auto-detect known trouble cases. > However I wonder why this new time system is using pmtimer by default > at all. That is very broken because pmtimer is one of the slowest. > I would suggest to duplicate the time source selection I have > in the latest x86-64 (-rc5) time.c, that is optimal for all machines > I know about (except that you might need to add cyclone and a non TSC > fallback for i386) The priority values may need some tweaking. The acpi-pm timesource is really useful on laptops that have cpufreq issues, so it has been a higher priority then the TSC in i386 for awhile. How about something like this? 300 TSC 200 HPET 200 CYCLONE 100 ACPI 050 PIT 010 JIFFIES Then if the system has TSC issues (unsynced, cpufreq problems, etc), we can demote the TSC's priority to 50 and it will fall back nicely without manual intervention. thanks -john ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-03 18:27 ` john stultz @ 2005-06-03 19:02 ` Christoph Lameter 2005-06-03 19:21 ` john stultz 2005-06-05 11:27 ` Andi Kleen 1 sibling, 1 reply; 42+ messages in thread From: Christoph Lameter @ 2005-06-03 19:02 UTC (permalink / raw) To: john stultz Cc: Andi Kleen, Parag Warudkar, Nishanth Aravamudan, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Fri, 3 Jun 2005, john stultz wrote: > How about something like this? > > 300 TSC > 200 HPET > 200 CYCLONE > 100 ACPI > 050 PIT > 010 JIFFIES > > Then if the system has TSC issues (unsynced, cpufreq problems, etc), we > can demote the TSC's priority to 50 and it will fall back nicely without > manual intervention. Oh, we are going to have flags for timesources? Then please also do the jitter thing. ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-03 19:02 ` Christoph Lameter @ 2005-06-03 19:21 ` john stultz 0 siblings, 0 replies; 42+ messages in thread From: john stultz @ 2005-06-03 19:21 UTC (permalink / raw) To: Christoph Lameter Cc: Andi Kleen, Parag Warudkar, Nishanth Aravamudan, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Fri, 2005-06-03 at 12:02 -0700, Christoph Lameter wrote: > On Fri, 3 Jun 2005, john stultz wrote: > > > How about something like this? > > > > 300 TSC > > 200 HPET > > 200 CYCLONE > > 100 ACPI > > 050 PIT > > 010 JIFFIES > > > > Then if the system has TSC issues (unsynced, cpufreq problems, etc), we > > can demote the TSC's priority to 50 and it will fall back nicely without > > manual intervention. > > Oh, we are going to have flags for timesources? Then please also do the > jitter thing. Huh? There are no flags here, just the priority values that are already in the structure. When TSC timesource driver itself notes a problem with the system, it can lower its own priority value. thanks -john ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-03 18:27 ` john stultz 2005-06-03 19:02 ` Christoph Lameter @ 2005-06-05 11:27 ` Andi Kleen 2005-06-06 22:51 ` john stultz 1 sibling, 1 reply; 42+ messages in thread From: Andi Kleen @ 2005-06-05 11:27 UTC (permalink / raw) To: john stultz Cc: Andi Kleen, Parag Warudkar, Nishanth Aravamudan, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh > How about something like this? > > 300 TSC > 200 HPET > 200 CYCLONE > 100 ACPI > 050 PIT > 010 JIFFIES > > Then if the system has TSC issues (unsynced, cpufreq problems, etc), we The priority is fine, the problem is getting the decisions for when to fallback right. It is quite complicated to decide this, see the x86-64 time.c code for this. > can demote the TSC's priority to 50 and it will fall back nicely without > manual intervention. -Andi ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-05 11:27 ` Andi Kleen @ 2005-06-06 22:51 ` john stultz 0 siblings, 0 replies; 42+ messages in thread From: john stultz @ 2005-06-06 22:51 UTC (permalink / raw) To: Andi Kleen Cc: Parag Warudkar, Nishanth Aravamudan, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Sun, 2005-06-05 at 13:27 +0200, Andi Kleen wrote: > > How about something like this? > > > > 300 TSC > > 200 HPET > > 200 CYCLONE > > 100 ACPI > > 050 PIT > > 010 JIFFIES > > > > Then if the system has TSC issues (unsynced, cpufreq problems, etc), we > > The priority is fine, the problem is getting the decisions for when > to fallback right. > > It is quite complicated to decide this, see the x86-64 time.c code > for this. Hmmm. I'm not sure I see the level of complication that you allude to. Let me re-spin my patches again with the tsc timesource auto-demotion and let me know if I'm missing anything. thanks -john ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-03 16:30 ` Andi Kleen 2005-06-03 18:27 ` john stultz @ 2005-06-04 18:40 ` Parag Warudkar 2005-06-05 11:28 ` Andi Kleen 1 sibling, 1 reply; 42+ messages in thread From: Parag Warudkar @ 2005-06-04 18:40 UTC (permalink / raw) To: Andi Kleen Cc: john stultz, Nishanth Aravamudan, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh [-- Attachment #1: Type: text/plain, Size: 1081 bytes --] Sorry for the resend - I had zipped up the .config and the mail didn't make it to everyone. On Friday 03 June 2005 12:30, Andi Kleen wrote: > On the x86-64 > version of pmtimer I dropped it completely and so far nobody > complained. Andi, There I complain :):) - There is something wrong with this timer stuff in rc5. I earlier stated that running with rc5 + John's TOD patches makes the music players play music fast. It actually happens with plain vanilla rc5 too. (I was having 3-4 trees and some confusion when I earlier tested rc5 with John's patches.) > I would suggest to duplicate the time source selection I have > in the latest x86-64 (-rc5) time.c, that is optimal for all machines > I know about (except that you might need to add cyclone and a non TSC > fallback for i386) > > -Andi I don't know if John's patches replace your timer code in rc5 totally but both rc5 and rc5+John's TOD patches make music play fast. Going back to 2.6.11 brings the music speed back to normal. My config for plain vanilla rc5 attached. Parag [-- Attachment #2: .config --] [-- Type: text/plain, Size: 37338 bytes --] # # Automatically generated make config: don't edit # Linux kernel version: 2.6.12-rc5 # Sat Jun 4 12:39:36 2005 # CONFIG_X86_64=y CONFIG_64BIT=y CONFIG_X86=y CONFIG_MMU=y CONFIG_RWSEM_GENERIC_SPINLOCK=y CONFIG_GENERIC_CALIBRATE_DELAY=y CONFIG_X86_CMPXCHG=y CONFIG_EARLY_PRINTK=y CONFIG_GENERIC_ISA_DMA=y CONFIG_GENERIC_IOMAP=y # # Code maturity level options # CONFIG_EXPERIMENTAL=y CONFIG_CLEAN_COMPILE=y CONFIG_BROKEN_ON_SMP=y CONFIG_LOCK_KERNEL=y CONFIG_INIT_ENV_ARG_LIMIT=32 # # General setup # CONFIG_LOCALVERSION="" CONFIG_SWAP=y CONFIG_SYSVIPC=y CONFIG_POSIX_MQUEUE=y # CONFIG_BSD_PROCESS_ACCT is not set CONFIG_SYSCTL=y # CONFIG_AUDIT is not set CONFIG_HOTPLUG=y CONFIG_KOBJECT_UEVENT=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y # CONFIG_EMBEDDED is not set CONFIG_KALLSYMS=y # CONFIG_KALLSYMS_ALL is not set # CONFIG_KALLSYMS_EXTRA_PASS is not set CONFIG_PRINTK=y CONFIG_BUG=y CONFIG_BASE_FULL=y CONFIG_FUTEX=y CONFIG_EPOLL=y CONFIG_SHMEM=y CONFIG_CC_ALIGN_FUNCTIONS=0 CONFIG_CC_ALIGN_LABELS=0 CONFIG_CC_ALIGN_LOOPS=0 CONFIG_CC_ALIGN_JUMPS=0 # CONFIG_TINY_SHMEM is not set CONFIG_BASE_SMALL=0 # # Loadable module support # CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_MODULE_FORCE_UNLOAD=y CONFIG_OBSOLETE_MODPARM=y CONFIG_MODVERSIONS=y # CONFIG_MODULE_SRCVERSION_ALL is not set CONFIG_KMOD=y # # Processor type and features # CONFIG_MK8=y # CONFIG_MPSC is not set # CONFIG_GENERIC_CPU is not set CONFIG_X86_L1_CACHE_BYTES=64 CONFIG_X86_L1_CACHE_SHIFT=6 CONFIG_X86_TSC=y CONFIG_X86_GOOD_APIC=y # CONFIG_MICROCODE is not set CONFIG_X86_MSR=y CONFIG_X86_CPUID=y CONFIG_X86_IO_APIC=y CONFIG_X86_LOCAL_APIC=y CONFIG_MTRR=y # CONFIG_SMP is not set CONFIG_PREEMPT=y CONFIG_PREEMPT_BKL=y # CONFIG_NUMA is not set CONFIG_HPET_TIMER=y CONFIG_X86_PM_TIMER=y CONFIG_HPET_EMULATE_RTC=y CONFIG_GART_IOMMU=y CONFIG_SWIOTLB=y CONFIG_X86_MCE=y CONFIG_X86_MCE_INTEL=y # CONFIG_SECCOMP is not set CONFIG_GENERIC_HARDIRQS=y CONFIG_GENERIC_IRQ_PROBE=y CONFIG_ISA_DMA_API=y # # Power management options # CONFIG_PM=y # CONFIG_PM_DEBUG is not set # CONFIG_SOFTWARE_SUSPEND is not set # # ACPI (Advanced Configuration and Power Interface) Support # CONFIG_ACPI=y CONFIG_ACPI_BOOT=y CONFIG_ACPI_INTERPRETER=y CONFIG_ACPI_SLEEP=y CONFIG_ACPI_SLEEP_PROC_FS=y CONFIG_ACPI_AC=y CONFIG_ACPI_BATTERY=y CONFIG_ACPI_BUTTON=y CONFIG_ACPI_VIDEO=y CONFIG_ACPI_FAN=y CONFIG_ACPI_PROCESSOR=y CONFIG_ACPI_THERMAL=y # CONFIG_ACPI_ASUS is not set # CONFIG_ACPI_IBM is not set # CONFIG_ACPI_TOSHIBA is not set CONFIG_ACPI_BLACKLIST_YEAR=0 # CONFIG_ACPI_DEBUG is not set CONFIG_ACPI_BUS=y CONFIG_ACPI_EC=y CONFIG_ACPI_POWER=y CONFIG_ACPI_PCI=y CONFIG_ACPI_SYSTEM=y # CONFIG_ACPI_CONTAINER is not set # # CPU Frequency scaling # CONFIG_CPU_FREQ=y CONFIG_CPU_FREQ_TABLE=y # CONFIG_CPU_FREQ_DEBUG is not set CONFIG_CPU_FREQ_STAT=y # CONFIG_CPU_FREQ_STAT_DETAILS is not set CONFIG_CPU_FREQ_DEFAULT_GOV_PERFORMANCE=y # CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE is not set CONFIG_CPU_FREQ_GOV_PERFORMANCE=y CONFIG_CPU_FREQ_GOV_POWERSAVE=m CONFIG_CPU_FREQ_GOV_USERSPACE=m CONFIG_CPU_FREQ_GOV_ONDEMAND=y # # CPUFreq processor drivers # CONFIG_X86_POWERNOW_K8=y CONFIG_X86_POWERNOW_K8_ACPI=y # CONFIG_X86_SPEEDSTEP_CENTRINO is not set CONFIG_X86_ACPI_CPUFREQ=y # # shared options # # CONFIG_X86_ACPI_CPUFREQ_PROC_INTF is not set # CONFIG_X86_SPEEDSTEP_LIB is not set # # Bus options (PCI etc.) # CONFIG_PCI=y CONFIG_PCI_DIRECT=y CONFIG_PCI_MMCONFIG=y # CONFIG_UNORDERED_IO is not set # CONFIG_PCIEPORTBUS is not set # CONFIG_PCI_MSI is not set CONFIG_PCI_LEGACY_PROC=y CONFIG_PCI_NAMES=y # CONFIG_PCI_DEBUG is not set # # PCCARD (PCMCIA/CardBus) support # # CONFIG_PCCARD is not set # # PCI Hotplug Support # CONFIG_HOTPLUG_PCI=y # CONFIG_HOTPLUG_PCI_FAKE is not set CONFIG_HOTPLUG_PCI_ACPI=y # CONFIG_HOTPLUG_PCI_ACPI_IBM is not set # CONFIG_HOTPLUG_PCI_CPCI is not set # CONFIG_HOTPLUG_PCI_SHPC is not set # # Executable file formats / Emulations # CONFIG_BINFMT_ELF=y CONFIG_BINFMT_MISC=m CONFIG_IA32_EMULATION=y CONFIG_IA32_AOUT=y CONFIG_COMPAT=y CONFIG_SYSVIPC_COMPAT=y CONFIG_UID16=y # # Device Drivers # # # Generic Driver Options # CONFIG_STANDALONE=y CONFIG_PREVENT_FIRMWARE_BUILD=y CONFIG_FW_LOADER=m # CONFIG_DEBUG_DRIVER is not set # # Memory Technology Devices (MTD) # # CONFIG_MTD is not set # # Parallel port support # CONFIG_PARPORT=m CONFIG_PARPORT_PC=m # CONFIG_PARPORT_SERIAL is not set CONFIG_PARPORT_PC_FIFO=y CONFIG_PARPORT_PC_SUPERIO=y # CONFIG_PARPORT_GSC is not set CONFIG_PARPORT_1284=y # # Plug and Play support # # CONFIG_PNP is not set # # Block devices # CONFIG_BLK_DEV_FD=m # CONFIG_PARIDE is not set CONFIG_BLK_CPQ_DA=m # CONFIG_BLK_CPQ_CISS_DA is not set # CONFIG_BLK_DEV_DAC960 is not set # CONFIG_BLK_DEV_UMEM is not set # CONFIG_BLK_DEV_COW_COMMON is not set CONFIG_BLK_DEV_LOOP=y CONFIG_BLK_DEV_CRYPTOLOOP=y CONFIG_BLK_DEV_NBD=m # CONFIG_BLK_DEV_SX8 is not set # CONFIG_BLK_DEV_UB is not set CONFIG_BLK_DEV_RAM=y CONFIG_BLK_DEV_RAM_COUNT=16 CONFIG_BLK_DEV_RAM_SIZE=8192 CONFIG_BLK_DEV_INITRD=y CONFIG_INITRAMFS_SOURCE="" CONFIG_LBD=y CONFIG_CDROM_PKTCDVD=m CONFIG_CDROM_PKTCDVD_BUFFERS=8 # CONFIG_CDROM_PKTCDVD_WCACHE is not set # # IO Schedulers # CONFIG_IOSCHED_NOOP=y CONFIG_IOSCHED_AS=y CONFIG_IOSCHED_DEADLINE=y CONFIG_IOSCHED_CFQ=y # CONFIG_ATA_OVER_ETH is not set # # ATA/ATAPI/MFM/RLL support # CONFIG_IDE=y CONFIG_BLK_DEV_IDE=y # # Please see Documentation/ide.txt for help/info on IDE drives # # CONFIG_BLK_DEV_IDE_SATA is not set # CONFIG_BLK_DEV_HD_IDE is not set CONFIG_BLK_DEV_IDEDISK=y # CONFIG_IDEDISK_MULTI_MODE is not set CONFIG_BLK_DEV_IDECD=y CONFIG_BLK_DEV_IDETAPE=m CONFIG_BLK_DEV_IDEFLOPPY=m CONFIG_BLK_DEV_IDESCSI=m # CONFIG_IDE_TASK_IOCTL is not set # # IDE chipset support/bugfixes # CONFIG_IDE_GENERIC=y # CONFIG_BLK_DEV_CMD640 is not set CONFIG_BLK_DEV_IDEPCI=y CONFIG_IDEPCI_SHARE_IRQ=y # CONFIG_BLK_DEV_OFFBOARD is not set CONFIG_BLK_DEV_GENERIC=y # CONFIG_BLK_DEV_OPTI621 is not set # CONFIG_BLK_DEV_RZ1000 is not set CONFIG_BLK_DEV_IDEDMA_PCI=y CONFIG_BLK_DEV_IDEDMA_FORCED=y CONFIG_IDEDMA_PCI_AUTO=y # CONFIG_IDEDMA_ONLYDISK is not set # CONFIG_BLK_DEV_AEC62XX is not set CONFIG_BLK_DEV_ALI15X3=m # CONFIG_WDC_ALI15X3 is not set CONFIG_BLK_DEV_AMD74XX=y # CONFIG_BLK_DEV_ATIIXP is not set CONFIG_BLK_DEV_CMD64X=m CONFIG_BLK_DEV_TRIFLEX=m CONFIG_BLK_DEV_CY82C693=m CONFIG_BLK_DEV_CS5520=m CONFIG_BLK_DEV_CS5530=m CONFIG_BLK_DEV_HPT34X=m # CONFIG_HPT34X_AUTODMA is not set CONFIG_BLK_DEV_HPT366=m CONFIG_BLK_DEV_SC1200=m CONFIG_BLK_DEV_PIIX=y CONFIG_BLK_DEV_NS87415=m CONFIG_BLK_DEV_PDC202XX_OLD=m CONFIG_PDC202XX_BURST=y CONFIG_BLK_DEV_PDC202XX_NEW=m # CONFIG_PDC202XX_FORCE is not set CONFIG_BLK_DEV_SVWKS=m # CONFIG_BLK_DEV_SIIMAGE is not set CONFIG_BLK_DEV_SIS5513=m CONFIG_BLK_DEV_SLC90E66=m CONFIG_BLK_DEV_TRM290=m CONFIG_BLK_DEV_VIA82CXXX=m # CONFIG_IDE_ARM is not set CONFIG_BLK_DEV_IDEDMA=y # CONFIG_IDEDMA_IVB is not set CONFIG_IDEDMA_AUTO=y # CONFIG_BLK_DEV_HD is not set # # SCSI device support # CONFIG_SCSI=y CONFIG_SCSI_PROC_FS=y # # SCSI support type (disk, tape, CD-ROM) # CONFIG_BLK_DEV_SD=y CONFIG_CHR_DEV_ST=m CONFIG_CHR_DEV_OSST=m CONFIG_BLK_DEV_SR=y # CONFIG_BLK_DEV_SR_VENDOR is not set CONFIG_CHR_DEV_SG=y # # Some SCSI devices (e.g. CD jukebox) support multiple LUNs # CONFIG_SCSI_MULTI_LUN=y # CONFIG_SCSI_CONSTANTS is not set # CONFIG_SCSI_LOGGING is not set # # SCSI Transport Attributes # CONFIG_SCSI_SPI_ATTRS=m CONFIG_SCSI_FC_ATTRS=m # CONFIG_SCSI_ISCSI_ATTRS is not set # # SCSI low-level drivers # CONFIG_BLK_DEV_3W_XXXX_RAID=m CONFIG_SCSI_3W_9XXX=m CONFIG_SCSI_ACARD=m CONFIG_SCSI_AACRAID=m CONFIG_SCSI_AIC7XXX=m CONFIG_AIC7XXX_CMDS_PER_DEVICE=253 CONFIG_AIC7XXX_RESET_DELAY_MS=15000 # CONFIG_AIC7XXX_DEBUG_ENABLE is not set CONFIG_AIC7XXX_DEBUG_MASK=0 # CONFIG_AIC7XXX_REG_PRETTY_PRINT is not set # CONFIG_SCSI_AIC7XXX_OLD is not set CONFIG_SCSI_AIC79XX=m CONFIG_AIC79XX_CMDS_PER_DEVICE=32 CONFIG_AIC79XX_RESET_DELAY_MS=15000 # CONFIG_AIC79XX_ENABLE_RD_STRM is not set # CONFIG_AIC79XX_DEBUG_ENABLE is not set CONFIG_AIC79XX_DEBUG_MASK=0 # CONFIG_AIC79XX_REG_PRETTY_PRINT is not set # CONFIG_MEGARAID_NEWGEN is not set # CONFIG_MEGARAID_LEGACY is not set CONFIG_SCSI_SATA=y # CONFIG_SCSI_SATA_AHCI is not set CONFIG_SCSI_SATA_SVW=m CONFIG_SCSI_ATA_PIIX=m CONFIG_SCSI_SATA_NV=m CONFIG_SCSI_SATA_PROMISE=m # CONFIG_SCSI_SATA_QSTOR is not set CONFIG_SCSI_SATA_SX4=m CONFIG_SCSI_SATA_SIL=m CONFIG_SCSI_SATA_SIS=m # CONFIG_SCSI_SATA_ULI is not set CONFIG_SCSI_SATA_VIA=m CONFIG_SCSI_SATA_VITESSE=m CONFIG_SCSI_BUSLOGIC=m # CONFIG_SCSI_OMIT_FLASHPOINT is not set CONFIG_SCSI_DMX3191D=m CONFIG_SCSI_EATA=m # CONFIG_SCSI_EATA_TAGGED_QUEUE is not set # CONFIG_SCSI_EATA_LINKED_COMMANDS is not set CONFIG_SCSI_EATA_MAX_TAGS=16 CONFIG_SCSI_FUTURE_DOMAIN=m CONFIG_SCSI_GDTH=m CONFIG_SCSI_IPS=m # CONFIG_SCSI_INITIO is not set CONFIG_SCSI_INIA100=m CONFIG_SCSI_PPA=m CONFIG_SCSI_IMM=m CONFIG_SCSI_IZIP_EPP16=y # CONFIG_SCSI_IZIP_SLOW_CTR is not set CONFIG_SCSI_SYM53C8XX_2=m CONFIG_SCSI_SYM53C8XX_DMA_ADDRESSING_MODE=1 CONFIG_SCSI_SYM53C8XX_DEFAULT_TAGS=16 CONFIG_SCSI_SYM53C8XX_MAX_TAGS=64 # CONFIG_SCSI_SYM53C8XX_IOMAPPED is not set CONFIG_SCSI_IPR=m # CONFIG_SCSI_IPR_TRACE is not set # CONFIG_SCSI_IPR_DUMP is not set CONFIG_SCSI_QLOGIC_FC=m CONFIG_SCSI_QLOGIC_FC_FIRMWARE=y CONFIG_SCSI_QLOGIC_1280=m # CONFIG_SCSI_QLOGIC_1280_1040 is not set CONFIG_SCSI_QLA2XXX=y CONFIG_SCSI_QLA21XX=m CONFIG_SCSI_QLA22XX=m CONFIG_SCSI_QLA2300=m CONFIG_SCSI_QLA2322=m CONFIG_SCSI_QLA6312=m # CONFIG_SCSI_LPFC is not set CONFIG_SCSI_DC395x=m CONFIG_SCSI_DC390T=m # CONFIG_SCSI_DEBUG is not set # # Multi-device support (RAID and LVM) # # CONFIG_MD is not set # # Fusion MPT device support # # CONFIG_FUSION is not set # # IEEE 1394 (FireWire) support # CONFIG_IEEE1394=m # # Subsystem Options # # CONFIG_IEEE1394_VERBOSEDEBUG is not set # CONFIG_IEEE1394_OUI_DB is not set CONFIG_IEEE1394_EXTRA_CONFIG_ROMS=y CONFIG_IEEE1394_CONFIG_ROM_IP1394=y # # Device Drivers # # CONFIG_IEEE1394_PCILYNX is not set CONFIG_IEEE1394_OHCI1394=m # # Protocol Drivers # CONFIG_IEEE1394_VIDEO1394=m CONFIG_IEEE1394_SBP2=m # CONFIG_IEEE1394_SBP2_PHYS_DMA is not set CONFIG_IEEE1394_ETH1394=m CONFIG_IEEE1394_DV1394=m CONFIG_IEEE1394_RAWIO=m CONFIG_IEEE1394_CMP=m CONFIG_IEEE1394_AMDTP=m # # I2O device support # # CONFIG_I2O is not set # # Networking support # CONFIG_NET=y # # Networking options # CONFIG_PACKET=y CONFIG_PACKET_MMAP=y CONFIG_UNIX=y CONFIG_NET_KEY=y CONFIG_INET=y # CONFIG_IP_MULTICAST is not set # CONFIG_IP_ADVANCED_ROUTER is not set # CONFIG_IP_PNP is not set # CONFIG_NET_IPIP is not set # CONFIG_NET_IPGRE is not set # CONFIG_ARPD is not set # CONFIG_SYN_COOKIES is not set CONFIG_INET_AH=m CONFIG_INET_ESP=m CONFIG_INET_IPCOMP=m CONFIG_INET_TUNNEL=m CONFIG_IP_TCPDIAG=y CONFIG_IP_TCPDIAG_IPV6=y # # IP: Virtual Server Configuration # # CONFIG_IP_VS is not set CONFIG_IPV6=y CONFIG_IPV6_PRIVACY=y CONFIG_INET6_AH=m CONFIG_INET6_ESP=m CONFIG_INET6_IPCOMP=m CONFIG_INET6_TUNNEL=m CONFIG_IPV6_TUNNEL=m CONFIG_NETFILTER=y CONFIG_NETFILTER_DEBUG=y # # IP: Netfilter Configuration # CONFIG_IP_NF_CONNTRACK=m # CONFIG_IP_NF_CT_ACCT is not set # CONFIG_IP_NF_CONNTRACK_MARK is not set # CONFIG_IP_NF_CT_PROTO_SCTP is not set CONFIG_IP_NF_FTP=m CONFIG_IP_NF_IRC=m CONFIG_IP_NF_TFTP=m CONFIG_IP_NF_AMANDA=m CONFIG_IP_NF_QUEUE=m CONFIG_IP_NF_IPTABLES=m CONFIG_IP_NF_MATCH_LIMIT=m CONFIG_IP_NF_MATCH_IPRANGE=m CONFIG_IP_NF_MATCH_MAC=m CONFIG_IP_NF_MATCH_PKTTYPE=m CONFIG_IP_NF_MATCH_MARK=m CONFIG_IP_NF_MATCH_MULTIPORT=m CONFIG_IP_NF_MATCH_TOS=m CONFIG_IP_NF_MATCH_RECENT=m CONFIG_IP_NF_MATCH_ECN=m CONFIG_IP_NF_MATCH_DSCP=m CONFIG_IP_NF_MATCH_AH_ESP=m CONFIG_IP_NF_MATCH_LENGTH=m CONFIG_IP_NF_MATCH_TTL=m CONFIG_IP_NF_MATCH_TCPMSS=m CONFIG_IP_NF_MATCH_HELPER=m CONFIG_IP_NF_MATCH_STATE=m CONFIG_IP_NF_MATCH_CONNTRACK=m CONFIG_IP_NF_MATCH_OWNER=m CONFIG_IP_NF_MATCH_ADDRTYPE=m CONFIG_IP_NF_MATCH_REALM=m # CONFIG_IP_NF_MATCH_SCTP is not set # CONFIG_IP_NF_MATCH_COMMENT is not set # CONFIG_IP_NF_MATCH_HASHLIMIT is not set CONFIG_IP_NF_FILTER=m CONFIG_IP_NF_TARGET_REJECT=m CONFIG_IP_NF_TARGET_LOG=m CONFIG_IP_NF_TARGET_ULOG=m CONFIG_IP_NF_TARGET_TCPMSS=m CONFIG_IP_NF_NAT=m CONFIG_IP_NF_NAT_NEEDED=y CONFIG_IP_NF_TARGET_MASQUERADE=m CONFIG_IP_NF_TARGET_REDIRECT=m CONFIG_IP_NF_TARGET_NETMAP=m CONFIG_IP_NF_TARGET_SAME=m CONFIG_IP_NF_NAT_SNMP_BASIC=m CONFIG_IP_NF_NAT_IRC=m CONFIG_IP_NF_NAT_FTP=m CONFIG_IP_NF_NAT_TFTP=m CONFIG_IP_NF_NAT_AMANDA=m CONFIG_IP_NF_MANGLE=m CONFIG_IP_NF_TARGET_TOS=m CONFIG_IP_NF_TARGET_ECN=m CONFIG_IP_NF_TARGET_DSCP=m CONFIG_IP_NF_TARGET_MARK=m CONFIG_IP_NF_TARGET_CLASSIFY=m CONFIG_IP_NF_RAW=m CONFIG_IP_NF_TARGET_NOTRACK=m CONFIG_IP_NF_ARPTABLES=m CONFIG_IP_NF_ARPFILTER=m CONFIG_IP_NF_ARP_MANGLE=m # # IPv6: Netfilter Configuration (EXPERIMENTAL) # # CONFIG_IP6_NF_QUEUE is not set CONFIG_IP6_NF_IPTABLES=m CONFIG_IP6_NF_MATCH_LIMIT=m CONFIG_IP6_NF_MATCH_MAC=m CONFIG_IP6_NF_MATCH_RT=m CONFIG_IP6_NF_MATCH_OPTS=m CONFIG_IP6_NF_MATCH_FRAG=m CONFIG_IP6_NF_MATCH_HL=m CONFIG_IP6_NF_MATCH_MULTIPORT=m CONFIG_IP6_NF_MATCH_OWNER=m CONFIG_IP6_NF_MATCH_MARK=m CONFIG_IP6_NF_MATCH_IPV6HEADER=m CONFIG_IP6_NF_MATCH_AHESP=m CONFIG_IP6_NF_MATCH_LENGTH=m CONFIG_IP6_NF_MATCH_EUI64=m CONFIG_IP6_NF_FILTER=m CONFIG_IP6_NF_TARGET_LOG=m CONFIG_IP6_NF_MANGLE=m CONFIG_IP6_NF_TARGET_MARK=m CONFIG_IP6_NF_RAW=m CONFIG_XFRM=y CONFIG_XFRM_USER=m # # SCTP Configuration (EXPERIMENTAL) # CONFIG_IP_SCTP=m # CONFIG_SCTP_DBG_MSG is not set # CONFIG_SCTP_DBG_OBJCNT is not set # CONFIG_SCTP_HMAC_NONE is not set # CONFIG_SCTP_HMAC_SHA1 is not set CONFIG_SCTP_HMAC_MD5=y # CONFIG_ATM is not set # CONFIG_BRIDGE is not set CONFIG_VLAN_8021Q=m # CONFIG_DECNET is not set CONFIG_LLC=y # CONFIG_LLC2 is not set # CONFIG_IPX is not set # CONFIG_ATALK is not set # CONFIG_X25 is not set # CONFIG_LAPB is not set # CONFIG_NET_DIVERT is not set # CONFIG_ECONET is not set # CONFIG_WAN_ROUTER is not set # # QoS and/or fair queueing # CONFIG_NET_SCHED=y CONFIG_NET_SCH_CLK_JIFFIES=y # CONFIG_NET_SCH_CLK_GETTIMEOFDAY is not set # CONFIG_NET_SCH_CLK_CPU is not set CONFIG_NET_SCH_CBQ=m CONFIG_NET_SCH_HTB=m CONFIG_NET_SCH_HFSC=m CONFIG_NET_SCH_PRIO=m CONFIG_NET_SCH_RED=m CONFIG_NET_SCH_SFQ=m CONFIG_NET_SCH_TEQL=m CONFIG_NET_SCH_TBF=m CONFIG_NET_SCH_GRED=m CONFIG_NET_SCH_DSMARK=m CONFIG_NET_SCH_NETEM=m CONFIG_NET_SCH_INGRESS=m CONFIG_NET_QOS=y CONFIG_NET_ESTIMATOR=y CONFIG_NET_CLS=y # CONFIG_NET_CLS_BASIC is not set CONFIG_NET_CLS_TCINDEX=m CONFIG_NET_CLS_ROUTE4=m CONFIG_NET_CLS_ROUTE=y CONFIG_NET_CLS_FW=m CONFIG_NET_CLS_U32=m # CONFIG_CLS_U32_PERF is not set CONFIG_NET_CLS_IND=y # CONFIG_CLS_U32_MARK is not set CONFIG_NET_CLS_RSVP=m CONFIG_NET_CLS_RSVP6=m # CONFIG_NET_EMATCH is not set CONFIG_NET_CLS_ACT=y CONFIG_NET_ACT_POLICE=m # CONFIG_NET_ACT_GACT is not set # CONFIG_NET_ACT_MIRRED is not set # CONFIG_NET_ACT_IPT is not set # CONFIG_NET_ACT_PEDIT is not set # CONFIG_NET_ACT_SIMP is not set # # Network testing # # CONFIG_NET_PKTGEN is not set CONFIG_NETPOLL=y # CONFIG_NETPOLL_RX is not set # CONFIG_NETPOLL_TRAP is not set CONFIG_NET_POLL_CONTROLLER=y # CONFIG_HAMRADIO is not set # CONFIG_IRDA is not set CONFIG_BT=m CONFIG_BT_L2CAP=m CONFIG_BT_SCO=m # CONFIG_BT_RFCOMM is not set # CONFIG_BT_BNEP is not set # CONFIG_BT_CMTP is not set CONFIG_BT_HIDP=m # # Bluetooth device drivers # CONFIG_BT_HCIUSB=m # CONFIG_BT_HCIUSB_SCO is not set CONFIG_BT_HCIUART=m CONFIG_BT_HCIUART_H4=y CONFIG_BT_HCIUART_BCSP=y CONFIG_BT_HCIUART_BCSP_TXCRC=y # CONFIG_BT_HCIBCM203X is not set # CONFIG_BT_HCIBPA10X is not set # CONFIG_BT_HCIBFUSB is not set # CONFIG_BT_HCIVHCI is not set CONFIG_NETDEVICES=y CONFIG_DUMMY=m CONFIG_BONDING=m CONFIG_EQUALIZER=m # CONFIG_TUN is not set # # ARCnet devices # # CONFIG_ARCNET is not set # # Ethernet (10 or 100Mbit) # CONFIG_NET_ETHERNET=y CONFIG_MII=m CONFIG_HAPPYMEAL=m CONFIG_SUNGEM=m CONFIG_NET_VENDOR_3COM=y CONFIG_VORTEX=m # CONFIG_TYPHOON is not set # # Tulip family network device support # CONFIG_NET_TULIP=y CONFIG_DE2104X=m CONFIG_TULIP=m # CONFIG_TULIP_MWI is not set # CONFIG_TULIP_MMIO is not set # CONFIG_TULIP_NAPI is not set CONFIG_DE4X5=m CONFIG_WINBOND_840=m CONFIG_DM9102=m CONFIG_HP100=m CONFIG_NET_PCI=y CONFIG_PCNET32=m CONFIG_AMD8111_ETH=m # CONFIG_AMD8111E_NAPI is not set CONFIG_ADAPTEC_STARFIRE=m # CONFIG_ADAPTEC_STARFIRE_NAPI is not set CONFIG_B44=m CONFIG_FORCEDETH=m CONFIG_DGRS=m # CONFIG_EEPRO100 is not set CONFIG_E100=m CONFIG_FEALNX=m CONFIG_NATSEMI=m CONFIG_NE2K_PCI=m CONFIG_8139CP=m CONFIG_8139TOO=m # CONFIG_8139TOO_PIO is not set # CONFIG_8139TOO_TUNE_TWISTER is not set CONFIG_8139TOO_8129=y # CONFIG_8139_OLD_RX_RESET is not set CONFIG_SIS900=m CONFIG_EPIC100=m CONFIG_SUNDANCE=m # CONFIG_SUNDANCE_MMIO is not set CONFIG_VIA_RHINE=m # CONFIG_VIA_RHINE_MMIO is not set # # Ethernet (1000 Mbit) # CONFIG_ACENIC=m # CONFIG_ACENIC_OMIT_TIGON_I is not set CONFIG_DL2K=m CONFIG_E1000=m # CONFIG_E1000_NAPI is not set CONFIG_NS83820=m CONFIG_HAMACHI=m CONFIG_YELLOWFIN=m CONFIG_R8169=m # CONFIG_R8169_NAPI is not set # CONFIG_R8169_VLAN is not set CONFIG_SK98LIN=m # CONFIG_VIA_VELOCITY is not set CONFIG_TIGON3=m # # Ethernet (10000 Mbit) # CONFIG_IXGB=m # CONFIG_IXGB_NAPI is not set # CONFIG_S2IO is not set # # Token Ring devices # CONFIG_TR=y # CONFIG_IBMOL is not set CONFIG_3C359=m # CONFIG_TMS380TR is not set # # Wireless LAN (non-hamradio) # CONFIG_NET_RADIO=y # # Obsolete Wireless cards support (pre-802.11) # # CONFIG_STRIP is not set # # Wireless 802.11b ISA/PCI cards support # CONFIG_HERMES=m CONFIG_PLX_HERMES=m CONFIG_TMD_HERMES=m # CONFIG_PCI_HERMES is not set # CONFIG_ATMEL is not set # # Prism GT/Duette 802.11(a/b/g) PCI/Cardbus support # CONFIG_PRISM54=m CONFIG_NET_WIRELESS=y # # Wan interfaces # # CONFIG_WAN is not set # CONFIG_FDDI is not set # CONFIG_HIPPI is not set CONFIG_PLIP=m CONFIG_PPP=m # CONFIG_PPP_MULTILINK is not set # CONFIG_PPP_FILTER is not set CONFIG_PPP_ASYNC=m CONFIG_PPP_SYNC_TTY=m CONFIG_PPP_DEFLATE=m CONFIG_PPP_BSDCOMP=m CONFIG_PPPOE=m CONFIG_SLIP=m CONFIG_SLIP_COMPRESSED=y # CONFIG_SLIP_SMART is not set # CONFIG_SLIP_MODE_SLIP6 is not set CONFIG_NET_FC=y # CONFIG_SHAPER is not set CONFIG_NETCONSOLE=m # # ISDN subsystem # CONFIG_ISDN=m # # Old ISDN4Linux # # CONFIG_ISDN_I4L is not set # # CAPI subsystem # CONFIG_ISDN_CAPI=m # CONFIG_ISDN_DRV_AVMB1_VERBOSE_REASON is not set # CONFIG_ISDN_CAPI_MIDDLEWARE is not set CONFIG_ISDN_CAPI_CAPI20=m # # CAPI hardware drivers # # # Active AVM cards # # CONFIG_CAPI_AVM is not set # # Active Eicon DIVA Server cards # # CONFIG_CAPI_EICON is not set # # Telephony Support # # CONFIG_PHONE is not set # # Input device support # CONFIG_INPUT=y # # Userland interfaces # CONFIG_INPUT_MOUSEDEV=y CONFIG_INPUT_MOUSEDEV_PSAUX=y CONFIG_INPUT_MOUSEDEV_SCREEN_X=1280 CONFIG_INPUT_MOUSEDEV_SCREEN_Y=800 CONFIG_INPUT_JOYDEV=y # CONFIG_INPUT_TSDEV is not set # CONFIG_INPUT_EVDEV is not set # CONFIG_INPUT_EVBUG is not set # # Input Device Drivers # CONFIG_INPUT_KEYBOARD=y CONFIG_KEYBOARD_ATKBD=y # CONFIG_KEYBOARD_SUNKBD is not set # CONFIG_KEYBOARD_LKKBD is not set # CONFIG_KEYBOARD_XTKBD is not set # CONFIG_KEYBOARD_NEWTON is not set CONFIG_INPUT_MOUSE=y CONFIG_MOUSE_PS2=m # CONFIG_MOUSE_SERIAL is not set # CONFIG_MOUSE_VSXXXAA is not set # CONFIG_INPUT_JOYSTICK is not set # CONFIG_INPUT_TOUCHSCREEN is not set # CONFIG_INPUT_MISC is not set # # Hardware I/O ports # CONFIG_SERIO=y CONFIG_SERIO_I8042=y CONFIG_SERIO_SERPORT=y # CONFIG_SERIO_CT82C710 is not set # CONFIG_SERIO_PARKBD is not set # CONFIG_SERIO_PCIPS2 is not set CONFIG_SERIO_LIBPS2=y # CONFIG_SERIO_RAW is not set CONFIG_GAMEPORT=m # CONFIG_GAMEPORT_NS558 is not set # CONFIG_GAMEPORT_L4 is not set # CONFIG_GAMEPORT_EMU10K1 is not set # CONFIG_GAMEPORT_VORTEX is not set # CONFIG_GAMEPORT_FM801 is not set # CONFIG_GAMEPORT_CS461X is not set CONFIG_SOUND_GAMEPORT=m # # Character devices # CONFIG_VT=y CONFIG_VT_CONSOLE=y CONFIG_HW_CONSOLE=y CONFIG_SERIAL_NONSTANDARD=y # CONFIG_COMPUTONE is not set CONFIG_ROCKETPORT=m # CONFIG_CYCLADES is not set # CONFIG_DIGIEPCA is not set # CONFIG_MOXA_INTELLIO is not set # CONFIG_MOXA_SMARTIO is not set # CONFIG_ISI is not set CONFIG_SYNCLINK=m CONFIG_SYNCLINKMP=m CONFIG_N_HDLC=m # CONFIG_RISCOM8 is not set # CONFIG_SPECIALIX is not set # CONFIG_SX is not set # CONFIG_RIO is not set # CONFIG_STALDRV is not set # # Serial drivers # CONFIG_SERIAL_8250=y CONFIG_SERIAL_8250_CONSOLE=y CONFIG_SERIAL_8250_ACPI=y CONFIG_SERIAL_8250_NR_UARTS=4 # CONFIG_SERIAL_8250_EXTENDED is not set # # Non-8250 serial port support # CONFIG_SERIAL_CORE=y CONFIG_SERIAL_CORE_CONSOLE=y # CONFIG_SERIAL_JSM is not set CONFIG_UNIX98_PTYS=y CONFIG_LEGACY_PTYS=y CONFIG_LEGACY_PTY_COUNT=256 # CONFIG_PRINTER is not set # CONFIG_PPDEV is not set # CONFIG_TIPAR is not set # # IPMI # # CONFIG_IPMI_HANDLER is not set # # Watchdog Cards # CONFIG_WATCHDOG=y # CONFIG_WATCHDOG_NOWAYOUT is not set # # Watchdog Device Drivers # # CONFIG_SOFT_WATCHDOG is not set # CONFIG_ACQUIRE_WDT is not set # CONFIG_ADVANTECH_WDT is not set # CONFIG_ALIM1535_WDT is not set # CONFIG_ALIM7101_WDT is not set # CONFIG_SC520_WDT is not set # CONFIG_EUROTECH_WDT is not set # CONFIG_IB700_WDT is not set # CONFIG_WAFER_WDT is not set # CONFIG_I8XX_TCO is not set # CONFIG_SC1200_WDT is not set # CONFIG_60XX_WDT is not set # CONFIG_CPU5_WDT is not set # CONFIG_W83627HF_WDT is not set # CONFIG_W83877F_WDT is not set # CONFIG_MACHZ_WDT is not set # # PCI-based Watchdog Cards # # CONFIG_PCIPCWATCHDOG is not set # CONFIG_WDTPCI is not set # # USB-based Watchdog Cards # # CONFIG_USBPCWATCHDOG is not set CONFIG_HW_RANDOM=y CONFIG_NVRAM=y CONFIG_RTC=y # CONFIG_DTLK is not set # CONFIG_R3964 is not set # CONFIG_APPLICOM is not set # # Ftape, the floppy tape device driver # # CONFIG_FTAPE is not set CONFIG_AGP=y CONFIG_AGP_AMD64=y # CONFIG_AGP_INTEL is not set CONFIG_DRM=y CONFIG_DRM_TDFX=m CONFIG_DRM_R128=m CONFIG_DRM_RADEON=m # CONFIG_DRM_MGA is not set CONFIG_DRM_SIS=m # CONFIG_MWAVE is not set # CONFIG_RAW_DRIVER is not set CONFIG_HPET=y # CONFIG_HPET_RTC_IRQ is not set CONFIG_HPET_MMAP=y # CONFIG_HANGCHECK_TIMER is not set # # TPM devices # # CONFIG_TCG_TPM is not set # # I2C support # CONFIG_I2C=y CONFIG_I2C_CHARDEV=m # # I2C Algorithms # CONFIG_I2C_ALGOBIT=m # CONFIG_I2C_ALGOPCF is not set # CONFIG_I2C_ALGOPCA is not set # # I2C Hardware Bus support # # CONFIG_I2C_ALI1535 is not set # CONFIG_I2C_ALI1563 is not set # CONFIG_I2C_ALI15X3 is not set # CONFIG_I2C_AMD756 is not set CONFIG_I2C_AMD8111=m # CONFIG_I2C_I801 is not set # CONFIG_I2C_I810 is not set # CONFIG_I2C_PIIX4 is not set CONFIG_I2C_ISA=m CONFIG_I2C_NFORCE2=m # CONFIG_I2C_PARPORT is not set # CONFIG_I2C_PARPORT_LIGHT is not set # CONFIG_I2C_PROSAVAGE is not set # CONFIG_I2C_SAVAGE4 is not set # CONFIG_SCx200_ACB is not set # CONFIG_I2C_SIS5595 is not set # CONFIG_I2C_SIS630 is not set # CONFIG_I2C_SIS96X is not set # CONFIG_I2C_STUB is not set # CONFIG_I2C_VIA is not set CONFIG_I2C_VIAPRO=m # CONFIG_I2C_VOODOO3 is not set # CONFIG_I2C_PCA_ISA is not set # # Hardware Sensors Chip support # CONFIG_I2C_SENSOR=m CONFIG_SENSORS_ADM1021=m CONFIG_SENSORS_ADM1025=m # CONFIG_SENSORS_ADM1026 is not set CONFIG_SENSORS_ADM1031=m # CONFIG_SENSORS_ASB100 is not set CONFIG_SENSORS_DS1621=m # CONFIG_SENSORS_FSCHER is not set # CONFIG_SENSORS_FSCPOS is not set # CONFIG_SENSORS_GL518SM is not set # CONFIG_SENSORS_GL520SM is not set CONFIG_SENSORS_IT87=m # CONFIG_SENSORS_LM63 is not set CONFIG_SENSORS_LM75=m CONFIG_SENSORS_LM77=m CONFIG_SENSORS_LM78=m CONFIG_SENSORS_LM80=m CONFIG_SENSORS_LM83=m CONFIG_SENSORS_LM85=m # CONFIG_SENSORS_LM87 is not set # CONFIG_SENSORS_LM90 is not set # CONFIG_SENSORS_LM92 is not set CONFIG_SENSORS_MAX1619=m # CONFIG_SENSORS_PC87360 is not set # CONFIG_SENSORS_SMSC47B397 is not set # CONFIG_SENSORS_SIS5595 is not set # CONFIG_SENSORS_SMSC47M1 is not set CONFIG_SENSORS_VIA686A=m CONFIG_SENSORS_W83781D=m # CONFIG_SENSORS_W83L785TS is not set CONFIG_SENSORS_W83627HF=m # # Other I2C Chip support # # CONFIG_SENSORS_DS1337 is not set CONFIG_SENSORS_EEPROM=m # CONFIG_SENSORS_PCF8574 is not set # CONFIG_SENSORS_PCF8591 is not set # CONFIG_SENSORS_RTC8564 is not set # CONFIG_I2C_DEBUG_CORE is not set # CONFIG_I2C_DEBUG_ALGO is not set # CONFIG_I2C_DEBUG_BUS is not set # CONFIG_I2C_DEBUG_CHIP is not set # # Dallas's 1-wire bus # # CONFIG_W1 is not set # # Misc devices # # CONFIG_IBM_ASM is not set # # Multimedia devices # CONFIG_VIDEO_DEV=m # # Video For Linux # # # Video Adapters # CONFIG_VIDEO_BT848=m CONFIG_VIDEO_BWQCAM=m CONFIG_VIDEO_CQCAM=m CONFIG_VIDEO_W9966=m CONFIG_VIDEO_CPIA=m CONFIG_VIDEO_CPIA_PP=m CONFIG_VIDEO_CPIA_USB=m CONFIG_VIDEO_SAA5246A=m CONFIG_VIDEO_SAA5249=m CONFIG_TUNER_3036=m CONFIG_VIDEO_STRADIS=m CONFIG_VIDEO_ZORAN=m CONFIG_VIDEO_ZORAN_BUZ=m CONFIG_VIDEO_ZORAN_DC10=m CONFIG_VIDEO_ZORAN_DC30=m CONFIG_VIDEO_ZORAN_LML33=m CONFIG_VIDEO_ZORAN_LML33R10=m CONFIG_VIDEO_SAA7134=m CONFIG_VIDEO_MXB=m CONFIG_VIDEO_DPC=m CONFIG_VIDEO_HEXIUM_ORION=m CONFIG_VIDEO_HEXIUM_GEMINI=m CONFIG_VIDEO_CX88=m CONFIG_VIDEO_OVCAMCHIP=m # # Radio Adapters # CONFIG_RADIO_GEMTEK_PCI=m CONFIG_RADIO_MAXIRADIO=m CONFIG_RADIO_MAESTRO=m # # Digital Video Broadcasting Devices # # CONFIG_DVB is not set CONFIG_VIDEO_SAA7146=m CONFIG_VIDEO_SAA7146_VV=m CONFIG_VIDEO_VIDEOBUF=m CONFIG_VIDEO_TUNER=m CONFIG_VIDEO_BUF=m CONFIG_VIDEO_BTCX=m CONFIG_VIDEO_IR=m CONFIG_VIDEO_TVEEPROM=m # # Graphics support # CONFIG_FB=y CONFIG_FB_CFB_FILLRECT=y CONFIG_FB_CFB_COPYAREA=y CONFIG_FB_CFB_IMAGEBLIT=y CONFIG_FB_SOFT_CURSOR=y # CONFIG_FB_MACMODES is not set # CONFIG_FB_MODE_HELPERS is not set # CONFIG_FB_TILEBLITTING is not set # CONFIG_FB_CIRRUS is not set # CONFIG_FB_PM2 is not set # CONFIG_FB_CYBER2000 is not set # CONFIG_FB_ASILIANT is not set # CONFIG_FB_IMSTT is not set # CONFIG_FB_VGA16 is not set CONFIG_FB_VESA=y CONFIG_VIDEO_SELECT=y # CONFIG_FB_HGA is not set # CONFIG_FB_NVIDIA is not set # CONFIG_FB_RIVA is not set # CONFIG_FB_MATROX is not set # CONFIG_FB_RADEON_OLD is not set # CONFIG_FB_RADEON is not set # CONFIG_FB_ATY128 is not set # CONFIG_FB_ATY is not set # CONFIG_FB_SAVAGE is not set # CONFIG_FB_SIS is not set # CONFIG_FB_NEOMAGIC is not set # CONFIG_FB_KYRO is not set # CONFIG_FB_3DFX is not set # CONFIG_FB_VOODOO1 is not set # CONFIG_FB_TRIDENT is not set # CONFIG_FB_GEODE is not set # CONFIG_FB_S1D13XXX is not set # CONFIG_FB_VIRTUAL is not set # # Console display driver support # CONFIG_VGA_CONSOLE=y CONFIG_DUMMY_CONSOLE=y CONFIG_FRAMEBUFFER_CONSOLE=y CONFIG_FONTS=y CONFIG_FONT_8x8=y CONFIG_FONT_8x16=y # CONFIG_FONT_6x11 is not set CONFIG_FONT_PEARL_8x8=y CONFIG_FONT_ACORN_8x8=y CONFIG_FONT_MINI_4x6=y CONFIG_FONT_SUN8x16=y # CONFIG_FONT_SUN12x22 is not set # # Logo configuration # CONFIG_LOGO=y # CONFIG_LOGO_LINUX_MONO is not set # CONFIG_LOGO_LINUX_VGA16 is not set CONFIG_LOGO_LINUX_CLUT224=y # CONFIG_BACKLIGHT_LCD_SUPPORT is not set # # Sound # CONFIG_SOUND=y # # Advanced Linux Sound Architecture # CONFIG_SND=y CONFIG_SND_TIMER=y CONFIG_SND_PCM=y CONFIG_SND_HWDEP=m CONFIG_SND_RAWMIDI=m CONFIG_SND_SEQUENCER=y # CONFIG_SND_SEQ_DUMMY is not set CONFIG_SND_OSSEMUL=y CONFIG_SND_MIXER_OSS=y CONFIG_SND_PCM_OSS=y CONFIG_SND_SEQUENCER_OSS=y CONFIG_SND_RTCTIMER=y # CONFIG_SND_VERBOSE_PRINTK is not set # CONFIG_SND_DEBUG is not set # # Generic devices # CONFIG_SND_MPU401_UART=m CONFIG_SND_OPL3_LIB=m CONFIG_SND_VX_LIB=m # CONFIG_SND_DUMMY is not set CONFIG_SND_VIRMIDI=m # CONFIG_SND_MTPAV is not set CONFIG_SND_SERIAL_U16550=m CONFIG_SND_MPU401=m # # PCI devices # CONFIG_SND_AC97_CODEC=m CONFIG_SND_ALI5451=m # CONFIG_SND_ATIIXP is not set # CONFIG_SND_ATIIXP_MODEM is not set # CONFIG_SND_AU8810 is not set # CONFIG_SND_AU8820 is not set # CONFIG_SND_AU8830 is not set CONFIG_SND_AZT3328=m CONFIG_SND_BT87X=m # CONFIG_SND_BT87X_OVERCLOCK is not set CONFIG_SND_CS46XX=m # CONFIG_SND_CS46XX_NEW_DSP is not set CONFIG_SND_CS4281=m CONFIG_SND_EMU10K1=m # CONFIG_SND_EMU10K1X is not set # CONFIG_SND_CA0106 is not set CONFIG_SND_KORG1212=m CONFIG_SND_MIXART=m CONFIG_SND_NM256=m CONFIG_SND_RME32=m CONFIG_SND_RME96=m CONFIG_SND_RME9652=m CONFIG_SND_HDSP=m CONFIG_SND_TRIDENT=m CONFIG_SND_YMFPCI=m CONFIG_SND_ALS4000=m CONFIG_SND_CMIPCI=m CONFIG_SND_ENS1370=m CONFIG_SND_ENS1371=m CONFIG_SND_ES1938=m CONFIG_SND_ES1968=m CONFIG_SND_MAESTRO3=m CONFIG_SND_FM801=m # CONFIG_SND_FM801_TEA575X is not set CONFIG_SND_ICE1712=m CONFIG_SND_ICE1724=m CONFIG_SND_INTEL8X0=m CONFIG_SND_INTEL8X0M=m CONFIG_SND_SONICVIBES=m CONFIG_SND_VIA82XX=m # CONFIG_SND_VIA82XX_MODEM is not set CONFIG_SND_VX222=m # CONFIG_SND_HDA_INTEL is not set # # USB devices # CONFIG_SND_USB_AUDIO=m # CONFIG_SND_USB_USX2Y is not set # # Open Sound System # # CONFIG_SOUND_PRIME is not set # # USB support # CONFIG_USB_ARCH_HAS_HCD=y CONFIG_USB_ARCH_HAS_OHCI=y CONFIG_USB=m # CONFIG_USB_DEBUG is not set # # Miscellaneous USB options # CONFIG_USB_DEVICEFS=y # CONFIG_USB_BANDWIDTH is not set # CONFIG_USB_DYNAMIC_MINORS is not set # CONFIG_USB_SUSPEND is not set # CONFIG_USB_OTG is not set # # USB Host Controller Drivers # CONFIG_USB_EHCI_HCD=m CONFIG_USB_EHCI_SPLIT_ISO=y CONFIG_USB_EHCI_ROOT_HUB_TT=y CONFIG_USB_OHCI_HCD=m # CONFIG_USB_OHCI_BIG_ENDIAN is not set CONFIG_USB_OHCI_LITTLE_ENDIAN=y CONFIG_USB_UHCI_HCD=m # CONFIG_USB_SL811_HCD is not set # # USB Device Class drivers # # CONFIG_USB_AUDIO is not set # # USB Bluetooth TTY can only be used with disabled Bluetooth subsystem # # CONFIG_USB_MIDI is not set # CONFIG_USB_ACM is not set # CONFIG_USB_PRINTER is not set # # NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' may also be needed; see USB_STORAGE Help for more information # CONFIG_USB_STORAGE=m # CONFIG_USB_STORAGE_DEBUG is not set # CONFIG_USB_STORAGE_DATAFAB is not set # CONFIG_USB_STORAGE_FREECOM is not set # CONFIG_USB_STORAGE_ISD200 is not set # CONFIG_USB_STORAGE_DPCM is not set # CONFIG_USB_STORAGE_USBAT is not set # CONFIG_USB_STORAGE_SDDR09 is not set # CONFIG_USB_STORAGE_SDDR55 is not set # CONFIG_USB_STORAGE_JUMPSHOT is not set # # USB Input Devices # CONFIG_USB_HID=m CONFIG_USB_HIDINPUT=y # CONFIG_HID_FF is not set CONFIG_USB_HIDDEV=y # # USB HID Boot Protocol drivers # # CONFIG_USB_KBD is not set # CONFIG_USB_MOUSE is not set # CONFIG_USB_AIPTEK is not set # CONFIG_USB_WACOM is not set # CONFIG_USB_KBTAB is not set # CONFIG_USB_POWERMATE is not set # CONFIG_USB_MTOUCH is not set # CONFIG_USB_EGALAX is not set # CONFIG_USB_XPAD is not set # CONFIG_USB_ATI_REMOTE is not set # # USB Imaging devices # # CONFIG_USB_MDC800 is not set # CONFIG_USB_MICROTEK is not set # # USB Multimedia devices # # CONFIG_USB_DABUSB is not set # CONFIG_USB_VICAM is not set # CONFIG_USB_DSBR is not set # CONFIG_USB_IBMCAM is not set # CONFIG_USB_KONICAWC is not set # CONFIG_USB_OV511 is not set # CONFIG_USB_SE401 is not set # CONFIG_USB_SN9C102 is not set # CONFIG_USB_STV680 is not set # CONFIG_USB_W9968CF is not set # CONFIG_USB_PWC is not set # # USB Network Adapters # CONFIG_USB_CATC=m CONFIG_USB_KAWETH=m CONFIG_USB_PEGASUS=m CONFIG_USB_RTL8150=m CONFIG_USB_USBNET=m # # USB Host-to-Host Cables # CONFIG_USB_ALI_M5632=y CONFIG_USB_AN2720=y CONFIG_USB_BELKIN=y CONFIG_USB_GENESYS=y CONFIG_USB_NET1080=y CONFIG_USB_PL2301=y CONFIG_USB_KC2190=y # # Intelligent USB Devices/Gadgets # CONFIG_USB_ARMLINUX=y CONFIG_USB_EPSON2888=y CONFIG_USB_ZAURUS=y CONFIG_USB_CDCETHER=y # # USB Network Adapters # CONFIG_USB_AX8817X=y # CONFIG_USB_ZD1201 is not set # CONFIG_USB_MON is not set # # USB port drivers # # CONFIG_USB_USS720 is not set # # USB Serial Converter support # # CONFIG_USB_SERIAL is not set # # USB Miscellaneous drivers # # CONFIG_USB_EMI62 is not set # CONFIG_USB_EMI26 is not set # CONFIG_USB_AUERSWALD is not set # CONFIG_USB_RIO500 is not set # CONFIG_USB_LEGOTOWER is not set # CONFIG_USB_LCD is not set # CONFIG_USB_LED is not set # CONFIG_USB_CYTHERM is not set # CONFIG_USB_PHIDGETKIT is not set # CONFIG_USB_PHIDGETSERVO is not set # CONFIG_USB_IDMOUSE is not set # CONFIG_USB_SISUSBVGA is not set # CONFIG_USB_TEST is not set # # USB ATM/DSL drivers # # # USB Gadget Support # # CONFIG_USB_GADGET is not set # # MMC/SD Card support # # CONFIG_MMC is not set # # InfiniBand support # # CONFIG_INFINIBAND is not set # # Firmware Drivers # CONFIG_EDD=y # # File systems # CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y # CONFIG_EXT2_FS_SECURITY is not set CONFIG_EXT3_FS=m CONFIG_EXT3_FS_XATTR=y CONFIG_EXT3_FS_POSIX_ACL=y # CONFIG_EXT3_FS_SECURITY is not set CONFIG_JBD=m # CONFIG_JBD_DEBUG is not set CONFIG_FS_MBCACHE=y CONFIG_REISERFS_FS=y # CONFIG_REISERFS_CHECK is not set # CONFIG_REISERFS_PROC_INFO is not set CONFIG_REISERFS_FS_XATTR=y CONFIG_REISERFS_FS_POSIX_ACL=y # CONFIG_REISERFS_FS_SECURITY is not set # CONFIG_JFS_FS is not set CONFIG_FS_POSIX_ACL=y # # XFS support # CONFIG_XFS_FS=y # CONFIG_XFS_RT is not set # CONFIG_XFS_QUOTA is not set # CONFIG_XFS_SECURITY is not set CONFIG_XFS_POSIX_ACL=y # CONFIG_MINIX_FS is not set # CONFIG_ROMFS_FS is not set # CONFIG_QUOTA is not set CONFIG_DNOTIFY=y CONFIG_AUTOFS_FS=m CONFIG_AUTOFS4_FS=y # # CD-ROM/DVD Filesystems # CONFIG_ISO9660_FS=y CONFIG_JOLIET=y CONFIG_ZISOFS=y CONFIG_ZISOFS_FS=y CONFIG_UDF_FS=m CONFIG_UDF_NLS=y # # DOS/FAT/NT Filesystems # CONFIG_FAT_FS=m CONFIG_MSDOS_FS=m CONFIG_VFAT_FS=m CONFIG_FAT_DEFAULT_CODEPAGE=437 CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" CONFIG_NTFS_FS=m # CONFIG_NTFS_DEBUG is not set # CONFIG_NTFS_RW is not set # # Pseudo filesystems # CONFIG_PROC_FS=y CONFIG_PROC_KCORE=y CONFIG_SYSFS=y # CONFIG_DEVFS_FS is not set # CONFIG_DEVPTS_FS_XATTR is not set CONFIG_TMPFS=y # CONFIG_TMPFS_XATTR is not set # CONFIG_HUGETLBFS is not set # CONFIG_HUGETLB_PAGE is not set CONFIG_RAMFS=y # # Miscellaneous filesystems # # CONFIG_ADFS_FS is not set # CONFIG_AFFS_FS is not set # CONFIG_HFS_FS is not set # CONFIG_HFSPLUS_FS is not set # CONFIG_BEFS_FS is not set # CONFIG_BFS_FS is not set # CONFIG_EFS_FS is not set # CONFIG_CRAMFS is not set # CONFIG_VXFS_FS is not set # CONFIG_HPFS_FS is not set # CONFIG_QNX4FS_FS is not set # CONFIG_SYSV_FS is not set # CONFIG_UFS_FS is not set # # Network File Systems # # CONFIG_NFS_FS is not set # CONFIG_NFSD is not set CONFIG_SMB_FS=m # CONFIG_SMB_NLS_DEFAULT is not set # CONFIG_CIFS is not set # CONFIG_NCP_FS is not set # CONFIG_CODA_FS is not set # CONFIG_AFS_FS is not set # # Partition Types # CONFIG_PARTITION_ADVANCED=y # CONFIG_ACORN_PARTITION is not set # CONFIG_OSF_PARTITION is not set # CONFIG_AMIGA_PARTITION is not set # CONFIG_ATARI_PARTITION is not set CONFIG_MAC_PARTITION=y CONFIG_MSDOS_PARTITION=y CONFIG_BSD_DISKLABEL=y CONFIG_MINIX_SUBPARTITION=y CONFIG_SOLARIS_X86_PARTITION=y CONFIG_UNIXWARE_DISKLABEL=y CONFIG_LDM_PARTITION=y # CONFIG_LDM_DEBUG is not set CONFIG_SGI_PARTITION=y # CONFIG_ULTRIX_PARTITION is not set CONFIG_SUN_PARTITION=y # CONFIG_EFI_PARTITION is not set # # Native Language Support # CONFIG_NLS=y CONFIG_NLS_DEFAULT="utf8" CONFIG_NLS_CODEPAGE_437=m CONFIG_NLS_CODEPAGE_737=m CONFIG_NLS_CODEPAGE_775=m CONFIG_NLS_CODEPAGE_850=m CONFIG_NLS_CODEPAGE_852=m CONFIG_NLS_CODEPAGE_855=m CONFIG_NLS_CODEPAGE_857=m CONFIG_NLS_CODEPAGE_860=m CONFIG_NLS_CODEPAGE_861=m CONFIG_NLS_CODEPAGE_862=m CONFIG_NLS_CODEPAGE_863=m CONFIG_NLS_CODEPAGE_864=m CONFIG_NLS_CODEPAGE_865=m CONFIG_NLS_CODEPAGE_866=m CONFIG_NLS_CODEPAGE_869=m CONFIG_NLS_CODEPAGE_936=m CONFIG_NLS_CODEPAGE_950=m CONFIG_NLS_CODEPAGE_932=m CONFIG_NLS_CODEPAGE_949=m CONFIG_NLS_CODEPAGE_874=m CONFIG_NLS_ISO8859_8=m CONFIG_NLS_CODEPAGE_1250=m CONFIG_NLS_CODEPAGE_1251=m CONFIG_NLS_ASCII=m CONFIG_NLS_ISO8859_1=m CONFIG_NLS_ISO8859_2=m CONFIG_NLS_ISO8859_3=m CONFIG_NLS_ISO8859_4=m CONFIG_NLS_ISO8859_5=m CONFIG_NLS_ISO8859_6=m CONFIG_NLS_ISO8859_7=m CONFIG_NLS_ISO8859_9=m CONFIG_NLS_ISO8859_13=m CONFIG_NLS_ISO8859_14=m CONFIG_NLS_ISO8859_15=m CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m CONFIG_NLS_UTF8=m # # Profiling support # CONFIG_PROFILING=y CONFIG_OPROFILE=m # # Kernel hacking # CONFIG_PRINTK_TIME=y CONFIG_DEBUG_KERNEL=y CONFIG_MAGIC_SYSRQ=y CONFIG_LOG_BUF_SHIFT=14 # CONFIG_SCHEDSTATS is not set # CONFIG_DEBUG_SLAB is not set CONFIG_DEBUG_PREEMPT=y # CONFIG_DEBUG_SPINLOCK is not set # CONFIG_DEBUG_SPINLOCK_SLEEP is not set # CONFIG_DEBUG_KOBJECT is not set # CONFIG_DEBUG_INFO is not set # CONFIG_DEBUG_FS is not set # CONFIG_CHECKING is not set # CONFIG_INIT_DEBUG is not set # CONFIG_IOMMU_DEBUG is not set CONFIG_KPROBES=y # # Security options # # CONFIG_KEYS is not set # CONFIG_SECURITY is not set # # Cryptographic options # CONFIG_CRYPTO=y CONFIG_CRYPTO_HMAC=y # CONFIG_CRYPTO_NULL is not set # CONFIG_CRYPTO_MD4 is not set CONFIG_CRYPTO_MD5=y CONFIG_CRYPTO_SHA1=m # CONFIG_CRYPTO_SHA256 is not set # CONFIG_CRYPTO_SHA512 is not set # CONFIG_CRYPTO_WP512 is not set # CONFIG_CRYPTO_TGR192 is not set CONFIG_CRYPTO_DES=m CONFIG_CRYPTO_BLOWFISH=y # CONFIG_CRYPTO_TWOFISH is not set # CONFIG_CRYPTO_SERPENT is not set CONFIG_CRYPTO_AES=y # CONFIG_CRYPTO_CAST5 is not set # CONFIG_CRYPTO_CAST6 is not set # CONFIG_CRYPTO_TEA is not set # CONFIG_CRYPTO_ARC4 is not set # CONFIG_CRYPTO_KHAZAD is not set # CONFIG_CRYPTO_ANUBIS is not set CONFIG_CRYPTO_DEFLATE=m # CONFIG_CRYPTO_MICHAEL_MIC is not set CONFIG_CRYPTO_CRC32C=y # CONFIG_CRYPTO_TEST is not set # # Hardware crypto devices # # # Library routines # CONFIG_CRC_CCITT=y CONFIG_CRC32=y CONFIG_LIBCRC32C=y CONFIG_ZLIB_INFLATE=y CONFIG_ZLIB_DEFLATE=m ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-04 18:40 ` Parag Warudkar @ 2005-06-05 11:28 ` Andi Kleen 2005-06-05 14:15 ` Parag Warudkar 0 siblings, 1 reply; 42+ messages in thread From: Andi Kleen @ 2005-06-05 11:28 UTC (permalink / raw) To: Parag Warudkar Cc: Andi Kleen, john stultz, Nishanth Aravamudan, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh > There I complain :):) - There is something wrong with this timer stuff in rc5. > I earlier stated that running with rc5 + John's TOD patches makes the music > players play music fast. It actually happens with plain vanilla rc5 too. (I > was having 3-4 ?trees and some confusion when I earlier tested rc5 with > John's patches.) Do you actually use pmtimer? Please send a dmesg log. Also note that pmtimer does not even drive the timer interrupt, just gettimeofday. -Andi ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-05 11:28 ` Andi Kleen @ 2005-06-05 14:15 ` Parag Warudkar 2005-06-05 20:51 ` Lee Revell 2005-06-06 9:29 ` Andi Kleen 0 siblings, 2 replies; 42+ messages in thread From: Parag Warudkar @ 2005-06-05 14:15 UTC (permalink / raw) To: Andi Kleen Cc: john stultz, Nishanth Aravamudan, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh [-- Attachment #1: Type: text/plain, Size: 1097 bytes --] On Sunday 05 June 2005 07:28, Andi Kleen wrote: > Do you actually use pmtimer? Please send a dmesg log. > Full dmesg attached - 2.6.12-rc5 seems to use pmtimer. From 2.6.12-rc5 - --------------------------------------- Jun 5 10:04:04 tux-gentoo [ 0.000000] time.c: Using 3.579545 MHz PM timer. Jun 5 10:04:04 tux-gentoo [ 0.000000] time.c: Detected 797.956 MHz processor. Jun 5 10:04:04 tux-gentoo [ 14.020805] time.c: Using PIT/TSC based timekeeping. And from 2.6.11-gentoo --------------------------------------- May 3 22:31:03 tux-gentoo time.c: Using 1.193182 MHz PIT timer. May 3 22:31:03 tux-gentoo time.c: Detected 1994.883 MHz processor. The differences in PM Timer MHz - is something wrong there? They seem to be dependent on processor MHz which is 797 MHz (lowest cpufreq) in 2.6.12-rc5 and 1994 MHz (Highest cpufreq) on 2.6.11. > Also note that pmtimer does not even drive the timer interrupt, > just gettimeofday. Could it be that the music players use gettimeofday() for time keeping? Sure enough they are broken with -rc5. Parag [-- Attachment #2: dm.out --] [-- Type: text/plain, Size: 15901 bytes --] id[0x00] lapic_id[0x00] enabled) [ 0.000000] Processor #0 15:4 APIC version 16 [ 0.000000] ACPI: LAPIC_NMI (acpi_id[0x00] high edge lint[0x1]) [ 0.000000] ACPI: IOAPIC (id[0x02] address[0xfec00000] gsi_base[0]) [ 0.000000] IOAPIC[0]: apic_id 2, version 17, address 0xfec00000, GSI 0-23 [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 low level) [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) [ 0.000000] ACPI: BIOS IRQ0 pin2 override ignored. [ 0.000000] ACPI: IRQ9 used by override. [ 0.000000] Setting APIC routing to flat [ 0.000000] Using ACPI (MADT) for SMP configuration information [ 0.000000] Allocating PCI resources starting at 30000000 (gap: 30000000:cff80000) [ 0.000000] Checking aperture... [ 0.000000] CPU 0: aperture @ e8000000 size 128 MB [ 0.000000] Built 1 zonelists [ 0.000000] Kernel command line: root=/dev/hda2 vga=0x317 video=vesafb:ywrap,mtrr [ 0.000000] Initializing CPU#0 [ 0.000000] PID hash table entries: 4096 (order: 12, 131072 bytes) [ 0.000000] time.c: Using 3.579545 MHz PM timer. [ 0.000000] time.c: Detected 797.956 MHz processor. [ 14.020805] time.c: Using PIT/TSC based timekeeping. [ 14.020847] Console: colour dummy device 80x25 [ 14.022212] Dentry cache hash table entries: 131072 (order: 8, 1048576 bytes) [ 14.023558] Inode-cache hash table entries: 65536 (order: 7, 524288 bytes) [ 14.049027] Memory: 767948k/785856k available (2988k kernel code, 17204k reserved, 1244k data, 184k init) [ 14.049137] Calibrating delay loop... 1581.05 BogoMIPS (lpj=790528) [ 14.071862] Mount-cache hash table entries: 256 [ 14.072002] CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) [ 14.072014] CPU: L2 Cache: 1024K (64 bytes/line) [ 14.072026] CPU: AMD Athlon(tm) 64 Processor 3200+ stepping 08 [ 14.123727] Using local APIC timer interrupts. [ 14.249130] Detected 12.468 MHz APIC timer. [ 14.249150] testing NMI watchdog ... OK. [ 14.259568] NET: Registered protocol family 16 [ 14.259616] PCI: Using configuration type 1 [ 14.259625] mtrr: v2.0 (20020519) [ 14.260253] ACPI: Subsystem revision 20050309 [ 14.291197] ACPI: Interpreter enabled [ 14.291208] ACPI: Using IOAPIC for interrupt routing [ 14.291937] ACPI: PCI Root Bridge [PCI0] (0000:00) [ 14.291949] PCI: Probing PCI hardware (bus 00) [ 14.293033] Boot video device is 0000:01:00.0 [ 14.294186] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0._PRT] [ 14.296247] ACPI: Embedded Controller [EC0] (gpe 33) [ 14.342234] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.P2P0._PRT] [ 14.342704] ACPI: PCI Interrupt Routing Table [\_SB_.PCI0.AGP0._PRT] [ 14.343933] ACPI: PCI Interrupt Link [LNK1] (IRQs 16 18 19) *0 [ 14.344618] ACPI: PCI Interrupt Link [LNK2] (IRQs 16 18 19) *0 [ 14.345313] ACPI: PCI Interrupt Link [LNK3] (IRQs 17) *0 [ 14.346004] ACPI: PCI Interrupt Link [LNK4] (IRQs 16 18 19) *0, disabled. [ 14.346689] ACPI: PCI Interrupt Link [LNK5] (IRQs 16 18 19) *0 [ 14.347367] ACPI: PCI Interrupt Link [LSMB] (IRQs 20 21 22) *0 [ 14.348038] ACPI: PCI Interrupt Link [LUS0] (IRQs 20 21 22) *0 [ 14.348707] ACPI: PCI Interrupt Link [LUS1] (IRQs 20 21 22) *0 [ 14.349381] ACPI: PCI Interrupt Link [LUS2] (IRQs 20 21 22) *0 [ 14.350059] ACPI: PCI Interrupt Link [LMAC] (IRQs 20 21 22) *0, disabled. [ 14.350731] ACPI: PCI Interrupt Link [LACI] (IRQs 20 21 22) *0 [ 14.351410] ACPI: PCI Interrupt Link [LMCI] (IRQs 20 21 22) *0 [ 14.352093] ACPI: PCI Interrupt Link [LPID] (IRQs 20 21 22) *0, disabled. [ 14.352781] ACPI: PCI Interrupt Link [LTID] (IRQs 20 21 22) *0, disabled. [ 14.353227] SCSI subsystem initialized [ 14.353305] PCI: Using ACPI for IRQ routing [ 14.353315] PCI: If a device doesn't work, try "pci=routeirq". If it helps, post a report [ 14.353403] TC classifier action (bugs to netdev@oss.sgi.com cc hadi@cyberus.ca) [ 14.353462] agpgart: Detected AGP bridge 0 [ 14.353476] agpgart: Setting up Nforce3 AGP. [ 14.360612] agpgart: AGP aperture is 128M @ 0xe8000000 [ 14.360650] PCI-DMA: Disabling IOMMU. [ 14.362164] Simple Boot Flag at 0x37 set to 0x1 [ 14.362362] IA32 emulation $Id: sys_ia32.c,v 1.32 2002/03/24 13:02:28 ak Exp $ [ 14.363662] SGI XFS with ACLs, large block/inode numbers, no debug enabled [ 14.363826] Initializing Cryptographic API [ 14.363988] pci_hotplug: PCI Hot Plug PCI Core version: 0.5 [ 14.363997] acpiphp: ACPI Hot Plug PCI Controller Driver version: 0.4 [ 14.364250] vesafb: framebuffer at 0xf0000000, mapped to 0xffffc20000100000, using 3072k, total 65536k [ 14.364268] vesafb: mode is 1024x768x16, linelength=2048, pages=1 [ 14.364276] vesafb: scrolling: redraw [ 14.364285] vesafb: Truecolor: size=0:5:6:5, shift=0:11:5:0 [ 14.379417] Console: switching to colour frame buffer device 128x48 [ 14.379519] fb0: VESA VGA frame buffer device [ 14.380896] ACPI: AC Adapter [ACAD] (on-line) [ 14.490704] ACPI: Battery Slot [BAT1] (battery present) [ 14.490808] ACPI: Power Button (FF) [PWRF] [ 14.490882] ACPI: Lid Switch [LID] [ 14.491495] ACPI: Video Device [VGA] (multi-head: yes rom: no post: no) [ 14.492706] ACPI: CPU0 (power states: C1[C1] C2[C2]) [ 14.503781] ACPI: Thermal Zone [THRM] (49 C) [ 14.527634] Real Time Clock Driver v1.12 [ 14.527783] Non-volatile memory driver v1.2 [ 14.527858] Linux agpgart interface v0.101 (c) Dave Jones [ 14.527955] [drm] Initialized drm 1.0.0 20040925 [ 14.536630] i8042.c: Detected active multiplexing controller, rev 1.1. [ 14.541623] serio: i8042 AUX0 port at 0x60,0x64 irq 12 [ 14.544230] serio: i8042 AUX1 port at 0x60,0x64 irq 12 [ 14.544922] serio: i8042 AUX2 port at 0x60,0x64 irq 12 [ 14.545923] serio: i8042 AUX3 port at 0x60,0x64 irq 12 [ 14.546620] serio: i8042 KBD port at 0x60,0x64 irq 1 [ 14.549091] Serial: 8250/16550 driver $Revision: 1.90 $ 8 ports, IRQ sharing disabled [ 14.553242] ACPI: PCI Interrupt Link [LMCI] enabled at IRQ 22 [ 14.555816] ACPI: PCI Interrupt 0000:00:06.1[B] -> Link [LMCI] -> GSI 22 (level, low) -> IRQ 22 [ 14.558482] io scheduler noop registered [ 14.561096] io scheduler anticipatory registered [ 14.563659] io scheduler deadline registered [ 14.566185] io scheduler cfq registered [ 14.569255] RAMDISK driver initialized: 16 RAM disks of 8192K size 1024 blocksize [ 14.572139] loop: loaded (max 8 devices) [ 14.574807] Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2 [ 14.577388] ide: Assuming 33MHz system bus speed for PIO modes; override with idebus=xx [ 14.580068] NFORCE3-150: IDE controller at PCI slot 0000:00:08.0 [ 14.582717] Losing some ticks... checking if CPU frequency changed. [ 14.582743] NFORCE3-150: chipset revision 165 [ 14.585354] NFORCE3-150: not 100% native mode: will probe irqs later [ 14.587971] NFORCE3-150: BIOS didn't set cable bits correctly. Enabling workaround. [ 14.590598] NFORCE3-150: 0000:00:08.0 (rev a5) UDMA133 controller [ 14.593207] ide0: BM-DMA at 0x2080-0x2087, BIOS settings: hda:DMA, hdb:pio [ 14.595940] ide1: BM-DMA at 0x2088-0x208f, BIOS settings: hdc:DMA, hdd:pio [ 14.598624] Probing IDE interface ide0... [ 14.862207] hda: FUJITSU MHT2060AT PL, ATA DISK drive [ 15.480618] ide0 at 0x1f0-0x1f7,0x3f6 on irq 14 [ 15.483282] Probing IDE interface ide1... [ 16.154712] hdc: HL-DT-ST DVD+RW GCA-4040N, ATAPI CD/DVD-ROM drive [ 16.463014] ide1 at 0x170-0x177,0x376 on irq 15 [ 16.465842] Probing IDE interface ide2... [ 16.978947] Probing IDE interface ide3... [ 17.491146] Probing IDE interface ide4... [ 18.003347] Probing IDE interface ide5... [ 18.515569] hda: max request size: 128KiB [ 18.589874] hda: 117210240 sectors (60011 MB) w/8192KiB Cache, CHS=65535/16/63, UDMA(100) [ 18.595599] hda: cache flushes supported [ 18.598307] hda: hda1 hda2 hda3 hda4 [ 18.639056] hdc: ATAPI 24X DVD-ROM CD-R/RW drive, 2048kB Cache, DMA [ 18.641680] Uniform CD-ROM driver Revision: 3.20 [ 18.646342] mice: PS/2 mouse device common for all mice [ 18.649010] Advanced Linux Sound Architecture Driver Version 1.0.9rc2 (Thu Mar 24 10:33:39 2005 UTC). [ 18.653060] ALSA device list: [ 18.655739] No soundcards found. [ 18.658428] NET: Registered protocol family 2 [ 18.670369] IP: routing cache hash table of 8192 buckets, 64Kbytes [ 18.673378] TCP established hash table entries: 131072 (order: 8, 1048576 bytes) [ 18.677298] TCP bind hash table entries: 65536 (order: 7, 524288 bytes) [ 18.680836] TCP: Hash tables configured (established 131072 bind 65536) [ 18.683748] NET: Registered protocol family 1 [ 18.686579] NET: Registered protocol family 10 [ 18.689535] Disabled Privacy Extensions on device ffffffff804d4f40(lo) [ 18.692547] IPv6 over IPv4 tunneling driver [ 18.695622] NET: Registered protocol family 17 [ 18.698491] NET: Registered protocol family 15 [ 18.702516] powernow-k8: Found 1 AMD Athlon 64 / Opteron processors (version 1.00.09e) [ 18.707347] powernow-k8: 0 : fid 0xc (2000 MHz), vid 0x2 (1500 mV) [ 18.710312] powernow-k8: 1 : fid 0x8 (1600 MHz), vid 0xa (1300 mV) [ 18.713133] powernow-k8: 2 : fid 0x0 (800 MHz), vid 0x12 (1100 mV) [ 18.715959] cpu_init done, current fid 0x0, vid 0x12 [ 18.723803] ACPI wakeup devices: [ 18.730427] USB0 USB1 USB2 PS2K PS2M MAC0 [ 18.737028] ACPI: (supports S0 S3 S4 S5) [ 18.743579] BIOS EDD facility v0.16 2004-Jun-25, 1 devices found [ 18.786926] input: AT Translated Set 2 keyboard on isa0060/serio0 [ 18.824816] ReiserFS: hda2: found reiserfs format "3.6" with standard journal [ 23.626367] ReiserFS: hda2: using ordered data mode [ 23.670621] ReiserFS: hda2: journal params: device hda2, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30 [ 23.689259] ReiserFS: hda2: checking transaction log (hda2) [ 23.886849] ReiserFS: hda2: Using r5 hash to sort names [ 23.893548] VFS: Mounted root (reiserfs filesystem) readonly. [ 23.900826] Freeing unused kernel memory: 184k freed [ 32.416092] Adding 2241056k swap on /dev/hda4. Priority:-1 extents:1 [ 50.875537] 8139too Fast Ethernet driver 0.9.27 [ 50.890016] ACPI: PCI Interrupt Link [LNK2] enabled at IRQ 19 [ 50.890040] ACPI: PCI Interrupt 0000:02:01.0[A] -> Link [LNK2] -> GSI 19 (level, low) -> IRQ 19 [ 50.897072] eth0: RealTek RTL8139 at 0xffffc2000004e800, 00:0f:b0:01:01:65, IRQ 19 [ 50.897082] eth0: Identified 8139 chip type 'RTL-8101' [ 51.234948] input: PS/2 Generic Mouse on isa0060/serio4 [ 59.845023] NTFS driver 2.1.22 [Flags: R/O MODULE]. [ 60.530597] NTFS volume version 3.1. [ 60.601686] ReiserFS: hda3: found reiserfs format "3.6" with standard journal [ 60.603757] ReiserFS: hda3: using ordered data mode [ 60.604511] ReiserFS: hda3: journal params: device hda3, size 8192, journal first block 18, max trans len 1024, max batch 900, max commit age 30, max trans age 30 [ 60.608739] ReiserFS: hda3: checking transaction log (hda3) [ 62.319226] ReiserFS: hda3: Using r5 hash to sort names [ 62.584642] usbcore: registered new driver usbfs [ 62.610782] usbcore: registered new driver hub [ 64.290816] eth0: link up, 10Mbps, half-duplex, lpa 0x0000 [ 72.660618] ACPI: PCI Interrupt Link [LUS2] enabled at IRQ 21 [ 72.661010] ACPI: PCI Interrupt 0000:00:02.2[C] -> Link [LUS2] -> GSI 21 (level, low) -> IRQ 21 [ 72.661192] PCI: Setting latency timer of device 0000:00:02.2 to 64 [ 72.661306] ehci_hcd 0000:00:02.2: nVidia Corporation nForce3 USB 2.0 [ 72.689419] ehci_hcd 0000:00:02.2: new USB bus registered, assigned bus number 1 [ 72.689791] ehci_hcd 0000:00:02.2: irq 21, io mem 0xe0004000 [ 72.689969] PCI: cache line size of 64 is not supported by device 0000:00:02.2 [ 72.690078] ehci_hcd 0000:00:02.2: park 0 [ 72.690199] ehci_hcd 0000:00:02.2: USB 2.0 initialized, EHCI 1.00, driver 10 Dec 2004 [ 72.704293] hub 1-0:1.0: USB hub found [ 72.704640] hub 1-0:1.0: 6 ports detected [ 74.918764] i2c_adapter i2c-0: nForce2 SMBus adapter at 0x2040 [ 74.944919] i2c_adapter i2c-1: nForce2 SMBus adapter at 0x2000 [ 75.219764] ohci_hcd: 2004 Nov 08 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI) [ 75.245808] PCI: Enabling device 0000:00:02.0 (0004 -> 0006) [ 75.247239] ACPI: PCI Interrupt Link [LUS0] enabled at IRQ 20 [ 75.247379] ACPI: PCI Interrupt 0000:00:02.0[A] -> Link [LUS0] -> GSI 20 (level, low) -> IRQ 20 [ 75.247553] PCI: Setting latency timer of device 0000:00:02.0 to 64 [ 75.247662] ohci_hcd 0000:00:02.0: nVidia Corporation nForce3 USB 1.1 [ 75.782732] ohci_hcd 0000:00:02.0: new USB bus registered, assigned bus number 2 [ 75.783105] ohci_hcd 0000:00:02.0: irq 20, io mem 0xe0000000 [ 75.927665] hub 2-0:1.0: USB hub found [ 75.928014] hub 2-0:1.0: 3 ports detected [ 75.934011] PCI: Enabling device 0000:00:02.1 (0004 -> 0006) [ 75.935138] ACPI: PCI Interrupt Link [LUS1] enabled at IRQ 22 [ 75.935263] ACPI: PCI Interrupt 0000:00:02.1[B] -> Link [LUS1] -> GSI 22 (level, low) -> IRQ 22 [ 75.935431] PCI: Setting latency timer of device 0000:00:02.1 to 64 [ 75.935538] ohci_hcd 0000:00:02.1: nVidia Corporation nForce3 USB 1.1 (#2) [ 76.527343] ohci_hcd 0000:00:02.1: new USB bus registered, assigned bus number 3 [ 76.527714] ohci_hcd 0000:00:02.1: irq 22, io mem 0xe0001000 [ 77.073071] hub 3-0:1.0: USB hub found [ 77.073424] hub 3-0:1.0: 3 ports detected [ 78.087273] usb 3-1: new low speed USB device using ohci_hcd and address 2 [ 78.854488] usbcore: registered new driver hiddev [ 78.936150] ACPI: PCI Interrupt Link [LACI] enabled at IRQ 21 [ 78.936505] ACPI: PCI Interrupt 0000:00:06.0[A] -> Link [LACI] -> GSI 21 (level, low) -> IRQ 21 [ 78.936687] PCI: Setting latency timer of device 0000:00:06.0 to 64 [ 79.035096] input: USB HID v1.11 Mouse [Microsoft Microsoft Wireless Optical Mouse® 1.0A] on usb-0000:00:02.1-1 [ 79.035302] usbcore: registered new driver usbhid [ 79.035399] drivers/usb/input/hid-core.c: v2.01:USB HID core driver [ 80.740808] intel8x0_measure_ac97_clock: measured 49384 usecs [ 80.741165] intel8x0: clocking to 47409 [ 81.464847] ACPI: PCI Interrupt 0000:00:06.1[B] -> Link [LMCI] -> GSI 22 (level, low) -> IRQ 22 [ 81.465438] PCI: Setting latency timer of device 0000:00:06.1 to 64 [ 81.939052] libata version 1.10 loaded. [ 84.554628] ieee1394: Initialized config rom entry `ip1394' [ 84.609398] ohci1394: $Rev: 1250 $ Ben Collins <bcollins@debian.org> [ 84.610734] ACPI: PCI Interrupt Link [LNK1] enabled at IRQ 18 [ 84.610871] ACPI: PCI Interrupt 0000:02:00.0[A] -> Link [LNK1] -> GSI 18 (level, low) -> IRQ 18 [ 84.766166] ohci1394: fw-host0: OHCI-1394 1.1 (PCI): IRQ=[18] MMIO=[e0108000-e01087ff] Max Packet=[2048] [ 85.085423] 8139cp: 10/100 PCI Ethernet driver v1.2 (Mar 22, 2004) [ 86.750731] USB Universal Host Controller Interface driver v2.2 [ 87.937108] ieee1394: Host added: ID:BUS[0-00:1023] GUID[463f0200463f0200] [ 88.019837] eth1394: $Rev: 1247 $ Ben Collins <bcollins@debian.org> [ 88.026653] eth1394: eth1: IEEE-1394 IPv4 over 1394 Ethernet (fw-host0) [ 104.291844] eth0: link up, 10Mbps, half-duplex, lpa 0x0000 [ 108.976114] powernowd[10717]: segfault at 00002aaaaacbe7c3 rip 00002aaaaac03b2e rsp 00007fffff99deb0 error 7 [ 130.985451] eth0: no IPv6 routers present [ 356.893427] codec_semaphore: semaphore is not ready [0x1][0x301300] [ 356.893844] codec_read 0: semaphore is not ready for register 0x76 [ 356.896684] codec_semaphore: semaphore is not ready [0x1][0x301300] [ 356.896919] codec_read 1: semaphore is not ready for register 0x54 ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-05 14:15 ` Parag Warudkar @ 2005-06-05 20:51 ` Lee Revell 2005-06-05 21:41 ` Parag Warudkar 2005-06-06 9:29 ` Andi Kleen 1 sibling, 1 reply; 42+ messages in thread From: Lee Revell @ 2005-06-05 20:51 UTC (permalink / raw) To: Parag Warudkar Cc: Andi Kleen, john stultz, Nishanth Aravamudan, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Sun, 2005-06-05 at 10:15 -0400, Parag Warudkar wrote: > > Also note that pmtimer does not even drive the timer interrupt, > > just gettimeofday. > > Could it be that the music players use gettimeofday() for time keeping? Sure > enough they are broken with -rc5. Well, that would be a broken design anyway. That's what the ALSA timer API is for. But XMMS has a long history of buggy ALSA support anyway. Do you get the same result with native OSS, ALSA OSS emulation, and native ALSA? Lee ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-05 20:51 ` Lee Revell @ 2005-06-05 21:41 ` Parag Warudkar 2005-06-05 22:13 ` Lee Revell 0 siblings, 1 reply; 42+ messages in thread From: Parag Warudkar @ 2005-06-05 21:41 UTC (permalink / raw) To: Lee Revell Cc: Andi Kleen, john stultz, Nishanth Aravamudan, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Sunday 05 June 2005 16:51, Lee Revell wrote: > Well, that would be a broken design anyway. That's what the ALSA timer > API is for. But XMMS has a long history of buggy ALSA support anyway. > I am not sure they use gettimeofday(). Pardon my ignorance but why is it broken for them to use gettimeofday()? > Do you get the same result with native OSS, ALSA OSS emulation, and > native ALSA? I am not sure about OSS and ALSA OSS emulation but I tried XMMS with ALSA output plugin and Juk and amaroK with GStreamer/alsasink. All of them have the same problem. Parag ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-05 21:41 ` Parag Warudkar @ 2005-06-05 22:13 ` Lee Revell 0 siblings, 0 replies; 42+ messages in thread From: Lee Revell @ 2005-06-05 22:13 UTC (permalink / raw) To: Parag Warudkar Cc: Andi Kleen, john stultz, Nishanth Aravamudan, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Sun, 2005-06-05 at 17:41 -0400, Parag Warudkar wrote: > On Sunday 05 June 2005 16:51, Lee Revell wrote: > > Well, that would be a broken design anyway. That's what the ALSA timer > > API is for. But XMMS has a long history of buggy ALSA support anyway. > > > > I am not sure they use gettimeofday(). Pardon my ignorance but why is it > broken for them to use gettimeofday()? If they're trying to synchronize other things to the sound, gettimeofday() is a poor choice because it's driven by a different crystal than the soundcard. The correct solution is to use a PCM slave timer. See alsa-lib/examples/timer.c. Lee ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-05 14:15 ` Parag Warudkar 2005-06-05 20:51 ` Lee Revell @ 2005-06-06 9:29 ` Andi Kleen 2005-06-06 11:46 ` Parag Warudkar 1 sibling, 1 reply; 42+ messages in thread From: Andi Kleen @ 2005-06-06 9:29 UTC (permalink / raw) To: Parag Warudkar; +Cc: johnstul, linux-kernel cc list trimmed. John please dont send out mails with such a horrible cc list anymore. On Sun, Jun 05, 2005 at 10:15:33AM -0400, Parag Warudkar wrote: > On Sunday 05 June 2005 07:28, Andi Kleen wrote: > > Do you actually use pmtimer? Please send a dmesg log. > > > Full dmesg attached - 2.6.12-rc5 seems to use pmtimer. And does it work with nopmtimer ? -Andi > > From 2.6.12-rc5 - > --------------------------------------- > Jun 5 10:04:04 tux-gentoo [ 0.000000] time.c: Using 3.579545 MHz PM timer. > Jun 5 10:04:04 tux-gentoo [ 0.000000] time.c: Detected 797.956 MHz > processor. > Jun 5 10:04:04 tux-gentoo [ 14.020805] time.c: Using PIT/TSC based > timekeeping. ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-06 9:29 ` Andi Kleen @ 2005-06-06 11:46 ` Parag Warudkar 2005-06-08 13:51 ` Andi Kleen 0 siblings, 1 reply; 42+ messages in thread From: Parag Warudkar @ 2005-06-06 11:46 UTC (permalink / raw) To: Andi Kleen; +Cc: johnstul, linux-kernel On Monday 06 June 2005 05:29, Andi Kleen wrote: > And does it work with nopmtimer ? > > -Andi Thanks for trimming the CC list. No it doesn't work with nopmtimer - music still plays fast. I have to go back to 2.6.11 to get it to play at right speed. Relevant lines from rc5 with nopmtimer - Jun 6 07:11:59 tux-gentoo [ 0.000000] time.c: Using 1.193182 MHz PIT timer. Jun 6 07:11:59 tux-gentoo [ 0.000000] time.c: Detected 797.952 MHz processor. Jun 6 07:11:59 tux-gentoo [ 22.152032] time.c: Using PIT/TSC based timekeeping. Parag ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-06 11:46 ` Parag Warudkar @ 2005-06-08 13:51 ` Andi Kleen 2005-06-09 1:47 ` Lee Revell 0 siblings, 1 reply; 42+ messages in thread From: Andi Kleen @ 2005-06-08 13:51 UTC (permalink / raw) To: Parag Warudkar; +Cc: Andi Kleen, johnstul, linux-kernel On Mon, Jun 06, 2005 at 07:46:22AM -0400, Parag Warudkar wrote: > On Monday 06 June 2005 05:29, Andi Kleen wrote: > > And does it work with nopmtimer ? > > > > -Andi > > Thanks for trimming the CC list. > > No it doesn't work with nopmtimer - music still plays fast. I have to go back > to 2.6.11 to get it to play at right speed. Then it is something else, not the pmtimer. I dont know what it could be. Do a binary search? -Andi > > Relevant lines from rc5 with nopmtimer - > > Jun 6 07:11:59 tux-gentoo [ 0.000000] time.c: Using 1.193182 MHz PIT > timer. > Jun 6 07:11:59 tux-gentoo [ 0.000000] time.c: Detected 797.952 MHz > processor. > Jun 6 07:11:59 tux-gentoo [ 22.152032] time.c: Using PIT/TSC based > timekeeping. > > > Parag ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-08 13:51 ` Andi Kleen @ 2005-06-09 1:47 ` Lee Revell 2005-06-09 2:12 ` john stultz 0 siblings, 1 reply; 42+ messages in thread From: Lee Revell @ 2005-06-09 1:47 UTC (permalink / raw) To: Andi Kleen; +Cc: Parag Warudkar, johnstul, linux-kernel On Wed, 2005-06-08 at 15:51 +0200, Andi Kleen wrote: > On Mon, Jun 06, 2005 at 07:46:22AM -0400, Parag Warudkar wrote: > > On Monday 06 June 2005 05:29, Andi Kleen wrote: > > > And does it work with nopmtimer ? > > > > > > -Andi > > > > Thanks for trimming the CC list. > > > > No it doesn't work with nopmtimer - music still plays fast. I have to go back > > to 2.6.11 to get it to play at right speed. > > Then it is something else, not the pmtimer. > > I dont know what it could be. Do a binary search? XMMS has a long history of buggy ALSA support, which has improved lately. Make sure you're using the latest version. Also try 2.6.11 with ALSA 1.0.9, maybe it's an interaction between ALSA and the new gettimeofday patches. Lee ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-09 1:47 ` Lee Revell @ 2005-06-09 2:12 ` john stultz 2005-06-09 2:42 ` Parag Warudkar 2005-06-09 14:17 ` Andi Kleen 0 siblings, 2 replies; 42+ messages in thread From: john stultz @ 2005-06-09 2:12 UTC (permalink / raw) To: Lee Revell; +Cc: Andi Kleen, Parag Warudkar, lkml On Wed, 2005-06-08 at 21:47 -0400, Lee Revell wrote: > On Wed, 2005-06-08 at 15:51 +0200, Andi Kleen wrote: > > On Mon, Jun 06, 2005 at 07:46:22AM -0400, Parag Warudkar wrote: > > > On Monday 06 June 2005 05:29, Andi Kleen wrote: > > > > And does it work with nopmtimer ? > > > > > > > > -Andi > > > > > > Thanks for trimming the CC list. > > > > > > No it doesn't work with nopmtimer - music still plays fast. I have to go back > > > to 2.6.11 to get it to play at right speed. > > > > Then it is something else, not the pmtimer. > > > > I dont know what it could be. Do a binary search? > > XMMS has a long history of buggy ALSA support, which has improved > lately. Make sure you're using the latest version. > > Also try 2.6.11 with ALSA 1.0.9, maybe it's an interaction between ALSA > and the new gettimeofday patches. Wahzuntme! :) Well, I'd be very interested if my patches were to blame, but I believe Parag said it happened with or without my patches. Parag: If I'm incorrect and the issue goes away without my patches, please let me know as I want to get to the bottom of it. thanks -john ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-09 2:12 ` john stultz @ 2005-06-09 2:42 ` Parag Warudkar 2005-06-09 14:17 ` Andi Kleen 1 sibling, 0 replies; 42+ messages in thread From: Parag Warudkar @ 2005-06-09 2:42 UTC (permalink / raw) To: john stultz; +Cc: Lee Revell, Andi Kleen, lkml >>On Wednesday 08 June 2005 21:47, Lee Revell wrote: > > Also try 2.6.11 with ALSA 1.0.9, maybe it's an interaction between ALSA > > and the new gettimeofday patches. I am using 2.6.11 and ALSA 1.0.8 - no problem there. Will try with -rc5 and ALSA 1.0.9 to see if that makes any difference. >On Wednesday 08 June 2005 22:12, john stultz wrote: > > Wahzuntme! :):) Well, I'd be very interested if my patches were to blame, > but I believe Parag said it happened with or without my patches. You are right - it happens regardless of whether TOD patches are applied or not - So you are free to work upon a super fast TOD while we work upon the super fast music! :) Parag ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-09 2:12 ` john stultz 2005-06-09 2:42 ` Parag Warudkar @ 2005-06-09 14:17 ` Andi Kleen 1 sibling, 0 replies; 42+ messages in thread From: Andi Kleen @ 2005-06-09 14:17 UTC (permalink / raw) To: john stultz; +Cc: Lee Revell, Andi Kleen, Parag Warudkar, lkml > Wahzuntme! :) Well, I'd be very interested if my patches were to blame, > but I believe Parag said it happened with or without my patches. Yes, he said it happened with plain rc5. -Andi ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-02 23:20 ` john stultz 2005-06-02 23:33 ` Parag Warudkar 2005-06-02 23:50 ` Parag Warudkar @ 2005-06-03 13:32 ` Parag Warudkar 2 siblings, 0 replies; 42+ messages in thread From: Parag Warudkar @ 2005-06-03 13:32 UTC (permalink / raw) To: john stultz Cc: Nishanth Aravamudan, Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Thursday 02 June 2005 19:20, john stultz wrote: > Could you see if the slowness you're feeling is correlated to the > acpi_pm timesource? OK. I've to admit - I am not able to quantify the differences in snappiness after trying hard to switch between vanilla rc5 and rc5-TOD with acpi_pm and tsc. Ignore that for a while. (Although I still feel something is less snappy with TOD patches applied -tsc and acpi_pm both) If you have any means of measuring the performance difference - let me know. At the risk of sounding insane - Can any one try listen to music with the TOD patches applied? I did it with XMMS, amaroK and Juk - All *seem* to play my music slightly faster than vanilla. Voices sound as if they were fast forwarded (fractionally). Parag ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-02 18:27 [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) Parag Warudkar 2005-06-02 18:39 ` Nishanth Aravamudan @ 2005-06-02 18:40 ` john stultz 1 sibling, 0 replies; 42+ messages in thread From: john stultz @ 2005-06-02 18:40 UTC (permalink / raw) To: Parag Warudkar Cc: Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Nishanth Aravamudan, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Thu, 2005-06-02 at 18:27 +0000, Parag Warudkar wrote: > > If you grab Linus' current tree it should apply. > > > > Sorry about the confusion. > > -john > > I ignored the reject since it was from an #include section - the build > went fine. I am even able to use it successfully. Couple things - Good to hear. > Very happy to report that I no longer get those annoying - "losing > some ticks ..." "your time source is unreliable or some driver is > hogging interrupts" messages - Not sure what change in TOD subsystem > cured it - or was it just the removal of the printk? ;) Since we do not interpolate, lost ticks no longer cause time problems (well, unless you're using the jiffies timesource). > Sadly, it somehow feels noticeably slower than vanilla 2.6.12-rc5. > Especially using X/KDE - It is surely usable but not snappy. I will do > more research to find out exactly why - but before that is such as > loss of snappiness possible due to the TOD changes? Could you send me your dmesg output with and without using my patch? It could be you're using a different timesource. thanks -john ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) @ 2005-06-02 18:51 Parag Warudkar 0 siblings, 0 replies; 42+ messages in thread From: Parag Warudkar @ 2005-06-02 18:51 UTC (permalink / raw) To: john stultz Cc: Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Nishanth Aravamudan, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh > Since we do not interpolate, lost ticks no longer cause time problems > (well, unless you're using the jiffies timesource). > That's certainly cool - no longer lost ticks! > > Sadly, it somehow feels noticeably slower than vanilla 2.6.12-rc5. > > Especially using X/KDE - It is surely usable but not snappy. I will do > > more research to find out exactly why - but before that is such as > > loss of snappiness possible due to the TOD changes? > > Could you send me your dmesg output with and without using my patch? It > could be you're using a different timesource. > I can send the dmesg output later on - but when I checked it last it printed - "using acpi_pm". Machine is a laptop and has nvidia chipset if that matters. Parag ^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH 1/4] new timeofday core subsystem (v. B1) @ 2005-06-01 23:09 john stultz 2005-06-01 23:12 ` [PATCH 2/4] new timeofday i386 arch specific changes " john stultz 0 siblings, 1 reply; 42+ messages in thread From: john stultz @ 2005-06-01 23:09 UTC (permalink / raw) To: Andrew Morton Cc: lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andi Kleen, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Nishanth Aravamudan, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh Andrew, All, I'm just re-spinning this to resolve a conflict w/ the CPUFREQ changes Linus accepted last night. With the goal to simplify, streamline and consolidate the time-of-day infrastructure, I propose the following common implementation across all arches. This will allow generic bugs to be fixed once, reduce code duplication, and with many architectures sharing the same time source, this allows drivers to be written once for multiple architectures. Additionally it will better delineate the lines between the soft-timer subsystem and the time-of-day subsystem, opening the door for more flexible and better soft-timer management. Features of this design: ======================== o Splits time of day management from timer interrupts o Consolidates a large amount of code o Generic algorithms which use time-source drivers chosen at runtime o More consistent and readable code o Uses nanoseconds as the kernel's base time unit o Clearly separates the NTP code from the time code For another description on the rework, see here: http://lwn.net/Articles/120850/ (Many thanks to the LWN team for that easy to understand writeup!) This patch implements the architecture independent portion of the new time of day subsystem. Included below is timeofday.c (which includes all the time of day management and accessor functions), ntp.c (which includes the ntp adjustment code, leapsecond processing, and ntp kernel state machine code), timesource.c (for timesource specific management functions), interface definition .h files, the example jiffies timesource (lowest common denominator time source, mainly for use as example code) and minimal hooks into arch independent code. The patch does nothing without at least minimal architecture specific hooks (i386, x86-64 to follow), and it should be able to be applied to a tree without affecting the existing code. Finally I'd like to thank the following people who have contributed ideas, criticism, testing and code that has helped shape this work: George Anzinger, Nish Aravamudan, Max Asbock, Dominik Brodowski, Darren Hart, Christoph Lameter, Matt Mackal, Keith Mannthey, Martin Schwidefsky, Frank Sorenson, Ulrich Windl, Darrick Wong, and any others whom I've accidentally forgotten. Andrew, please consider for inclusion for testing into your tree (I'd like to target around end of July for possible inclusion into mainline). thanks -john Signed-off-by: John Stultz <johnstul@us.ibm.com> linux-2.6.12-rc5_timeofday-core_B1.patch ======================================== Index: drivers/Makefile =================================================================== --- d414ab9a0f0995899c2e76c232714410f787b209/drivers/Makefile (mode:100644) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/drivers/Makefile (mode:100644) @@ -64,3 +64,4 @@ obj-$(CONFIG_BLK_DEV_SGIIOC4) += sn/ obj-y += firmware/ obj-$(CONFIG_CRYPTO) += crypto/ +obj-$(CONFIG_NEWTOD) += timesource/ Index: drivers/char/hangcheck-timer.c =================================================================== --- d414ab9a0f0995899c2e76c232714410f787b209/drivers/char/hangcheck-timer.c (mode:100644) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/drivers/char/hangcheck-timer.c (mode:100644) @@ -49,6 +49,7 @@ #include <linux/delay.h> #include <asm/uaccess.h> #include <linux/sysrq.h> +#include <linux/timeofday.h> #define VERSION_STR "0.9.0" @@ -130,8 +131,12 @@ #endif #ifdef HAVE_MONOTONIC +#ifndef CONFIG_NEWTOD extern unsigned long long monotonic_clock(void); #else +#define monotonic_clock() do_monotonic_clock() +#endif +#else static inline unsigned long long monotonic_clock(void) { # ifdef __s390__ Index: drivers/timesource/Makefile =================================================================== --- /dev/null (tree:d414ab9a0f0995899c2e76c232714410f787b209) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/drivers/timesource/Makefile (mode:100644) @@ -0,0 +1 @@ +obj-y += jiffies.o Index: drivers/timesource/jiffies.c =================================================================== --- /dev/null (tree:d414ab9a0f0995899c2e76c232714410f787b209) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/drivers/timesource/jiffies.c (mode:100644) @@ -0,0 +1,69 @@ +/*********************************************************************** +* linux/drivers/timesource/jiffies.c +* +* This file contains the jiffies based time source. +* +* Copyright (C) 2004, 2005 IBM, John Stultz (johnstul@us.ibm.com) +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +* +************************************************************************/ +#include <linux/timesource.h> +#include <linux/jiffies.h> +#include <linux/init.h> + +/* The Jiffies based timesource is the lowest common + * denominator time source which should function on + * all systems. It has the same coarse resolution as + * the timer interrupt frequency HZ and it suffers + * inaccuracies caused by missed or lost timer + * interrupts and the inability for the timer + * interrupt hardware to accuratly tick at the + * requested HZ value. It is also not reccomended + * for "tick-less" systems. + */ +#define NSEC_PER_JIFFY ((u32)((((u64)NSEC_PER_SEC)<<8)/ACTHZ)) + +/* Since jiffies uses a simple NSEC_PER_JIFFY multiplier + * conversion, the .shift value could be zero. However + * this would make NTP adjustments impossible as they are + * in units of 1/2^.shift. Thus we use JIFFIES_SHIFT to + * shift both the nominator and denominator the same + * amount, and give ntp adjustments in units of 1/2^10 + */ +#define JIFFIES_SHIFT 10 + +static cycle_t jiffies_read(void) +{ + cycle_t ret = get_jiffies_64(); + return ret; +} + +struct timesource_t timesource_jiffies = { + .name = "jiffies", + .priority = 0, /* lowest priority*/ + .type = TIMESOURCE_FUNCTION, + .read_fnct = jiffies_read, + .mask = (cycle_t)-1, + .mult = NSEC_PER_JIFFY << JIFFIES_SHIFT, /* See above for details */ + .shift = JIFFIES_SHIFT, +}; + +static int __init init_jiffies_timesource(void) +{ + register_timesource(×ource_jiffies); + return 0; +} +module_init(init_jiffies_timesource); Index: include/asm-generic/timeofday.h =================================================================== --- /dev/null (tree:d414ab9a0f0995899c2e76c232714410f787b209) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/include/asm-generic/timeofday.h (mode:100644) @@ -0,0 +1,26 @@ +/* linux/include/asm-generic/timeofday.h + * + * This file contains the asm-generic interface + * to the arch specific calls used by the time of day subsystem + */ +#ifndef _ASM_GENERIC_TIMEOFDAY_H +#define _ASM_GENERIC_TIMEOFDAY_H +#include <linux/types.h> +#include <linux/time.h> +#include <linux/timex.h> +#include <asm/div64.h> +#ifdef CONFIG_NEWTOD + +/* Required externs */ +extern nsec_t read_persistent_clock(void); +extern void sync_persistent_clock(struct timespec ts); + +#ifdef CONFIG_NEWTOD_VSYSCALL +extern void arch_update_vsyscall_gtod(nsec_t wall_time, cycle_t offset_base, + struct timesource_t* timesource, int ntp_adj); +#else +#define arch_update_vsyscall_gtod(x,y,z,w) {} +#endif + +#endif /* CONFIG_NEWTOD */ +#endif Index: include/linux/ntp.h =================================================================== --- /dev/null (tree:d414ab9a0f0995899c2e76c232714410f787b209) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/include/linux/ntp.h (mode:100644) @@ -0,0 +1,19 @@ +/* linux/include/linux/ntp.h + * + * This file NTP state machine accessor functions. + */ + +#ifndef _LINUX_NTP_H +#define _LINUX_NTP_H +#include <linux/types.h> +#include <linux/time.h> +#include <linux/timex.h> + +/* NTP state machine interfaces */ +int ntp_advance(nsec_t value); +int ntp_adjtimex(struct timex*); +int ntp_leapsecond(struct timespec now); +void ntp_clear(void); +int get_ntp_status(void); + +#endif Index: include/linux/time.h =================================================================== --- d414ab9a0f0995899c2e76c232714410f787b209/include/linux/time.h (mode:100644) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/include/linux/time.h (mode:100644) @@ -27,6 +27,10 @@ #ifdef __KERNEL__ +/* timeofday base types */ +typedef u64 nsec_t; +typedef u64 cycle_t; + /* Parameters used to convert the timespec values */ #ifndef USEC_PER_SEC #define USEC_PER_SEC (1000000L) Index: include/linux/timeofday.h =================================================================== --- /dev/null (tree:d414ab9a0f0995899c2e76c232714410f787b209) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/include/linux/timeofday.h (mode:100644) @@ -0,0 +1,59 @@ +/* linux/include/linux/timeofday.h + * + * This file contains the interface to the time of day subsystem + */ +#ifndef _LINUX_TIMEOFDAY_H +#define _LINUX_TIMEOFDAY_H +#include <linux/types.h> +#include <linux/time.h> +#include <linux/timex.h> +#include <asm/div64.h> + +#ifdef CONFIG_NEWTOD +/* Public definitions */ +extern nsec_t get_lowres_timestamp(void); +extern nsec_t get_lowres_timeofday(void); +extern nsec_t do_monotonic_clock(void); + +extern void do_gettimeofday(struct timeval *tv); +extern void getnstimeofday(struct timespec *ts); +extern int do_settimeofday(struct timespec *tv); +extern int do_adjtimex(struct timex *tx); + +extern void timeofday_init(void); + +/* Inline helper functions */ +static inline struct timeval ns_to_timeval(nsec_t ns) +{ + struct timeval tv; + tv.tv_sec = div_long_long_rem(ns, NSEC_PER_SEC, &tv.tv_usec); + tv.tv_usec = (tv.tv_usec + NSEC_PER_USEC/2) / NSEC_PER_USEC; + return tv; +} + +static inline struct timespec ns_to_timespec(nsec_t ns) +{ + struct timespec ts; + ts.tv_sec = div_long_long_rem(ns, NSEC_PER_SEC, &ts.tv_nsec); + return ts; +} + +static inline nsec_t timespec_to_ns(struct timespec* ts) +{ + nsec_t ret; + ret = ((nsec_t)ts->tv_sec) * NSEC_PER_SEC; + ret += ts->tv_nsec; + return ret; +} + +static inline nsec_t timeval_to_ns(struct timeval* tv) +{ + nsec_t ret; + ret = ((nsec_t)tv->tv_sec) * NSEC_PER_SEC; + ret += tv->tv_usec * NSEC_PER_USEC; + return ret; +} +#else /* CONFIG_NEWTOD */ +#define timeofday_init() +#endif /* CONFIG_NEWTOD */ +#endif /* _LINUX_TIMEOFDAY_H */ Index: include/linux/timesource.h =================================================================== --- /dev/null (tree:d414ab9a0f0995899c2e76c232714410f787b209) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/include/linux/timesource.h (mode:100644) @@ -0,0 +1,158 @@ +/* linux/include/linux/timesource.h + * + * This file contains the structure definitions for timesources. + * + * If you are not a timesource, or the time of day code, you should + * not be including this file! + */ +#ifndef _LINUX_TIMESORUCE_H +#define _LINUX_TIMESORUCE_H + +#include <linux/types.h> +#include <linux/time.h> +#include <linux/timex.h> +#include <asm/io.h> +#include <asm/div64.h> + +/* struct timesource_t: + * Provides mostly state-free accessors to the underlying hardware. + * + * name: ptr to timesource name + * priority: priority value for selection (higher is better) + * type: defines timesource type + * @read_fnct: returns a cycle value + * ptr: ptr to MMIO'ed counter + * mask: bitmask for two's complement + * subtraction of non 64 bit counters + * mult: cycle to nanosecond multiplier + * shift: cycle to nanosecond divisor (power of two) + * @update_callback: called when safe to alter timesource values + */ +struct timesource_t { + char* name; + int priority; + enum { + TIMESOURCE_FUNCTION, + TIMESOURCE_CYCLES, + TIMESOURCE_MMIO_32, + TIMESOURCE_MMIO_64 + } type; + cycle_t (*read_fnct)(void); + void __iomem *mmio_ptr; + cycle_t mask; + u32 mult; + u32 shift; + void (*update_callback)(void); +}; + + +/* Helper functions that converts a khz counter + * frequency to a timsource multiplier, given the + * timesource shift value + */ +static inline u32 timesource_khz2mult(u32 khz, u32 shift_constant) +{ + /* khz = cyc/(Million ns) + * mult/2^shift = ns/cyc + * mult = ns/cyc * 2^shift + * mult = 1Million/khz * 2^shift + * mult = 1000000 * 2^shift / khz + * mult = (1000000<<shift) / khz + */ + u64 tmp = ((u64)1000000) << shift_constant; + tmp += khz/2; /* round for do_div */ + do_div(tmp, khz); + return (u32)tmp; +} + +/* Helper functions that converts a hz counter + * frequency to a timsource multiplier, given the + * timesource shift value + */ +static inline u32 timesource_hz2mult(u32 hz, u32 shift_constant) +{ + /* hz = cyc/(Billion ns) + * mult/2^shift = ns/cyc + * mult = ns/cyc * 2^shift + * mult = 1Billion/hz * 2^shift + * mult = 1000000000 * 2^shift / hz + * mult = (1000000000<<shift) / hz + */ + u64 tmp = ((u64)1000000000) << shift_constant; + tmp += hz/2; /* round for do_div */ + do_div(tmp, hz); + return (u32)tmp; +} + + +#ifndef readq +/* Provide an a way to atomically read a u64 on a 32bit arch */ +static inline unsigned long long timesource_readq(void __iomem *addr) +{ + u32 low, high; + /* loop is required to make sure we get an atomic read */ + do { + high = readl(addr+4); + low = readl(addr); + } while (high != readl(addr+4)); + + return low | (((unsigned long long)high) << 32LL); +} +#else +#define timesource_readq(x) readq(x) +#endif + + +/* read_timesource(): + * Uses the timesource to return the current cycle_t value + */ +static inline cycle_t read_timesource(struct timesource_t *ts) +{ + switch (ts->type) { + case TIMESOURCE_MMIO_32: + return (cycle_t)readl(ts->mmio_ptr); + case TIMESOURCE_MMIO_64: + return (cycle_t)timesource_readq(ts->mmio_ptr); + case TIMESOURCE_CYCLES: + return (cycle_t)get_cycles(); + default:/* case: TIMESOURCE_FUNCTION */ + return ts->read_fnct(); + } +} + +/* cyc2ns(): + * Uses the timesource and ntp ajdustment interval to + * convert cycle_ts to nanoseconds. + */ +static inline nsec_t cyc2ns(struct timesource_t *ts, int ntp_adj, cycle_t cycles) +{ + u64 ret; + ret = (u64)cycles; + ret *= (ts->mult + ntp_adj); + ret >>= ts->shift; + return (nsec_t)ret; +} + +/* cyc2ns_rem(): + * Uses the timesource and ntp ajdustment interval to + * convert cycle_ts to nanoseconds. Add in remainder portion + * which is stored in ns<<ts->shift units and save the new + * remainder off. + */ +static inline nsec_t cyc2ns_rem(struct timesource_t *ts, int ntp_adj, cycle_t cycles, u64* rem) +{ + u64 ret; + ret = (u64)cycles; + ret *= (ts->mult + ntp_adj); + if (rem) { + ret += *rem; + *rem = ret & ((1<<ts->shift)-1); + } + ret >>= ts->shift; + return (nsec_t)ret; +} + +/* used to install a new time source */ +void register_timesource(struct timesource_t*); +struct timesource_t* get_next_timesource(void); +#endif Index: include/linux/timex.h =================================================================== --- d414ab9a0f0995899c2e76c232714410f787b209/include/linux/timex.h (mode:100644) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/include/linux/timex.h (mode:100644) @@ -228,6 +228,7 @@ extern unsigned long tick_nsec; /* ACTHZ period (nsec) */ extern int tickadj; /* amount of adjustment per tick */ +#ifndef CONFIG_NEWTOD /* * phase-lock loop variables */ @@ -314,6 +315,7 @@ } #endif /* !CONFIG_TIME_INTERPOLATION */ +#endif /* !CONFIG_NEWTOD */ #endif /* KERNEL */ Index: init/main.c =================================================================== --- d414ab9a0f0995899c2e76c232714410f787b209/init/main.c (mode:100644) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/init/main.c (mode:100644) @@ -47,6 +47,7 @@ #include <linux/rmap.h> #include <linux/mempolicy.h> #include <linux/key.h> +#include <linux/timeofday.h> #include <asm/io.h> #include <asm/bugs.h> @@ -467,6 +468,7 @@ pidhash_init(); init_timers(); softirq_init(); + timeofday_init(); time_init(); /* Index: kernel/Makefile =================================================================== --- d414ab9a0f0995899c2e76c232714410f787b209/kernel/Makefile (mode:100644) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/kernel/Makefile (mode:100644) @@ -9,6 +9,7 @@ rcupdate.o intermodule.o extable.o params.o posix-timers.o \ kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o +obj-$(CONFIG_NEWTOD) += timeofday.o timesource.o ntp.o obj-$(CONFIG_FUTEX) += futex.o obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o obj-$(CONFIG_SMP) += cpu.o spinlock.o Index: kernel/ntp.c =================================================================== --- /dev/null (tree:d414ab9a0f0995899c2e76c232714410f787b209) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/kernel/ntp.c (mode:100644) @@ -0,0 +1,519 @@ +/******************************************************************** +* linux/kernel/ntp.c +* +* NTP state machine and time scaling code. +* +* Copyright (C) 2004, 2005 IBM, John Stultz (johnstul@us.ibm.com) +* +* Portions rewritten from kernel/time.c and kernel/timer.c +* Please see those files for original copyrights. +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +* +* Notes: +* +* Hopefully you should never have to understand or touch +* any of the code below. but don't let that keep you from trying! +* +* This code is loosely based on David Mills' RFC 1589 and its +* updates. Please see the following for more details: +* http://www.eecis.udel.edu/~mills/database/rfc/rfc1589.txt +* http://www.eecis.udel.edu/~mills/database/reports/kern/kernb.pdf +* +* NOTE: To simplify the code, we do not implement any of +* the PPS code, as the code that uses it never was merged. +* -johnstul@us.ibm.com +* +* Revision History: +* 2004-09-02: A0 +* o First pass sent to lkml for review. +* 2004-12-07: A1 +* o No changes, sent to lkml for review. +* 2005-03-11: A3 +* o yanked ntp_scale(), ntp adjustments are done in cyc2ns +* 2005-04-29: A4 +* o Added conditional debug info +* 2005-05-12: A5 +* o comment cleanups +* 2005-05-31: B0 +* o comment cleanups +* o Improved rounding +* TODO List: +* o Move to using ppb for frequency adjustments +* o More documentation +* o More testing +* o More optimization +*********************************************************************/ + +#include <linux/ntp.h> +#include <linux/errno.h> + +#define NTP_DEBUG 0 + +/* NTP scaling code + * Functions: + * ---------- + * nsec_t ntp_scale(nsec_t value): + * Scales the nsec_t vale using ntp kernel state + * void ntp_advance(nsec_t interval): + * Increments the NTP state machine by interval time + * static int ntp_hardupdate(long offset, struct timeval tv) + * ntp_adjtimex helper function + * int ntp_adjtimex(struct timex* tx): + * Interface to adjust NTP state machine + * int ntp_leapsecond(struct timespec now) + * Does NTP leapsecond processing. Returns number of + * seconds current time should be adjusted by. + * void ntp_clear(void): + * Clears the ntp kernel state + * int get_ntp_status(void): + * returns ntp_status value + * + * Variables: + * ---------- + * ntp kernel state variables: + * See below for full list. + * ntp_lock: + * Protects ntp kernel state variables + */ + + + +/* Chapter 5: Kernel Variables [RFC 1589 pg. 28] */ +/* 5.1 Interface Variables */ +static int ntp_status = STA_UNSYNC; /* status */ +static long ntp_offset; /* usec */ +static long ntp_constant = 2; /* ntp magic? */ +static long ntp_maxerror = NTP_PHASE_LIMIT; /* usec */ +static long ntp_esterror = NTP_PHASE_LIMIT; /* usec */ +static const long ntp_tolerance = MAXFREQ; /* shifted ppm */ +static const long ntp_precision = 1; /* constant */ + +/* 5.2 Phase-Lock Loop Variables */ +static long ntp_freq; /* shifted ppm */ +static long ntp_reftime; /* sec */ + +/* Extra values */ +static int ntp_state = TIME_OK; /* leapsecond state */ +static long ntp_tick = USEC_PER_SEC/USER_HZ; /* tick length */ + +static s64 ss_offset_len; /* SINGLESHOT offset adj interval (nsec)*/ +static long singleshot_adj; /* +/- MAX_SINGLESHOT_ADJ (ppm)*/ +static long tick_adj; /* tx->tick adjustment (ppm) */ +static long offset_adj; /* offset adjustment (ppm) */ + + +/* lock for the above variables */ +static seqlock_t ntp_lock = SEQLOCK_UNLOCKED; + +#define MAX_SINGLESHOT_ADJ 500 /* (ppm) */ +#define SEC_PER_DAY 86400 + +/* Required to safely shift negative values */ +#define shiftR(x,s) (x < 0) ? (-((-x) >> (s))) : ((x) >> (s)) + +/** + * ntp_advance - Periodic hook which increments NTP state machine + * interval: nsecond interval value used to increment the state machine + * + * Periodic hook which increments NTP state machine by interval. + * Returns the signed PPM adjustment to be used for the next interval. + * + * This is ntp_hardclock in the RFC. + */ +int ntp_advance(nsec_t interval) +{ + static u64 interval_sum = 0; + static long ss_adj = 0; + unsigned long flags; + long ppm_sum; + + /* inc interval sum */ + interval_sum += interval; + + write_seqlock_irqsave(&ntp_lock, flags); + + /* decrement singleshot offset interval */ + ss_offset_len -= interval; + if(ss_offset_len < 0) /* make sure it doesn't go negative */ + ss_offset_len = 0; + + /* Do second overflow code */ + while (interval_sum > NSEC_PER_SEC) { + /* XXX - I'd prefer to smoothly apply this math + * at each call to ntp_advance() rather then each + * second. + */ + long tmp; + + /* Bump maxerror by ntp_tolerance */ + ntp_maxerror += shiftR(ntp_tolerance, SHIFT_USEC); + if (ntp_maxerror > NTP_PHASE_LIMIT) { + ntp_maxerror = NTP_PHASE_LIMIT; + ntp_status |= STA_UNSYNC; + } + + /* Calculate offset_adj for the next second */ + tmp = ntp_offset; + if (!(ntp_status & STA_FLL)) + tmp = shiftR(tmp, SHIFT_KG + ntp_constant); + + /* bound the adjustment to MAXPHASE/MINSEC */ + tmp = min(tmp, (MAXPHASE / MINSEC) << SHIFT_UPDATE); + tmp = max(tmp, -(MAXPHASE / MINSEC) << SHIFT_UPDATE); + + offset_adj = shiftR(tmp, SHIFT_UPDATE); /* (usec/sec) = ppm */ + ntp_offset -= tmp; + + interval_sum -= NSEC_PER_SEC; + + /* calculate singleshot aproximation ppm for the next second */ + ss_adj = singleshot_adj; + singleshot_adj = 0; + } + + /* calculate total ppm adjustment for the next interval */ + ppm_sum = tick_adj; + ppm_sum += offset_adj; + ppm_sum += shiftR(ntp_freq,SHIFT_USEC); + ppm_sum += ss_adj; + +#if NTP_DEBUG +{ + static int dbg = 0; + if(!(dbg++%300000)) + printk("tick_adj(%d) + offset_adj(%d) + ntp_freq(%d) + ss_adj(%d) = ppm_sum(%d)\n", tick_adj, offset_adj, shiftR(ntp_freq,SHIFT_USEC), ss_adj, ppm_sum); +} +#endif + + write_sequnlock_irqrestore(&ntp_lock, flags); + + return ppm_sum; +} + +/** + * ntp_hardupdate - Calculates the offset and freq values + * offset: current offset + * tv: timeval holding the current time + * + * Private function, called only by ntp_adjtimex while holding ntp_lock + * + * This function is called when an offset adjustment is requested. + * It calculates the offset adjustment and manipulates the + * frequency adjustement accordingly. + */ +static int ntp_hardupdate(long offset, struct timeval tv) +{ + int ret; + long tmp, interval; + + ret = 0; + if (!(ntp_status & STA_PLL)) + return ret; + + tmp = offset; + /* Make sure offset is bounded by MAXPHASE */ + tmp = min(tmp, MAXPHASE); + tmp = max(tmp, -MAXPHASE); + + ntp_offset = tmp << SHIFT_UPDATE; + + if ((ntp_status & STA_FREQHOLD) || (ntp_reftime == 0)) + ntp_reftime = tv.tv_sec; + + /* calculate seconds since last call to hardupdate */ + interval = tv.tv_sec - ntp_reftime; + ntp_reftime = tv.tv_sec; + + if ((ntp_status & STA_FLL) && (interval >= MINSEC)) { + long damping; + /* calculate frequency for this interval */ + tmp = (offset + interval/2) / interval; /* ppm (usec/sec)*/ + + /* calculate damping factor */ + damping = SHIFT_KH - SHIFT_USEC; + + /* convert to shifted ppm, then apply damping factor */ + ntp_freq += shiftR(tmp,damping); +#if NTP_DEBUG + printk("ntp->freq change: %ld\n",shiftR(tmp,damping)); +#endif + + } else if ((ntp_status & STA_PLL) && (interval < MAXSEC)) { + long damping; + tmp = offset * interval; + + /* calculate damping factor */ + damping = (2 * ntp_constant) + SHIFT_KF - SHIFT_USEC; + + /* apply damping factor */ + ntp_freq += shiftR(tmp,damping); + +#if NTP_DEBUG + printk("ntp->freq change: %ld\n", shiftR(tmp,damping)); +#endif + } else { /* interval out of bounds */ +#if NTP_DEBUG + printk("ntp_hardupdate(): interval out of bounds: %ld status: 0x%x\n", + interval, ntp_status); +#endif + ret = -1; /* TIME_ERROR */ + } + + /* bound ntp_freq */ + if (ntp_freq > ntp_tolerance) + ntp_freq = ntp_tolerance; + if (ntp_freq < -ntp_tolerance) + ntp_freq = -ntp_tolerance; + + return ret; +} + +/** + * ntp_adjtimex - Interface to change NTP state machine + * @tx: timex value passed to the kernel to be used + */ +int ntp_adjtimex(struct timex* tx) +{ + long save_offset; + int result; + unsigned long flags; + +/* Sanity checking + */ + /* frequency adjustment limited to +/- MAXFREQ */ + if ((tx->modes & ADJ_FREQUENCY) + && (abs(tx->freq) > MAXFREQ)) + return -EINVAL; + + /* maxerror adjustment limited to NTP_PHASE_LIMIT */ + if ((tx->modes & ADJ_MAXERROR) + && (tx->maxerror < 0 + || tx->maxerror >= NTP_PHASE_LIMIT)) + return -EINVAL; + + /* esterror adjustment limited to NTP_PHASE_LIMIT */ + if ((tx->modes & ADJ_ESTERROR) + && (tx->esterror < 0 + || tx->esterror >= NTP_PHASE_LIMIT)) + return -EINVAL; + + /* constant adjustment must be positive */ + if ((tx->modes & ADJ_TIMECONST) + && (tx->constant < 0)) + return -EINVAL; + + /* Single shot mode can only be used by itself */ + if (((tx->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT) + && (tx->modes != ADJ_OFFSET_SINGLESHOT)) + return -EINVAL; + + /* offset adjustment limited to +/- MAXPHASE */ + if ((tx->modes != ADJ_OFFSET_SINGLESHOT) + && (tx->modes & ADJ_OFFSET) + && (abs(tx->offset)>= MAXPHASE)) + return -EINVAL; + + /* tick adjustment limited to 10% */ + if ((tx->modes & ADJ_TICK) + && ((tx->tick < 900000/USER_HZ) + ||(tx->tick > 11000000/USER_HZ))) + return -EINVAL; + +#if NTP_DEBUG + if(tx->modes) { + printk("adjtimex: tx->offset: %ld tx->freq: %ld\n", + tx->offset, tx->freq); + } +#endif + +/* Kernel input bits + */ + write_seqlock_irqsave(&ntp_lock, flags); + + result = ntp_state; + + /* For ADJ_OFFSET_SINGLESHOT we must return the old offset */ + save_offset = shiftR(ntp_offset, SHIFT_UPDATE); + + /* Process input parameters */ + if (tx->modes & ADJ_STATUS) { + ntp_status &= STA_RONLY; + ntp_status |= tx->status & ~STA_RONLY; + } + + if (tx->modes & ADJ_FREQUENCY) + ntp_freq = tx->freq; + + if (tx->modes & ADJ_MAXERROR) + ntp_maxerror = tx->maxerror; + + if (tx->modes & ADJ_ESTERROR) + ntp_esterror = tx->esterror; + + if (tx->modes & ADJ_TIMECONST) + ntp_constant = tx->constant; + + if (tx->modes & ADJ_OFFSET) { + /* check if we're doing a singleshot adjustment */ + if (tx->modes == ADJ_OFFSET_SINGLESHOT) + singleshot_adj = tx->offset; + /* otherwise, call hardupdate() */ + else if (ntp_hardupdate(tx->offset, tx->time)) + result = TIME_ERROR; + } + + if (tx->modes & ADJ_TICK) { + /* first calculate usec/user_tick offset */ + tick_adj = ((USEC_PER_SEC + USER_HZ/2)/USER_HZ) - tx->tick; + /* multiply by user_hz to get usec/sec => ppm */ + tick_adj *= USER_HZ; + /* save tx->tick for future calls to adjtimex */ + ntp_tick = tx->tick; + } + + if ((ntp_status & (STA_UNSYNC|STA_CLOCKERR)) != 0 ) + result = TIME_ERROR; + +/* Kernel output bits + */ + /* write kernel state to user timex values*/ + if ((tx->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT) + tx->offset = save_offset; + else + tx->offset = shiftR(ntp_offset, SHIFT_UPDATE); + + tx->freq = ntp_freq; + tx->maxerror = ntp_maxerror; + tx->esterror = ntp_esterror; + tx->status = ntp_status; + tx->constant = ntp_constant; + tx->precision = ntp_precision; + tx->tolerance = ntp_tolerance; + + /* PPS is not implemented, so these are zero */ + tx->ppsfreq = /*XXX - Not Implemented!*/ 0; + tx->jitter = /*XXX - Not Implemented!*/ 0; + tx->shift = /*XXX - Not Implemented!*/ 0; + tx->stabil = /*XXX - Not Implemented!*/ 0; + tx->jitcnt = /*XXX - Not Implemented!*/ 0; + tx->calcnt = /*XXX - Not Implemented!*/ 0; + tx->errcnt = /*XXX - Not Implemented!*/ 0; + tx->stbcnt = /*XXX - Not Implemented!*/ 0; + + write_sequnlock_irqrestore(&ntp_lock, flags); + + return result; +} + + +/** + * ntp_leapsecond - NTP leapsecond processing code. + * now: the current time + * + * Returns the number of seconds (-1, 0, or 1) that + * should be added to the current time to properly + * adjust for leapseconds. + */ +int ntp_leapsecond(struct timespec now) +{ + /* + * Leap second processing. If in leap-insert state at + * the end of the day, the system clock is set back one + * second; if in leap-delete state, the system clock is + * set ahead one second. + */ + static time_t leaptime = 0; + + switch (ntp_state) { + case TIME_OK: + if (ntp_status & STA_INS) { + ntp_state = TIME_INS; + /* calculate end of today (23:59:59)*/ + leaptime = now.tv_sec + SEC_PER_DAY - + (now.tv_sec % SEC_PER_DAY) - 1; + } + else if (ntp_status & STA_DEL) { + ntp_state = TIME_DEL; + /* calculate end of today (23:59:59)*/ + leaptime = now.tv_sec + SEC_PER_DAY - + (now.tv_sec % SEC_PER_DAY) - 1; + } + break; + + case TIME_INS: + /* Once we are at (or past) leaptime, insert the second */ + if (now.tv_sec > leaptime) { + ntp_state = TIME_OOP; + printk(KERN_NOTICE + "Clock: inserting leap second 23:59:60 UTC\n"); + return -1; + } + break; + + case TIME_DEL: + /* Once we are at (or past) leaptime, delete the second */ + if (now.tv_sec >= leaptime) { + ntp_state = TIME_WAIT; + printk(KERN_NOTICE + "Clock: deleting leap second 23:59:59 UTC\n"); + return 1; + } + break; + + case TIME_OOP: + /* Wait for the end of the leap second*/ + if (now.tv_sec > (leaptime + 1)) + ntp_state = TIME_WAIT; + break; + + case TIME_WAIT: + if (!(ntp_status & (STA_INS | STA_DEL))) + ntp_state = TIME_OK; + } + + return 0; +} + +/** + * ntp_clear - Clears the NTP state machine. + * + */ +void ntp_clear(void) +{ + unsigned long flags; + write_seqlock_irqsave(&ntp_lock, flags); + + /* clear everything */ + ntp_status |= STA_UNSYNC; + ntp_maxerror = NTP_PHASE_LIMIT; + ntp_esterror = NTP_PHASE_LIMIT; + ss_offset_len = 0; + singleshot_adj = 0; + tick_adj = 0; + offset_adj =0; + + write_sequnlock_irqrestore(&ntp_lock, flags); +} + +/** + * get_ntp_status - Returns the NTP status value + * + */ +int get_ntp_status(void) +{ + return ntp_status; +} + Index: kernel/time.c =================================================================== --- d414ab9a0f0995899c2e76c232714410f787b209/kernel/time.c (mode:100644) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/kernel/time.c (mode:100644) @@ -38,6 +38,7 @@ #include <asm/uaccess.h> #include <asm/unistd.h> +#include <linux/timeofday.h> /* * The timezone where the local system is located. Used as a default by some @@ -128,6 +129,7 @@ * as real UNIX machines always do it. This avoids all headaches about * daylight saving times and warping kernel clocks. */ +#ifndef CONFIG_NEWTOD inline static void warp_clock(void) { write_seqlock_irq(&xtime_lock); @@ -137,6 +139,18 @@ write_sequnlock_irq(&xtime_lock); clock_was_set(); } +#else /* !CONFIG_NEWTOD */ +/* XXX - this is somewhat cracked out and should + be checked -johnstul@us.ibm.com +*/ +inline static void warp_clock(void) +{ + struct timespec ts; + getnstimeofday(&ts); + ts.tv_sec += sys_tz.tz_minuteswest * 60; + do_settimeofday(&ts); +} +#endif /* !CONFIG_NEWTOD */ /* * In case for some reason the CMOS clock has not already been running @@ -227,6 +241,7 @@ /* adjtimex mainly allows reading (and writing, if superuser) of * kernel time-keeping variables. used by xntpd. */ +#ifndef CONFIG_NEWTOD int do_adjtimex(struct timex *txc) { long ltemp, mtemp, save_adjust; @@ -410,6 +425,7 @@ notify_arch_cmos_timer(); return(result); } +#endif /* !CONFIG_NEWTOD */ asmlinkage long sys_adjtimex(struct timex __user *txc_p) { @@ -558,6 +574,7 @@ #else +#ifndef CONFIG_NEWTOD /* * Simulate gettimeofday using do_gettimeofday which only allows a timeval * and therefore only yields usec accuracy @@ -570,6 +587,7 @@ tv->tv_sec = x.tv_sec; tv->tv_nsec = x.tv_usec * NSEC_PER_USEC; } +#endif /* !CONFIG_NEWTOD */ #endif #if (BITS_PER_LONG < 64) Index: kernel/timeofday.c =================================================================== --- /dev/null (tree:d414ab9a0f0995899c2e76c232714410f787b209) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/kernel/timeofday.c (mode:100644) @@ -0,0 +1,607 @@ +/********************************************************************* +* linux/kernel/timeofday.c +* +* This file contains the functions which access and manage +* the system's time of day functionality. +* +* Copyright (C) 2003, 2004, 2005 IBM, John Stultz (johnstul@us.ibm.com) +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +* +* Revision History: +* 2004-09-02: A0 +* o First pass sent to lkml for review. +* 2004-12-07: A1 +* o Rework of timesource structure +* o Sent to lkml for review +* 2005-01-24: A2 +* o write_seqlock_irq -> writeseqlock_irqsave +* o arch generic interface for for get_cmos_time() equivalents +* o suspend/resume hooks for sleep/hibernate (lightly tested) +* o timesource adjust_callback hook +* o Sent to lkml for review +* 2005-03-11: A3 +* o periodic_hook (formerly interrupt_hook) now calle by softtimer +* o yanked ntp_scale(), ntp adjustments are done in cyc2ns now +* o sent to lkml for review +* 2005-04-29: A4 +* o Improved the cyc2ns remainder handling +* o Added getnstimeofday +* o Cleanups from Nish Aravamudan +* 2005-05-12: A5 +* o Added clock_was_set hooks +* o Added suspend/resume sysfs hooks +* o Minor code cleanups +* o First attempt at docbook comments +* 2005-05-31: B0 +* o Comment cleanups +* o Rounding fixes +* +* TODO WishList: +* o See XXX's below. +**********************************************************************/ + +#include <linux/timeofday.h> +#include <linux/timesource.h> +#include <linux/ntp.h> +#include <linux/timex.h> +#include <linux/timer.h> +#include <linux/module.h> +#include <linux/sched.h> /* Needed for capable() */ +#include <linux/sysdev.h> +#include <linux/jiffies.h> +#include <asm/timeofday.h> + +#define TIME_DBG 0 +#define TIME_DBG_FREQ 60000 + +/* only run periodic_hook every 50ms */ +#define PERIODIC_INTERVAL_MS 50 + +/*[Nanosecond based variables] + * system_time: + * Monotonically increasing counter of the number of nanoseconds + * since boot. + * wall_time_offset: + * Offset added to system_time to provide accurate time-of-day + */ +static nsec_t system_time; +static nsec_t wall_time_offset; + +/*[Cycle based variables] + * offset_base: + * Value of the timesource at the last timeofday_periodic_hook() + * (adjusted only minorly to account for rounded off cycles) + */ +static cycle_t offset_base; + +/*[Time source data] + * timesource: + * current timesource pointer + */ +static struct timesource_t *timesource; + +/*[NTP adjustment] + * ntp_adj: + * value of the current ntp adjustment, + * stored in timesource multiplier units. + */ +int ntp_adj; + +/*[Locks] + * system_time_lock: + * generic lock for all locally scoped time values + */ +static seqlock_t system_time_lock = SEQLOCK_UNLOCKED; + + +/*[Suspend/Resume info] + * time_suspend_state: + * variable that keeps track of suspend state + * suspend_start: + * start of the suspend call + */ +static enum { + TIME_RUNNING, + TIME_SUSPENDED +} time_suspend_state = TIME_RUNNING; + +static nsec_t suspend_start; + +/* [Soft-Timers] + * timeofday_timer: + * soft-timer used to call timeofday_periodic_hook() + */ +struct timer_list timeofday_timer; + + +/* [Functions] + */ + +/** + * get_lowres_timestamp - Returns a low res timestamp + * + * Returns a low res timestamp w/ PERIODIC_INTERVAL_MS + * granularity. (ie: the value of system_time as + * calculated at the last invocation of + * timeofday_periodic_hook()) + */ +nsec_t get_lowres_timestamp(void) +{ + nsec_t ret; + unsigned long seq; + do { + seq = read_seqbegin(&system_time_lock); + + /* quickly grab system_time*/ + ret = system_time; + + } while (read_seqretry(&system_time_lock, seq)); + + return ret; +} + + +/** + * get_lowres_timeofday - Returns a low res time of day + * + * Returns a low res time of day, as calculated at the + * last invocation of timeofday_periodic_hook(). + */ +nsec_t get_lowres_timeofday(void) +{ + nsec_t ret; + unsigned long seq; + do { + seq = read_seqbegin(&system_time_lock); + + /* quickly calculate low-res time of day */ + ret = system_time + wall_time_offset; + + } while (read_seqretry(&system_time_lock, seq)); + + return ret; +} + + +/** + * update_legacy_time_values - Used to sync legacy time values + * + * Private function. Used to sync legacy time values to + * current timeofday. Assumes we have the system_time_lock. + * Hopefully someday this function can be removed. + */ +static void update_legacy_time_values(void) +{ + unsigned long flags; + write_seqlock_irqsave(&xtime_lock, flags); + xtime = ns_to_timespec(system_time + wall_time_offset); + wall_to_monotonic = ns_to_timespec(wall_time_offset); + set_normalized_timespec(&wall_to_monotonic, + -wall_to_monotonic.tv_sec, -wall_to_monotonic.tv_nsec); + /* We don't update jiffies here because it is its own time domain */ + write_sequnlock_irqrestore(&xtime_lock, flags); +} + + +/** + * __monotonic_clock - Returns monotonically increasing nanoseconds + * + * private function, must hold system_time_lock lock when being + * called. Returns the monotonically increasing number of + * nanoseconds since the system booted (adjusted by NTP scaling) + */ +static inline nsec_t __monotonic_clock(void) +{ + nsec_t ret, ns_offset; + cycle_t now, cycle_delta; + + /* read timesource */ + now = read_timesource(timesource); + + /* calculate the delta since the last timeofday_periodic_hook */ + cycle_delta = (now - offset_base) & timesource->mask; + + /* convert to nanoseconds */ + ns_offset = cyc2ns(timesource, ntp_adj, cycle_delta); + + /* add result to system time */ + ret = system_time + ns_offset; + + return ret; +} + + +/** + * do_monotonic_clock - Returns monotonically increasing nanoseconds + * + * Returns the monotonically increasing number of nanoseconds + * since the system booted via __monotonic_clock() + */ +nsec_t do_monotonic_clock(void) +{ + nsec_t ret; + unsigned long seq; + + /* atomically read __monotonic_clock() */ + do { + seq = read_seqbegin(&system_time_lock); + + ret = __monotonic_clock(); + + } while (read_seqretry(&system_time_lock, seq)); + + return ret; +} + + +/** + * __gettimeofday - Returns the timeofday in nsec_t. + * + * Private function. Returns the timeofday in nsec_t. + */ +static inline nsec_t __gettimeofday(void) +{ + nsec_t wall, sys; + unsigned long seq; + + /* atomically read wall and sys time */ + do { + seq = read_seqbegin(&system_time_lock); + + wall = wall_time_offset; + sys = __monotonic_clock(); + + } while (read_seqretry(&system_time_lock, seq)); + + return wall + sys; +} + + +/** + * getnstimeofday - Returns the time of day in a timespec + * @ts: pointer to the timespec to be set + * + * Returns the time of day in a timespec + * For consistency should be renamed + * later to do_getnstimeofday() + */ +void getnstimeofday(struct timespec *ts) +{ + *ts = ns_to_timespec(__gettimeofday()); +} +EXPORT_SYMBOL(getnstimeofday); + + +/** + * do_gettimeofday - Returns the time of day in a timeval + * @tv: pointer to the timeval to be set + * + */ +void do_gettimeofday(struct timeval *tv) +{ + *tv = ns_to_timeval(__gettimeofday()); +} +EXPORT_SYMBOL(do_gettimeofday); + + +/** + * do_settimeofday - Sets the time of day + * @tv: pointer to the timespec that will be used to set the time + * + */ +int do_settimeofday(struct timespec *tv) +{ + unsigned long flags; + nsec_t newtime = timespec_to_ns(tv); + + /* atomically adjust wall_time_offset & clear ntp state machine */ + write_seqlock_irqsave(&system_time_lock, flags); + + wall_time_offset = newtime - __monotonic_clock(); + ntp_clear(); + + update_legacy_time_values(); + + arch_update_vsyscall_gtod(system_time + wall_time_offset, offset_base, + timesource, ntp_adj); + + write_sequnlock_irqrestore(&system_time_lock, flags); + + /* signal posix-timers about time change */ + clock_was_set(); + + return 0; +} +EXPORT_SYMBOL(do_settimeofday); + + +/** + * do_adjtimex - interface to the kernel NTP variables + * @tx: pointer to the timex value that will be used + * + * Userspace NTP daemon's interface to the kernel NTP variables + */ +int do_adjtimex(struct timex *tx) +{ + /* Check capabilities if we're trying to modify something */ + if (tx->modes && !capable(CAP_SYS_TIME)) + return -EPERM; + + /* Note: We set tx->time first, + * because ntp_adjtimex uses it + */ + do_gettimeofday(&tx->time); + + /* call out to NTP code */ + return ntp_adjtimex(tx); +} + + +/** + * timeofday_suspend_hook - allows the timeofday subsystem to be shutdown + * @dev: unused + * state: unused + * + * This function allows the timeofday subsystem to + * be shutdown for a period of time. Usefull when + * going into suspend/hibernate mode. The code is + * very similar to the first half of + * timeofday_periodic_hook(). + */ +static int timeofday_suspend_hook(struct sys_device *dev, u32 state) +{ + unsigned long flags; + + write_seqlock_irqsave(&system_time_lock, flags); + + /* Make sure time_suspend_state is sane */ + BUG_ON(time_suspend_state != TIME_RUNNING); + + /* First off, save suspend start time + * then quickly call __monotonic_clock. + * These two calls hopefully occur quickly + * because the difference between reads will + * accumulate as time drift on resume. + */ + suspend_start = read_persistent_clock(); + system_time = __monotonic_clock(); + + /* switch states */ + time_suspend_state = TIME_SUSPENDED; + + write_sequnlock_irqrestore(&system_time_lock, flags); + return 0; +} + + +/** + * timeofday_resume_hook - Resumes the timeofday subsystem. + * @dev: unused + * + * This function resumes the timeofday subsystem + * from a previous call to timeofday_suspend_hook. + */ +static int timeofday_resume_hook(struct sys_device *dev) +{ + nsec_t now, suspend_time; + unsigned long flags; + + write_seqlock_irqsave(&system_time_lock, flags); + + /* Make sure time_suspend_state is sane */ + BUG_ON(time_suspend_state != TIME_SUSPENDED); + + /* Read persistent clock to mark the end of + * the suspend interval then rebase the + * offset_base to current timesource value. + * Again, time between these two calls will + * not be accounted for and will show up as + * time drift. + */ + now = read_persistent_clock(); + offset_base = read_timesource(timesource); + + /* calculate how long we were out for */ + suspend_time = now - suspend_start; + + /* update system_time */ + system_time += suspend_time; + + ntp_clear(); + + /* Set us back to running */ + time_suspend_state = TIME_RUNNING; + + /* finally, update legacy time values */ + update_legacy_time_values(); + + write_sequnlock_irqrestore(&system_time_lock, flags); + + /* signal posix-timers about time change */ + clock_was_set(); + + return 0; +} + +/* sysfs resume/suspend bits */ +static struct sysdev_class timeofday_sysclass = { + .resume = timeofday_resume_hook, + .suspend = timeofday_suspend_hook, + set_kset_name("timeofday"), +}; +static struct sys_device device_timer = { + .id = 0, + .cls = &timeofday_sysclass, +}; +static int timeofday_init_device(void) +{ + int error = sysdev_class_register(&timeofday_sysclass); + if (!error) + error = sysdev_register(&device_timer); + return error; +} +device_initcall(timeofday_init_device); + +/** + * timeofday_periodic_hook - Does periodic update of timekeeping values. + * unused: unused + * + * Calculates the delta since the last call, + * updates system time and clears the offset. + * + * Called via timeofday_timer. + */ +static void timeofday_periodic_hook(unsigned long unused) +{ + cycle_t now, cycle_delta; + static u64 remainder; + nsec_t ns, ns_ntp; + long leapsecond; + struct timesource_t* next; + unsigned long flags; + u64 tmp; + int ppm; + + write_seqlock_irqsave(&system_time_lock, flags); + + /* read time source & calc time since last call*/ + now = read_timesource(timesource); + cycle_delta = (now - offset_base) & timesource->mask; + + /* convert cycles to ntp adjusted ns and save remainder */ + ns_ntp = cyc2ns_rem(timesource, ntp_adj, cycle_delta, &remainder); + + /* convert cycles to raw ns for ntp advance */ + ns = cyc2ns(timesource, 0, cycle_delta); + +#if TIME_DBG + static int dbg=0; + if(!(dbg++%TIME_DBG_FREQ)){ + printk(KERN_INFO "now: %lluc - then: %lluc = delta: %lluc -> %llu ns + %llu shift_ns (ntp_adj: %i)\n", + (unsigned long long)now, (unsigned long long)offset_base, + (unsigned long long)cycle_delta, (unsigned long long)ns, + (unsigned long long)remainder, ntp_adj); + } +} +#endif + + /* update system_time */ + system_time += ns_ntp; + + /* reset the offset_base */ + offset_base = now; + + /* advance the ntp state machine by ns interval*/ + ppm = ntp_advance(ns); + + /* do ntp leap second processing*/ + leapsecond = ntp_leapsecond(ns_to_timespec(system_time+wall_time_offset)); + wall_time_offset += leapsecond * NSEC_PER_SEC; + + /* sync the persistent clock */ + if (!(get_ntp_status() & STA_UNSYNC)) + sync_persistent_clock(ns_to_timespec(system_time + wall_time_offset)); + + /* if necessary, switch timesources */ + next = get_next_timesource(); + if (next != timesource) { + /* immediately set new offset_base */ + offset_base = read_timesource(next); + /* swap timesources */ + timesource = next; + printk(KERN_INFO "Time: %s timesource has been installed.\n", + timesource->name); + ntp_clear(); + ntp_adj = 0; + remainder = 0; + } + + /* now is a safe time, so allow timesource to adjust + * itself (for example: to make cpufreq changes). + */ + if(timesource->update_callback) + timesource->update_callback(); + + + /* Convert the signed ppm to timesource multiplier adjustment */ + tmp = abs(ppm); + tmp = tmp * timesource->mult; + tmp += 1000000/2; /* round for div*/ + do_div(tmp, 1000000); + if (ppm < 0) + ntp_adj = -(int)tmp; + else + ntp_adj = (int)tmp; + + /* sync legacy values */ + update_legacy_time_values(); + + arch_update_vsyscall_gtod(system_time + wall_time_offset, offset_base, + timesource, ntp_adj); + + write_sequnlock_irqrestore(&system_time_lock, flags); + + /* XXX - Do we need to call clock_was_set() here? */ + + /* Set us up to go off on the next interval */ + mod_timer(&timeofday_timer, + jiffies + msecs_to_jiffies(PERIODIC_INTERVAL_MS)); +} + + +/** + * timeofday_init - Initializes time variables + * + */ +void __init timeofday_init(void) +{ + unsigned long flags; +#if TIME_DBG + printk(KERN_INFO "timeofday_init: Starting up!\n"); +#endif + write_seqlock_irqsave(&system_time_lock, flags); + + /* initialize the timesource variable */ + timesource = get_next_timesource(); + + /* clear and initialize offsets*/ + offset_base = read_timesource(timesource); + wall_time_offset = read_persistent_clock(); + + /* clear NTP scaling factor & state machine */ + ntp_adj = 0; + ntp_clear(); + + arch_update_vsyscall_gtod(system_time + wall_time_offset, offset_base, + timesource, ntp_adj); + + /* initialize legacy time values */ + update_legacy_time_values(); + + write_sequnlock_irqrestore(&system_time_lock, flags); + + /* Install timeofday_periodic_hook timer */ + init_timer(&timeofday_timer); + timeofday_timer.function = timeofday_periodic_hook; + timeofday_timer.expires = jiffies + 1; + add_timer(&timeofday_timer); + + +#if TIME_DBG + printk(KERN_INFO "timeofday_init: finished!\n"); +#endif + return; +} Index: kernel/timer.c =================================================================== --- d414ab9a0f0995899c2e76c232714410f787b209/kernel/timer.c (mode:100644) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/kernel/timer.c (mode:100644) @@ -577,6 +577,7 @@ int tickadj = 500/HZ ? : 1; /* microsecs */ +#ifndef CONFIG_NEWTOD /* * phase-lock loop variables */ @@ -807,6 +808,9 @@ } } while (ticks); } +#else /* !CONFIG_NEWTOD */ +#define update_wall_time(x) +#endif /* !CONFIG_NEWTOD */ /* * Called from the timer interrupt handler to charge one tick to the current Index: kernel/timesource.c =================================================================== --- /dev/null (tree:d414ab9a0f0995899c2e76c232714410f787b209) +++ 15eb8deaa5b22a81f97a9af307d81b0567115674/kernel/timesource.c (mode:100644) @@ -0,0 +1,237 @@ +/********************************************************************* +* linux/kernel/timesource.c +* +* This file contains the functions which manage timesource drivers. +* +* Copyright (C) 2004, 2005 IBM, John Stultz (johnstul@us.ibm.com) +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +* +* Revision History: +* 2004-12-07: A1 +* o Rework of timesource structure +* o Sent to lkml for review +* 2005-04-29: A4 +* o Keep track of all registered timesources +* o Add sysfs interface for overriding default selection +* 2005-05-12: A5 +* o Add boot-time timesource= option for timesource overrides +* TODO WishList: +* o Allow timesource drivers to be unregistered +* o get rid of timesource_jiffies extern +**********************************************************************/ + +#include <linux/timesource.h> +#include <linux/sysdev.h> +#include <linux/init.h> +#include <linux/module.h> + +#define MAX_TIMESOURCES 10 + + +/* XXX - Would like a better way for initializing curr_timesource */ +extern struct timesource_t timesource_jiffies; + +/*[Timesource internal variables]--------- + * curr_timesource: + * currently selected timesource. Initialized to timesource_jiffies. + * next_timesource: + * pending next selected timesource. + * timesource_list: + * array of pointers pointing to registered timesources + * timesource_list_counter: + * value which counts the number of registered timesources + * timesource_lock: + * protects manipulations to curr_timesource and next_timesource + * and the timesource_list + */ +static struct timesource_t *curr_timesource = ×ource_jiffies; +static struct timesource_t *next_timesource; +static struct timesource_t *timesource_list[MAX_TIMESOURCES]; +static int timesource_list_counter; +static seqlock_t timesource_lock = SEQLOCK_UNLOCKED; + +static char override_name[32]; + +/** + * get_next_timesource - Returns the selected timesource + * + */ +struct timesource_t* get_next_timesource(void) +{ + write_seqlock(×ource_lock); + if (next_timesource) { + curr_timesource = next_timesource; + next_timesource = NULL; + } + write_sequnlock(×ource_lock); + + return curr_timesource; +} + +/** + * select_timesource - Finds the best registered timesource. + * + * Private function. Must have a writelock on timesource_lock + * when called. + */ +static struct timesource_t* select_timesource(void) +{ + struct timesource_t* best = timesource_list[0]; + int i; + + for (i=0; i < timesource_list_counter; i++) { + /* Check for override */ + if ((override_name[0] != 0) && + (!strncmp(timesource_list[i]->name, override_name, + strlen(override_name)))) { + best = timesource_list[i]; + break; + } + /* Pick the highest priority */ + if (timesource_list[i]->priority > best->priority) + best = timesource_list[i]; + } + return best; +} + +/** + * register_timesource - Used to install new timesources + * @t: timesource to be registered + * + */ +void register_timesource(struct timesource_t* t) +{ + char* error_msg = 0; + int i; + write_seqlock(×ource_lock); + + /* check if timesource is already registered */ + for (i=0; i < timesource_list_counter; i++) + if (!strncmp(timesource_list[i]->name, t->name, strlen(t->name))){ + error_msg = "Already registered!"; + break; + } + + /* check that the list isn't full */ + if (timesource_list_counter >= MAX_TIMESOURCES) + error_msg = "Too many timesources!"; + + if(!error_msg) + timesource_list[timesource_list_counter++] = t; + else + printk("register_timesource: Cannot register %s. %s\n", + t->name, error_msg); + + /* select next timesource */ + next_timesource = select_timesource(); + + write_sequnlock(×ource_lock); +} +EXPORT_SYMBOL(register_timesource); + +/** + * sysfs_show_timesources - sysfs interface for listing timesource + * @dev: unused + * @buf: char buffer to be filled with timesource list + * + * Provides sysfs interface for listing registered timesources + */ +static ssize_t sysfs_show_timesources(struct sys_device *dev, char *buf) +{ + int i; + char* curr = buf; + write_seqlock(×ource_lock); + for(i=0; i < timesource_list_counter; i++) { + /* Mark current timesource w/ a star */ + if (timesource_list[i] == curr_timesource) + curr += sprintf(curr, "*"); + curr += sprintf(curr, "%s ",timesource_list[i]->name); + } + write_sequnlock(×ource_lock); + + curr += sprintf(curr, "\n"); + return curr - buf; +} + +/** + * sysfs_override_timesource - interface for manually overriding timesource + * @dev: unused + * @buf: name of override timesource + * + * + * Takes input from sysfs interface for manually overriding + * the default timesource selction + */ +static ssize_t sysfs_override_timesource(struct sys_device *dev, + const char *buf, size_t count) +{ + /* check to avoid underflow later */ + if (strlen(buf) == 0) + return count; + + write_seqlock(×ource_lock); + + /* copy the name given */ + strncpy(override_name, buf, strlen(buf)-1); + override_name[strlen(buf)-1] = 0; + + /* see if we can find it */ + next_timesource = select_timesource(); + + write_sequnlock(×ource_lock); + return count; +} + +/* Sysfs setup bits: + */ +static SYSDEV_ATTR(timesource, 0600, sysfs_show_timesources, sysfs_override_timesource); + +static struct sysdev_class timesource_sysclass = { + set_kset_name("timesource"), +}; + +static struct sys_device device_timesource = { + .id = 0, + .cls = ×ource_sysclass, +}; + +static int init_timesource_sysfs(void) +{ + int error = sysdev_class_register(×ource_sysclass); + if (!error) { + error = sysdev_register(&device_timesource); + if (!error) + error = sysdev_create_file(&device_timesource, &attr_timesource); + } + return error; +} +device_initcall(init_timesource_sysfs); + + +/** + * boot_override_timesource - boot time override + * @str: override name + * + * Takes a timesource= boot argument and uses it + * as the timesource override name + */ +static int __init boot_override_timesource(char* str) +{ + if (str) + strlcpy(override_name, str, sizeof(override_name)); + return 1; +} +__setup("timesource=", boot_override_timesource); ^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH 2/4] new timeofday i386 arch specific changes (v. B1) 2005-06-01 23:09 [PATCH 1/4] new timeofday core subsystem " john stultz @ 2005-06-01 23:12 ` john stultz 2005-06-01 23:13 ` [PATCH 3/4] new timeofday x86-64 " john stultz 0 siblings, 1 reply; 42+ messages in thread From: john stultz @ 2005-06-01 23:12 UTC (permalink / raw) To: Andrew Morton Cc: lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andi Kleen, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Nishanth Aravamudan, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh Andrew, All, I'm just re-spinning this to resolve a conflict w/ the CPUFREQ changes Linus accepted last night. This patch converts the i386 arch to use the new timeofday infrastructure. It applies on top of my timeofday-core_B1 patch. This is a full conversion, so most of this patch is subtractions removing the existing arch specific time keeping code. This patch does not provide any i386 timesources, so using this patch alone on top of the timeofday- core patch will only give you the jiffies timesource. To get full replacements for the code being removed here, the following timeofday- timesources-i386 patch will need to be applied. Andrew, please consider for inclusion for testing into your tree (I'd like to target around end of July for possible inclusion into mainline). thanks -john Signed-off-by: John Stultz <johnstul@us.ibm.com> linux-2.6.12-rc5_timeofday-arch-i386_B1.patch ============================================= Index: arch/i386/Kconfig =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/i386/Kconfig (mode:100644) +++ 6f1948595e5fa374fc552a4a01fe5524530ea1dd/arch/i386/Kconfig (mode:100644) @@ -14,6 +14,10 @@ 486, 586, Pentiums, and various instruction-set-compatible chips by AMD, Cyrix, and others. +config NEWTOD + bool + default y + config MMU bool default y Index: arch/i386/kernel/Makefile =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/i386/kernel/Makefile (mode:100644) +++ 6f1948595e5fa374fc552a4a01fe5524530ea1dd/arch/i386/kernel/Makefile (mode:100644) @@ -7,10 +7,9 @@ obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \ pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \ - doublefault.o quirks.o + doublefault.o quirks.o tsc.o obj-y += cpu/ -obj-y += timers/ obj-$(CONFIG_ACPI_BOOT) += acpi/ obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o obj-$(CONFIG_MCA) += mca.o Index: arch/i386/kernel/i8259.c =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/i386/kernel/i8259.c (mode:100644) +++ 6f1948595e5fa374fc552a4a01fe5524530ea1dd/arch/i386/kernel/i8259.c (mode:100644) @@ -387,6 +387,48 @@ } } +#ifdef CONFIG_NEWTOD +void setup_pit_timer(void) +{ + extern spinlock_t i8253_lock; + unsigned long flags; + + spin_lock_irqsave(&i8253_lock, flags); + outb_p(0x34,PIT_MODE); /* binary, mode 2, LSB/MSB, ch 0 */ + udelay(10); + outb_p(LATCH & 0xff , PIT_CH0); /* LSB */ + udelay(10); + outb(LATCH >> 8 , PIT_CH0); /* MSB */ + spin_unlock_irqrestore(&i8253_lock, flags); +} + +static int timer_resume(struct sys_device *dev) +{ + setup_pit_timer(); + return 0; +} + +static struct sysdev_class timer_sysclass = { + set_kset_name("timer_pit"), + .resume = timer_resume, +}; + +static struct sys_device device_timer = { + .id = 0, + .cls = &timer_sysclass, +}; + +static int __init init_timer_sysfs(void) +{ + int error = sysdev_class_register(&timer_sysclass); + if (!error) + error = sysdev_register(&device_timer); + return error; +} + +device_initcall(init_timer_sysfs); +#endif + void __init init_IRQ(void) { int i; Index: arch/i386/kernel/setup.c =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/i386/kernel/setup.c (mode:100644) +++ 6f1948595e5fa374fc552a4a01fe5524530ea1dd/arch/i386/kernel/setup.c (mode:100644) @@ -1525,6 +1525,7 @@ conswitchp = &dummy_con; #endif #endif + tsc_init(); } #include "setup_arch_post.h" Index: arch/i386/kernel/time.c =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/i386/kernel/time.c (mode:100644) +++ 6f1948595e5fa374fc552a4a01fe5524530ea1dd/arch/i386/kernel/time.c (mode:100644) @@ -56,6 +56,7 @@ #include <asm/uaccess.h> #include <asm/processor.h> #include <asm/timer.h> +#include <asm/timeofday.h> #include "mach_time.h" @@ -86,8 +87,6 @@ DEFINE_SPINLOCK(i8253_lock); EXPORT_SYMBOL(i8253_lock); -struct timer_opts *cur_timer = &timer_none; - /* * This is a special lock that is owned by the CPU and holds the index * register we are working with. It is required for NMI access to the @@ -117,102 +116,19 @@ } EXPORT_SYMBOL(rtc_cmos_write); -/* - * This version of gettimeofday has microsecond resolution - * and better than microsecond precision on fast x86 machines with TSC. - */ -void do_gettimeofday(struct timeval *tv) -{ - unsigned long seq; - unsigned long usec, sec; - unsigned long max_ntp_tick; - - do { - unsigned long lost; - - seq = read_seqbegin(&xtime_lock); - - usec = cur_timer->get_offset(); - lost = jiffies - wall_jiffies; - - /* - * If time_adjust is negative then NTP is slowing the clock - * so make sure not to go into next possible interval. - * Better to lose some accuracy than have time go backwards.. - */ - if (unlikely(time_adjust < 0)) { - max_ntp_tick = (USEC_PER_SEC / HZ) - tickadj; - usec = min(usec, max_ntp_tick); - - if (lost) - usec += lost * max_ntp_tick; - } - else if (unlikely(lost)) - usec += lost * (USEC_PER_SEC / HZ); - - sec = xtime.tv_sec; - usec += (xtime.tv_nsec / 1000); - } while (read_seqretry(&xtime_lock, seq)); - - while (usec >= 1000000) { - usec -= 1000000; - sec++; - } - - tv->tv_sec = sec; - tv->tv_usec = usec; -} - -EXPORT_SYMBOL(do_gettimeofday); - -int do_settimeofday(struct timespec *tv) -{ - time_t wtm_sec, sec = tv->tv_sec; - long wtm_nsec, nsec = tv->tv_nsec; - - if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) - return -EINVAL; - - write_seqlock_irq(&xtime_lock); - /* - * This is revolting. We need to set "xtime" correctly. However, the - * value in this location is the value at the most recent update of - * wall time. Discover what correction gettimeofday() would have - * made, and then undo it! - */ - nsec -= cur_timer->get_offset() * NSEC_PER_USEC; - nsec -= (jiffies - wall_jiffies) * TICK_NSEC; - - wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); - wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); - - set_normalized_timespec(&xtime, sec, nsec); - set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec); - - time_adjust = 0; /* stop active adjtime() */ - time_status |= STA_UNSYNC; - time_maxerror = NTP_PHASE_LIMIT; - time_esterror = NTP_PHASE_LIMIT; - write_sequnlock_irq(&xtime_lock); - clock_was_set(); - return 0; -} - -EXPORT_SYMBOL(do_settimeofday); - static int set_rtc_mmss(unsigned long nowtime) { int retval; - - WARN_ON(irqs_disabled()); + unsigned long flags; /* gets recalled with irq locally disabled */ - spin_lock_irq(&rtc_lock); + /* XXX - does irqsave resolve this? -johnstul */ + spin_lock_irqsave(&rtc_lock, flags); if (efi_enabled) retval = efi_set_rtc_mmss(nowtime); else retval = mach_set_rtc_mmss(nowtime); - spin_unlock_irq(&rtc_lock); + spin_unlock_irqrestore(&rtc_lock, flags); return retval; } @@ -220,16 +136,6 @@ int timer_ack; -/* monotonic_clock(): returns # of nanoseconds passed since time_init() - * Note: This function is required to return accurate - * time even in the absence of multiple timer ticks. - */ -unsigned long long monotonic_clock(void) -{ - return cur_timer->monotonic_clock(); -} -EXPORT_SYMBOL(monotonic_clock); - #if defined(CONFIG_SMP) && defined(CONFIG_FRAME_POINTER) unsigned long profile_pc(struct pt_regs *regs) { @@ -244,12 +150,21 @@ #endif /* - * timer_interrupt() needs to keep up the real-time clock, - * as well as call the "do_timer()" routine every clocktick + * This is the same as the above, except we _also_ save the current + * Time Stamp Counter value at the time of the timer interrupt, so that + * we later on can estimate the time of day more exactly. */ -static inline void do_timer_interrupt(int irq, void *dev_id, - struct pt_regs *regs) +irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { + /* + * Here we are in the timer irq handler. We just have irqs locally + * disabled but we don't know if the timer_bh is running on the other + * CPU. We need to avoid to SMP race with it. NOTE: we don' t need + * the irq version of write_lock because as just said we have irq + * locally disabled. -arca + */ + write_seqlock(&xtime_lock); + #ifdef CONFIG_X86_IO_APIC if (timer_ack) { /* @@ -282,27 +197,6 @@ irq = inb_p( 0x61 ); /* read the current state */ outb_p( irq|0x80, 0x61 ); /* reset the IRQ */ } -} - -/* - * This is the same as the above, except we _also_ save the current - * Time Stamp Counter value at the time of the timer interrupt, so that - * we later on can estimate the time of day more exactly. - */ -irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) -{ - /* - * Here we are in the timer irq handler. We just have irqs locally - * disabled but we don't know if the timer_bh is running on the other - * CPU. We need to avoid to SMP race with it. NOTE: we don' t need - * the irq version of write_lock because as just said we have irq - * locally disabled. -arca - */ - write_seqlock(&xtime_lock); - - cur_timer->mark_offset(); - - do_timer_interrupt(irq, NULL, regs); write_sequnlock(&xtime_lock); return IRQ_HANDLED; @@ -324,55 +218,35 @@ return retval; } -static void sync_cmos_clock(unsigned long dummy); - -static struct timer_list sync_cmos_timer = - TIMER_INITIALIZER(sync_cmos_clock, 0, 0); -static void sync_cmos_clock(unsigned long dummy) +/* arch specific timeofday hooks */ +nsec_t read_persistent_clock(void) { - struct timeval now, next; - int fail = 1; + return (nsec_t)get_cmos_time() * NSEC_PER_SEC; +} +void sync_persistent_clock(struct timespec ts) +{ + static unsigned long last_rtc_update; /* * If we have an externally synchronized Linux clock, then update * CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be * called as close as possible to 500 ms before the new second starts. - * This code is run on a timer. If the clock is set, that timer - * may not expire at the correct time. Thus, we adjust... */ - if ((time_status & STA_UNSYNC) != 0) - /* - * Not synced, exit, do not restart a timer (if one is - * running, let it run out). - */ + if (ts.tv_sec <= last_rtc_update + 660) return; - do_gettimeofday(&now); - if (now.tv_usec >= USEC_AFTER - ((unsigned) TICK_SIZE) / 2 && - now.tv_usec <= USEC_BEFORE + ((unsigned) TICK_SIZE) / 2) - fail = set_rtc_mmss(now.tv_sec); - - next.tv_usec = USEC_AFTER - now.tv_usec; - if (next.tv_usec <= 0) - next.tv_usec += USEC_PER_SEC; - - if (!fail) - next.tv_sec = 659; - else - next.tv_sec = 0; - - if (next.tv_usec >= USEC_PER_SEC) { - next.tv_sec++; - next.tv_usec -= USEC_PER_SEC; + if((ts.tv_nsec / 1000) >= USEC_AFTER - ((unsigned) TICK_SIZE) / 2 && + (ts.tv_nsec / 1000) <= USEC_BEFORE + ((unsigned) TICK_SIZE) / 2) { + /* horrible...FIXME */ + if (set_rtc_mmss(ts.tv_sec) == 0) + last_rtc_update = ts.tv_sec; + else + last_rtc_update = ts.tv_sec - 600; /* do it again in 60 s */ } - mod_timer(&sync_cmos_timer, jiffies + timeval_to_jiffies(&next)); } -void notify_arch_cmos_timer(void) -{ - mod_timer(&sync_cmos_timer, jiffies + 1); -} + static long clock_cmos_diff, sleep_start; @@ -389,7 +263,6 @@ static int timer_resume(struct sys_device *dev) { - unsigned long flags; unsigned long sec; unsigned long sleep_length; @@ -399,10 +272,6 @@ #endif sec = get_cmos_time() + clock_cmos_diff; sleep_length = (get_cmos_time() - sleep_start) * HZ; - write_seqlock_irqsave(&xtime_lock, flags); - xtime.tv_sec = sec; - xtime.tv_nsec = 0; - write_sequnlock_irqrestore(&xtime_lock, flags); jiffies += sleep_length; wall_jiffies += sleep_length; return 0; @@ -436,17 +305,10 @@ /* Duplicate of time_init() below, with hpet_enable part added */ static void __init hpet_time_init(void) { - xtime.tv_sec = get_cmos_time(); - xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); - set_normalized_timespec(&wall_to_monotonic, - -xtime.tv_sec, -xtime.tv_nsec); - if ((hpet_enable() >= 0) && hpet_use_timer) { printk("Using HPET for base-timer\n"); } - cur_timer = select_timer(); - printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name); time_init_hook(); } @@ -464,13 +326,5 @@ return; } #endif - xtime.tv_sec = get_cmos_time(); - xtime.tv_nsec = (INITIAL_JIFFIES % HZ) * (NSEC_PER_SEC / HZ); - set_normalized_timespec(&wall_to_monotonic, - -xtime.tv_sec, -xtime.tv_nsec); - - cur_timer = select_timer(); - printk(KERN_INFO "Using %s for high-res timesource\n",cur_timer->name); - time_init_hook(); } Index: arch/i386/kernel/timers/Makefile =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/i386/kernel/timers/Makefile (mode:100644) +++ /dev/null (tree:6f1948595e5fa374fc552a4a01fe5524530ea1dd) @@ -1,9 +0,0 @@ -# -# Makefile for x86 timers -# - -obj-y := timer.o timer_none.o timer_tsc.o timer_pit.o common.o - -obj-$(CONFIG_X86_CYCLONE_TIMER) += timer_cyclone.o -obj-$(CONFIG_HPET_TIMER) += timer_hpet.o -obj-$(CONFIG_X86_PM_TIMER) += timer_pm.o Index: arch/i386/kernel/timers/common.c =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/i386/kernel/timers/common.c (mode:100644) +++ /dev/null (tree:6f1948595e5fa374fc552a4a01fe5524530ea1dd) @@ -1,162 +0,0 @@ -/* - * Common functions used across the timers go here - */ - -#include <linux/init.h> -#include <linux/timex.h> -#include <linux/errno.h> -#include <linux/jiffies.h> -#include <linux/module.h> - -#include <asm/io.h> -#include <asm/timer.h> -#include <asm/hpet.h> - -#include "mach_timer.h" - -/* ------ Calibrate the TSC ------- - * Return 2^32 * (1 / (TSC clocks per usec)) for do_fast_gettimeoffset(). - * Too much 64-bit arithmetic here to do this cleanly in C, and for - * accuracy's sake we want to keep the overhead on the CTC speaker (channel 2) - * output busy loop as low as possible. We avoid reading the CTC registers - * directly because of the awkward 8-bit access mechanism of the 82C54 - * device. - */ - -#define CALIBRATE_TIME (5 * 1000020/HZ) - -unsigned long calibrate_tsc(void) -{ - mach_prepare_counter(); - - { - unsigned long startlow, starthigh; - unsigned long endlow, endhigh; - unsigned long count; - - rdtsc(startlow,starthigh); - mach_countup(&count); - rdtsc(endlow,endhigh); - - - /* Error: ECTCNEVERSET */ - if (count <= 1) - goto bad_ctc; - - /* 64-bit subtract - gcc just messes up with long longs */ - __asm__("subl %2,%0\n\t" - "sbbl %3,%1" - :"=a" (endlow), "=d" (endhigh) - :"g" (startlow), "g" (starthigh), - "0" (endlow), "1" (endhigh)); - - /* Error: ECPUTOOFAST */ - if (endhigh) - goto bad_ctc; - - /* Error: ECPUTOOSLOW */ - if (endlow <= CALIBRATE_TIME) - goto bad_ctc; - - __asm__("divl %2" - :"=a" (endlow), "=d" (endhigh) - :"r" (endlow), "0" (0), "1" (CALIBRATE_TIME)); - - return endlow; - } - - /* - * The CTC wasn't reliable: we got a hit on the very first read, - * or the CPU was so fast/slow that the quotient wouldn't fit in - * 32 bits.. - */ -bad_ctc: - return 0; -} - -#ifdef CONFIG_HPET_TIMER -/* ------ Calibrate the TSC using HPET ------- - * Return 2^32 * (1 / (TSC clocks per usec)) for getting the CPU freq. - * Second output is parameter 1 (when non NULL) - * Set 2^32 * (1 / (tsc per HPET clk)) for delay_hpet(). - * calibrate_tsc() calibrates the processor TSC by comparing - * it to the HPET timer of known frequency. - * Too much 64-bit arithmetic here to do this cleanly in C - */ -#define CALIBRATE_CNT_HPET (5 * hpet_tick) -#define CALIBRATE_TIME_HPET (5 * KERNEL_TICK_USEC) - -unsigned long __init calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr) -{ - unsigned long tsc_startlow, tsc_starthigh; - unsigned long tsc_endlow, tsc_endhigh; - unsigned long hpet_start, hpet_end; - unsigned long result, remain; - - hpet_start = hpet_readl(HPET_COUNTER); - rdtsc(tsc_startlow, tsc_starthigh); - do { - hpet_end = hpet_readl(HPET_COUNTER); - } while ((hpet_end - hpet_start) < CALIBRATE_CNT_HPET); - rdtsc(tsc_endlow, tsc_endhigh); - - /* 64-bit subtract - gcc just messes up with long longs */ - __asm__("subl %2,%0\n\t" - "sbbl %3,%1" - :"=a" (tsc_endlow), "=d" (tsc_endhigh) - :"g" (tsc_startlow), "g" (tsc_starthigh), - "0" (tsc_endlow), "1" (tsc_endhigh)); - - /* Error: ECPUTOOFAST */ - if (tsc_endhigh) - goto bad_calibration; - - /* Error: ECPUTOOSLOW */ - if (tsc_endlow <= CALIBRATE_TIME_HPET) - goto bad_calibration; - - ASM_DIV64_REG(result, remain, tsc_endlow, 0, CALIBRATE_TIME_HPET); - if (remain > (tsc_endlow >> 1)) - result++; /* rounding the result */ - - if (tsc_hpet_quotient_ptr) { - unsigned long tsc_hpet_quotient; - - ASM_DIV64_REG(tsc_hpet_quotient, remain, tsc_endlow, 0, - CALIBRATE_CNT_HPET); - if (remain > (tsc_endlow >> 1)) - tsc_hpet_quotient++; /* rounding the result */ - *tsc_hpet_quotient_ptr = tsc_hpet_quotient; - } - - return result; -bad_calibration: - /* - * the CPU was so fast/slow that the quotient wouldn't fit in - * 32 bits.. - */ - return 0; -} -#endif - -/* calculate cpu_khz */ -void init_cpu_khz(void) -{ - if (cpu_has_tsc) { - unsigned long tsc_quotient = calibrate_tsc(); - if (tsc_quotient) { - /* report CPU clock rate in Hz. - * The formula is (10^6 * 2^32) / (2^32 * 1 / (clocks/us)) = - * clock/second. Our precision is about 100 ppm. - */ - { unsigned long eax=0, edx=1000; - __asm__("divl %2" - :"=a" (cpu_khz), "=d" (edx) - :"r" (tsc_quotient), - "0" (eax), "1" (edx)); - printk("Detected %lu.%03lu MHz processor.\n", cpu_khz / 1000, cpu_khz % 1000); - } - } - } -} - Index: arch/i386/kernel/timers/timer.c =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/i386/kernel/timers/timer.c (mode:100644) +++ /dev/null (tree:6f1948595e5fa374fc552a4a01fe5524530ea1dd) @@ -1,66 +0,0 @@ -#include <linux/init.h> -#include <linux/kernel.h> -#include <linux/string.h> -#include <asm/timer.h> - -#ifdef CONFIG_HPET_TIMER -/* - * HPET memory read is slower than tsc reads, but is more dependable as it - * always runs at constant frequency and reduces complexity due to - * cpufreq. So, we prefer HPET timer to tsc based one. Also, we cannot use - * timer_pit when HPET is active. So, we default to timer_tsc. - */ -#endif -/* list of timers, ordered by preference, NULL terminated */ -static struct init_timer_opts* __initdata timers[] = { -#ifdef CONFIG_X86_CYCLONE_TIMER - &timer_cyclone_init, -#endif -#ifdef CONFIG_HPET_TIMER - &timer_hpet_init, -#endif -#ifdef CONFIG_X86_PM_TIMER - &timer_pmtmr_init, -#endif - &timer_tsc_init, - &timer_pit_init, - NULL, -}; - -static char clock_override[10] __initdata; - -static int __init clock_setup(char* str) -{ - if (str) - strlcpy(clock_override, str, sizeof(clock_override)); - return 1; -} -__setup("clock=", clock_setup); - - -/* The chosen timesource has been found to be bad. - * Fall back to a known good timesource (the PIT) - */ -void clock_fallback(void) -{ - cur_timer = &timer_pit; -} - -/* iterates through the list of timers, returning the first - * one that initializes successfully. - */ -struct timer_opts* __init select_timer(void) -{ - int i = 0; - - /* find most preferred working timer */ - while (timers[i]) { - if (timers[i]->init) - if (timers[i]->init(clock_override) == 0) - return timers[i]->opts; - ++i; - } - - panic("select_timer: Cannot find a suitable timer\n"); - return NULL; -} Index: arch/i386/kernel/timers/timer_cyclone.c =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/i386/kernel/timers/timer_cyclone.c (mode:100644) +++ /dev/null (tree:6f1948595e5fa374fc552a4a01fe5524530ea1dd) @@ -1,259 +0,0 @@ -/* Cyclone-timer: - * This code implements timer_ops for the cyclone counter found - * on IBM x440, x360, and other Summit based systems. - * - * Copyright (C) 2002 IBM, John Stultz (johnstul@us.ibm.com) - */ - - -#include <linux/spinlock.h> -#include <linux/init.h> -#include <linux/timex.h> -#include <linux/errno.h> -#include <linux/string.h> -#include <linux/jiffies.h> - -#include <asm/timer.h> -#include <asm/io.h> -#include <asm/pgtable.h> -#include <asm/fixmap.h> -#include "io_ports.h" - -extern spinlock_t i8253_lock; - -/* Number of usecs that the last interrupt was delayed */ -static int delay_at_last_interrupt; - -#define CYCLONE_CBAR_ADDR 0xFEB00CD0 -#define CYCLONE_PMCC_OFFSET 0x51A0 -#define CYCLONE_MPMC_OFFSET 0x51D0 -#define CYCLONE_MPCS_OFFSET 0x51A8 -#define CYCLONE_TIMER_FREQ 100000000 -#define CYCLONE_TIMER_MASK (((u64)1<<40)-1) /* 40 bit mask */ -int use_cyclone = 0; - -static u32* volatile cyclone_timer; /* Cyclone MPMC0 register */ -static u32 last_cyclone_low; -static u32 last_cyclone_high; -static unsigned long long monotonic_base; -static seqlock_t monotonic_lock = SEQLOCK_UNLOCKED; - -/* helper macro to atomically read both cyclone counter registers */ -#define read_cyclone_counter(low,high) \ - do{ \ - high = cyclone_timer[1]; low = cyclone_timer[0]; \ - } while (high != cyclone_timer[1]); - - -static void mark_offset_cyclone(void) -{ - unsigned long lost, delay; - unsigned long delta = last_cyclone_low; - int count; - unsigned long long this_offset, last_offset; - - write_seqlock(&monotonic_lock); - last_offset = ((unsigned long long)last_cyclone_high<<32)|last_cyclone_low; - - spin_lock(&i8253_lock); - read_cyclone_counter(last_cyclone_low,last_cyclone_high); - - /* read values for delay_at_last_interrupt */ - outb_p(0x00, 0x43); /* latch the count ASAP */ - - count = inb_p(0x40); /* read the latched count */ - count |= inb(0x40) << 8; - - /* - * VIA686a test code... reset the latch if count > max + 1 - * from timer_pit.c - cjb - */ - if (count > LATCH) { - outb_p(0x34, PIT_MODE); - outb_p(LATCH & 0xff, PIT_CH0); - outb(LATCH >> 8, PIT_CH0); - count = LATCH - 1; - } - spin_unlock(&i8253_lock); - - /* lost tick compensation */ - delta = last_cyclone_low - delta; - delta /= (CYCLONE_TIMER_FREQ/1000000); - delta += delay_at_last_interrupt; - lost = delta/(1000000/HZ); - delay = delta%(1000000/HZ); - if (lost >= 2) - jiffies_64 += lost-1; - - /* update the monotonic base value */ - this_offset = ((unsigned long long)last_cyclone_high<<32)|last_cyclone_low; - monotonic_base += (this_offset - last_offset) & CYCLONE_TIMER_MASK; - write_sequnlock(&monotonic_lock); - - /* calculate delay_at_last_interrupt */ - count = ((LATCH-1) - count) * TICK_SIZE; - delay_at_last_interrupt = (count + LATCH/2) / LATCH; - - - /* catch corner case where tick rollover occured - * between cyclone and pit reads (as noted when - * usec delta is > 90% # of usecs/tick) - */ - if (lost && abs(delay - delay_at_last_interrupt) > (900000/HZ)) - jiffies_64++; -} - -static unsigned long get_offset_cyclone(void) -{ - u32 offset; - - if(!cyclone_timer) - return delay_at_last_interrupt; - - /* Read the cyclone timer */ - offset = cyclone_timer[0]; - - /* .. relative to previous jiffy */ - offset = offset - last_cyclone_low; - - /* convert cyclone ticks to microseconds */ - /* XXX slow, can we speed this up? */ - offset = offset/(CYCLONE_TIMER_FREQ/1000000); - - /* our adjusted time offset in microseconds */ - return delay_at_last_interrupt + offset; -} - -static unsigned long long monotonic_clock_cyclone(void) -{ - u32 now_low, now_high; - unsigned long long last_offset, this_offset, base; - unsigned long long ret; - unsigned seq; - - /* atomically read monotonic base & last_offset */ - do { - seq = read_seqbegin(&monotonic_lock); - last_offset = ((unsigned long long)last_cyclone_high<<32)|last_cyclone_low; - base = monotonic_base; - } while (read_seqretry(&monotonic_lock, seq)); - - - /* Read the cyclone counter */ - read_cyclone_counter(now_low,now_high); - this_offset = ((unsigned long long)now_high<<32)|now_low; - - /* convert to nanoseconds */ - ret = base + ((this_offset - last_offset)&CYCLONE_TIMER_MASK); - return ret * (1000000000 / CYCLONE_TIMER_FREQ); -} - -static int __init init_cyclone(char* override) -{ - u32* reg; - u32 base; /* saved cyclone base address */ - u32 pageaddr; /* page that contains cyclone_timer register */ - u32 offset; /* offset from pageaddr to cyclone_timer register */ - int i; - - /* check clock override */ - if (override[0] && strncmp(override,"cyclone",7)) - return -ENODEV; - - /*make sure we're on a summit box*/ - if(!use_cyclone) return -ENODEV; - - printk(KERN_INFO "Summit chipset: Starting Cyclone Counter.\n"); - - /* find base address */ - pageaddr = (CYCLONE_CBAR_ADDR)&PAGE_MASK; - offset = (CYCLONE_CBAR_ADDR)&(~PAGE_MASK); - set_fixmap_nocache(FIX_CYCLONE_TIMER, pageaddr); - reg = (u32*)(fix_to_virt(FIX_CYCLONE_TIMER) + offset); - if(!reg){ - printk(KERN_ERR "Summit chipset: Could not find valid CBAR register.\n"); - return -ENODEV; - } - base = *reg; - if(!base){ - printk(KERN_ERR "Summit chipset: Could not find valid CBAR value.\n"); - return -ENODEV; - } - - /* setup PMCC */ - pageaddr = (base + CYCLONE_PMCC_OFFSET)&PAGE_MASK; - offset = (base + CYCLONE_PMCC_OFFSET)&(~PAGE_MASK); - set_fixmap_nocache(FIX_CYCLONE_TIMER, pageaddr); - reg = (u32*)(fix_to_virt(FIX_CYCLONE_TIMER) + offset); - if(!reg){ - printk(KERN_ERR "Summit chipset: Could not find valid PMCC register.\n"); - return -ENODEV; - } - reg[0] = 0x00000001; - - /* setup MPCS */ - pageaddr = (base + CYCLONE_MPCS_OFFSET)&PAGE_MASK; - offset = (base + CYCLONE_MPCS_OFFSET)&(~PAGE_MASK); - set_fixmap_nocache(FIX_CYCLONE_TIMER, pageaddr); - reg = (u32*)(fix_to_virt(FIX_CYCLONE_TIMER) + offset); - if(!reg){ - printk(KERN_ERR "Summit chipset: Could not find valid MPCS register.\n"); - return -ENODEV; - } - reg[0] = 0x00000001; - - /* map in cyclone_timer */ - pageaddr = (base + CYCLONE_MPMC_OFFSET)&PAGE_MASK; - offset = (base + CYCLONE_MPMC_OFFSET)&(~PAGE_MASK); - set_fixmap_nocache(FIX_CYCLONE_TIMER, pageaddr); - cyclone_timer = (u32*)(fix_to_virt(FIX_CYCLONE_TIMER) + offset); - if(!cyclone_timer){ - printk(KERN_ERR "Summit chipset: Could not find valid MPMC register.\n"); - return -ENODEV; - } - - /*quick test to make sure its ticking*/ - for(i=0; i<3; i++){ - u32 old = cyclone_timer[0]; - int stall = 100; - while(stall--) barrier(); - if(cyclone_timer[0] == old){ - printk(KERN_ERR "Summit chipset: Counter not counting! DISABLED\n"); - cyclone_timer = 0; - return -ENODEV; - } - } - - init_cpu_khz(); - - /* Everything looks good! */ - return 0; -} - - -static void delay_cyclone(unsigned long loops) -{ - unsigned long bclock, now; - if(!cyclone_timer) - return; - bclock = cyclone_timer[0]; - do { - rep_nop(); - now = cyclone_timer[0]; - } while ((now-bclock) < loops); -} -/************************************************************/ - -/* cyclone timer_opts struct */ -static struct timer_opts timer_cyclone = { - .name = "cyclone", - .mark_offset = mark_offset_cyclone, - .get_offset = get_offset_cyclone, - .monotonic_clock = monotonic_clock_cyclone, - .delay = delay_cyclone, -}; - -struct init_timer_opts __initdata timer_cyclone_init = { - .init = init_cyclone, - .opts = &timer_cyclone, -}; Index: arch/i386/kernel/timers/timer_hpet.c =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/i386/kernel/timers/timer_hpet.c (mode:100644) +++ /dev/null (tree:6f1948595e5fa374fc552a4a01fe5524530ea1dd) @@ -1,194 +0,0 @@ -/* - * This code largely moved from arch/i386/kernel/time.c. - * See comments there for proper credits. - */ - -#include <linux/spinlock.h> -#include <linux/init.h> -#include <linux/timex.h> -#include <linux/errno.h> -#include <linux/string.h> -#include <linux/jiffies.h> - -#include <asm/timer.h> -#include <asm/io.h> -#include <asm/processor.h> - -#include "io_ports.h" -#include "mach_timer.h" -#include <asm/hpet.h> - -static unsigned long hpet_usec_quotient; /* convert hpet clks to usec */ -static unsigned long tsc_hpet_quotient; /* convert tsc to hpet clks */ -static unsigned long hpet_last; /* hpet counter value at last tick*/ -static unsigned long last_tsc_low; /* lsb 32 bits of Time Stamp Counter */ -static unsigned long last_tsc_high; /* msb 32 bits of Time Stamp Counter */ -static unsigned long long monotonic_base; -static seqlock_t monotonic_lock = SEQLOCK_UNLOCKED; - -/* convert from cycles(64bits) => nanoseconds (64bits) - * basic equation: - * ns = cycles / (freq / ns_per_sec) - * ns = cycles * (ns_per_sec / freq) - * ns = cycles * (10^9 / (cpu_mhz * 10^6)) - * ns = cycles * (10^3 / cpu_mhz) - * - * Then we use scaling math (suggested by george@mvista.com) to get: - * ns = cycles * (10^3 * SC / cpu_mhz) / SC - * ns = cycles * cyc2ns_scale / SC - * - * And since SC is a constant power of two, we can convert the div - * into a shift. - * -johnstul@us.ibm.com "math is hard, lets go shopping!" - */ -static unsigned long cyc2ns_scale; -#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */ - -static inline void set_cyc2ns_scale(unsigned long cpu_mhz) -{ - cyc2ns_scale = (1000 << CYC2NS_SCALE_FACTOR)/cpu_mhz; -} - -static inline unsigned long long cycles_2_ns(unsigned long long cyc) -{ - return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR; -} - -static unsigned long long monotonic_clock_hpet(void) -{ - unsigned long long last_offset, this_offset, base; - unsigned seq; - - /* atomically read monotonic base & last_offset */ - do { - seq = read_seqbegin(&monotonic_lock); - last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; - base = monotonic_base; - } while (read_seqretry(&monotonic_lock, seq)); - - /* Read the Time Stamp Counter */ - rdtscll(this_offset); - - /* return the value in ns */ - return base + cycles_2_ns(this_offset - last_offset); -} - -static unsigned long get_offset_hpet(void) -{ - register unsigned long eax, edx; - - eax = hpet_readl(HPET_COUNTER); - eax -= hpet_last; /* hpet delta */ - eax = min(hpet_tick, eax); - /* - * Time offset = (hpet delta) * ( usecs per HPET clock ) - * = (hpet delta) * ( usecs per tick / HPET clocks per tick) - * = (hpet delta) * ( hpet_usec_quotient ) / (2^32) - * - * Where, - * hpet_usec_quotient = (2^32 * usecs per tick)/HPET clocks per tick - * - * Using a mull instead of a divl saves some cycles in critical path. - */ - ASM_MUL64_REG(eax, edx, hpet_usec_quotient, eax); - - /* our adjusted time offset in microseconds */ - return edx; -} - -static void mark_offset_hpet(void) -{ - unsigned long long this_offset, last_offset; - unsigned long offset; - - write_seqlock(&monotonic_lock); - last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; - rdtsc(last_tsc_low, last_tsc_high); - - if (hpet_use_timer) - offset = hpet_readl(HPET_T0_CMP) - hpet_tick; - else - offset = hpet_readl(HPET_COUNTER); - if (unlikely(((offset - hpet_last) >= (2*hpet_tick)) && (hpet_last != 0))) { - int lost_ticks = ((offset - hpet_last) / hpet_tick) - 1; - jiffies_64 += lost_ticks; - } - hpet_last = offset; - - /* update the monotonic base value */ - this_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; - monotonic_base += cycles_2_ns(this_offset - last_offset); - write_sequnlock(&monotonic_lock); -} - -static void delay_hpet(unsigned long loops) -{ - unsigned long hpet_start, hpet_end; - unsigned long eax; - - /* loops is the number of cpu cycles. Convert it to hpet clocks */ - ASM_MUL64_REG(eax, loops, tsc_hpet_quotient, loops); - - hpet_start = hpet_readl(HPET_COUNTER); - do { - rep_nop(); - hpet_end = hpet_readl(HPET_COUNTER); - } while ((hpet_end - hpet_start) < (loops)); -} - -static int __init init_hpet(char* override) -{ - unsigned long result, remain; - - /* check clock override */ - if (override[0] && strncmp(override,"hpet",4)) - return -ENODEV; - - if (!is_hpet_enabled()) - return -ENODEV; - - printk("Using HPET for gettimeofday\n"); - if (cpu_has_tsc) { - unsigned long tsc_quotient = calibrate_tsc_hpet(&tsc_hpet_quotient); - if (tsc_quotient) { - /* report CPU clock rate in Hz. - * The formula is (10^6 * 2^32) / (2^32 * 1 / (clocks/us)) = - * clock/second. Our precision is about 100 ppm. - */ - { unsigned long eax=0, edx=1000; - ASM_DIV64_REG(cpu_khz, edx, tsc_quotient, - eax, edx); - printk("Detected %lu.%03lu MHz processor.\n", - cpu_khz / 1000, cpu_khz % 1000); - } - set_cyc2ns_scale(cpu_khz/1000); - } - } - - /* - * Math to calculate hpet to usec multiplier - * Look for the comments at get_offset_hpet() - */ - ASM_DIV64_REG(result, remain, hpet_tick, 0, KERNEL_TICK_USEC); - if (remain > (hpet_tick >> 1)) - result++; /* rounding the result */ - hpet_usec_quotient = result; - - return 0; -} - -/************************************************************/ - -/* tsc timer_opts struct */ -static struct timer_opts timer_hpet = { - .name = "hpet", - .mark_offset = mark_offset_hpet, - .get_offset = get_offset_hpet, - .monotonic_clock = monotonic_clock_hpet, - .delay = delay_hpet, -}; - -struct init_timer_opts __initdata timer_hpet_init = { - .init = init_hpet, - .opts = &timer_hpet, -}; Index: arch/i386/kernel/timers/timer_none.c =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/i386/kernel/timers/timer_none.c (mode:100644) +++ /dev/null (tree:6f1948595e5fa374fc552a4a01fe5524530ea1dd) @@ -1,39 +0,0 @@ -#include <linux/init.h> -#include <asm/timer.h> - -static void mark_offset_none(void) -{ - /* nothing needed */ -} - -static unsigned long get_offset_none(void) -{ - return 0; -} - -static unsigned long long monotonic_clock_none(void) -{ - return 0; -} - -static void delay_none(unsigned long loops) -{ - int d0; - __asm__ __volatile__( - "\tjmp 1f\n" - ".align 16\n" - "1:\tjmp 2f\n" - ".align 16\n" - "2:\tdecl %0\n\tjns 2b" - :"=&a" (d0) - :"0" (loops)); -} - -/* none timer_opts struct */ -struct timer_opts timer_none = { - .name = "none", - .mark_offset = mark_offset_none, - .get_offset = get_offset_none, - .monotonic_clock = monotonic_clock_none, - .delay = delay_none, -}; Index: arch/i386/kernel/timers/timer_pit.c =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/i386/kernel/timers/timer_pit.c (mode:100644) +++ /dev/null (tree:6f1948595e5fa374fc552a4a01fe5524530ea1dd) @@ -1,206 +0,0 @@ -/* - * This code largely moved from arch/i386/kernel/time.c. - * See comments there for proper credits. - */ - -#include <linux/spinlock.h> -#include <linux/module.h> -#include <linux/device.h> -#include <linux/irq.h> -#include <linux/sysdev.h> -#include <linux/timex.h> -#include <asm/delay.h> -#include <asm/mpspec.h> -#include <asm/timer.h> -#include <asm/smp.h> -#include <asm/io.h> -#include <asm/arch_hooks.h> - -extern spinlock_t i8259A_lock; -extern spinlock_t i8253_lock; -#include "do_timer.h" -#include "io_ports.h" - -static int count_p; /* counter in get_offset_pit() */ - -static int __init init_pit(char* override) -{ - /* check clock override */ - if (override[0] && strncmp(override,"pit",3)) - printk(KERN_ERR "Warning: clock= override failed. Defaulting to PIT\n"); - - count_p = LATCH; - return 0; -} - -static void mark_offset_pit(void) -{ - /* nothing needed */ -} - -static unsigned long long monotonic_clock_pit(void) -{ - return 0; -} - -static void delay_pit(unsigned long loops) -{ - int d0; - __asm__ __volatile__( - "\tjmp 1f\n" - ".align 16\n" - "1:\tjmp 2f\n" - ".align 16\n" - "2:\tdecl %0\n\tjns 2b" - :"=&a" (d0) - :"0" (loops)); -} - - -/* This function must be called with xtime_lock held. - * It was inspired by Steve McCanne's microtime-i386 for BSD. -- jrs - * - * However, the pc-audio speaker driver changes the divisor so that - * it gets interrupted rather more often - it loads 64 into the - * counter rather than 11932! This has an adverse impact on - * do_gettimeoffset() -- it stops working! What is also not - * good is that the interval that our timer function gets called - * is no longer 10.0002 ms, but 9.9767 ms. To get around this - * would require using a different timing source. Maybe someone - * could use the RTC - I know that this can interrupt at frequencies - * ranging from 8192Hz to 2Hz. If I had the energy, I'd somehow fix - * it so that at startup, the timer code in sched.c would select - * using either the RTC or the 8253 timer. The decision would be - * based on whether there was any other device around that needed - * to trample on the 8253. I'd set up the RTC to interrupt at 1024 Hz, - * and then do some jiggery to have a version of do_timer that - * advanced the clock by 1/1024 s. Every time that reached over 1/100 - * of a second, then do all the old code. If the time was kept correct - * then do_gettimeoffset could just return 0 - there is no low order - * divider that can be accessed. - * - * Ideally, you would be able to use the RTC for the speaker driver, - * but it appears that the speaker driver really needs interrupt more - * often than every 120 us or so. - * - * Anyway, this needs more thought.... pjsg (1993-08-28) - * - * If you are really that interested, you should be reading - * comp.protocols.time.ntp! - */ - -static unsigned long get_offset_pit(void) -{ - int count; - unsigned long flags; - static unsigned long jiffies_p = 0; - - /* - * cache volatile jiffies temporarily; we have xtime_lock. - */ - unsigned long jiffies_t; - - spin_lock_irqsave(&i8253_lock, flags); - /* timer count may underflow right here */ - outb_p(0x00, PIT_MODE); /* latch the count ASAP */ - - count = inb_p(PIT_CH0); /* read the latched count */ - - /* - * We do this guaranteed double memory access instead of a _p - * postfix in the previous port access. Wheee, hackady hack - */ - jiffies_t = jiffies; - - count |= inb_p(PIT_CH0) << 8; - - /* VIA686a test code... reset the latch if count > max + 1 */ - if (count > LATCH) { - outb_p(0x34, PIT_MODE); - outb_p(LATCH & 0xff, PIT_CH0); - outb(LATCH >> 8, PIT_CH0); - count = LATCH - 1; - } - - /* - * avoiding timer inconsistencies (they are rare, but they happen)... - * there are two kinds of problems that must be avoided here: - * 1. the timer counter underflows - * 2. hardware problem with the timer, not giving us continuous time, - * the counter does small "jumps" upwards on some Pentium systems, - * (see c't 95/10 page 335 for Neptun bug.) - */ - - if( jiffies_t == jiffies_p ) { - if( count > count_p ) { - /* the nutcase */ - count = do_timer_overflow(count); - } - } else - jiffies_p = jiffies_t; - - count_p = count; - - spin_unlock_irqrestore(&i8253_lock, flags); - - count = ((LATCH-1) - count) * TICK_SIZE; - count = (count + LATCH/2) / LATCH; - - return count; -} - - -/* tsc timer_opts struct */ -struct timer_opts timer_pit = { - .name = "pit", - .mark_offset = mark_offset_pit, - .get_offset = get_offset_pit, - .monotonic_clock = monotonic_clock_pit, - .delay = delay_pit, -}; - -struct init_timer_opts __initdata timer_pit_init = { - .init = init_pit, - .opts = &timer_pit, -}; - -void setup_pit_timer(void) -{ - extern spinlock_t i8253_lock; - unsigned long flags; - - spin_lock_irqsave(&i8253_lock, flags); - outb_p(0x34,PIT_MODE); /* binary, mode 2, LSB/MSB, ch 0 */ - udelay(10); - outb_p(LATCH & 0xff , PIT_CH0); /* LSB */ - udelay(10); - outb(LATCH >> 8 , PIT_CH0); /* MSB */ - spin_unlock_irqrestore(&i8253_lock, flags); -} - -static int timer_resume(struct sys_device *dev) -{ - setup_pit_timer(); - return 0; -} - -static struct sysdev_class timer_sysclass = { - set_kset_name("timer_pit"), - .resume = timer_resume, -}; - -static struct sys_device device_timer = { - .id = 0, - .cls = &timer_sysclass, -}; - -static int __init init_timer_sysfs(void) -{ - int error = sysdev_class_register(&timer_sysclass); - if (!error) - error = sysdev_register(&device_timer); - return error; -} - -device_initcall(init_timer_sysfs); - Index: arch/i386/kernel/timers/timer_pm.c =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/i386/kernel/timers/timer_pm.c (mode:100644) +++ /dev/null (tree:6f1948595e5fa374fc552a4a01fe5524530ea1dd) @@ -1,258 +0,0 @@ -/* - * (C) Dominik Brodowski <linux@brodo.de> 2003 - * - * Driver to use the Power Management Timer (PMTMR) available in some - * southbridges as primary timing source for the Linux kernel. - * - * Based on parts of linux/drivers/acpi/hardware/hwtimer.c, timer_pit.c, - * timer_hpet.c, and on Arjan van de Ven's implementation for 2.4. - * - * This file is licensed under the GPL v2. - */ - - -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/device.h> -#include <linux/init.h> -#include <asm/types.h> -#include <asm/timer.h> -#include <asm/smp.h> -#include <asm/io.h> -#include <asm/arch_hooks.h> - -#include <linux/timex.h> -#include "mach_timer.h" - -/* Number of PMTMR ticks expected during calibration run */ -#define PMTMR_TICKS_PER_SEC 3579545 -#define PMTMR_EXPECTED_RATE \ - ((CALIBRATE_LATCH * (PMTMR_TICKS_PER_SEC >> 10)) / (CLOCK_TICK_RATE>>10)) - - -/* The I/O port the PMTMR resides at. - * The location is detected during setup_arch(), - * in arch/i386/acpi/boot.c */ -u32 pmtmr_ioport = 0; - - -/* value of the Power timer at last timer interrupt */ -static u32 offset_tick; -static u32 offset_delay; - -static unsigned long long monotonic_base; -static seqlock_t monotonic_lock = SEQLOCK_UNLOCKED; - -#define ACPI_PM_MASK 0xFFFFFF /* limit it to 24 bits */ - -/*helper function to safely read acpi pm timesource*/ -static inline u32 read_pmtmr(void) -{ - u32 v1=0,v2=0,v3=0; - /* It has been reported that because of various broken - * chipsets (ICH4, PIIX4 and PIIX4E) where the ACPI PM time - * source is not latched, so you must read it multiple - * times to insure a safe value is read. - */ - do { - v1 = inl(pmtmr_ioport); - v2 = inl(pmtmr_ioport); - v3 = inl(pmtmr_ioport); - } while ((v1 > v2 && v1 < v3) || (v2 > v3 && v2 < v1) - || (v3 > v1 && v3 < v2)); - - /* mask the output to 24 bits */ - return v2 & ACPI_PM_MASK; -} - - -/* - * Some boards have the PMTMR running way too fast. We check - * the PMTMR rate against PIT channel 2 to catch these cases. - */ -static int verify_pmtmr_rate(void) -{ - u32 value1, value2; - unsigned long count, delta; - - mach_prepare_counter(); - value1 = read_pmtmr(); - mach_countup(&count); - value2 = read_pmtmr(); - delta = (value2 - value1) & ACPI_PM_MASK; - - /* Check that the PMTMR delta is within 5% of what we expect */ - if (delta < (PMTMR_EXPECTED_RATE * 19) / 20 || - delta > (PMTMR_EXPECTED_RATE * 21) / 20) { - printk(KERN_INFO "PM-Timer running at invalid rate: %lu%% of normal - aborting.\n", 100UL * delta / PMTMR_EXPECTED_RATE); - return -1; - } - - return 0; -} - - -static int init_pmtmr(char* override) -{ - u32 value1, value2; - unsigned int i; - - if (override[0] && strncmp(override,"pmtmr",5)) - return -ENODEV; - - if (!pmtmr_ioport) - return -ENODEV; - - /* we use the TSC for delay_pmtmr, so make sure it exists */ - if (!cpu_has_tsc) - return -ENODEV; - - /* "verify" this timing source */ - value1 = read_pmtmr(); - for (i = 0; i < 10000; i++) { - value2 = read_pmtmr(); - if (value2 == value1) - continue; - if (value2 > value1) - goto pm_good; - if ((value2 < value1) && ((value2) < 0xFFF)) - goto pm_good; - printk(KERN_INFO "PM-Timer had inconsistent results: 0x%#x, 0x%#x - aborting.\n", value1, value2); - return -EINVAL; - } - printk(KERN_INFO "PM-Timer had no reasonable result: 0x%#x - aborting.\n", value1); - return -ENODEV; - -pm_good: - if (verify_pmtmr_rate() != 0) - return -ENODEV; - - init_cpu_khz(); - return 0; -} - -static inline u32 cyc2us(u32 cycles) -{ - /* The Power Management Timer ticks at 3.579545 ticks per microsecond. - * 1 / PM_TIMER_FREQUENCY == 0.27936511 =~ 286/1024 [error: 0.024%] - * - * Even with HZ = 100, delta is at maximum 35796 ticks, so it can - * easily be multiplied with 286 (=0x11E) without having to fear - * u32 overflows. - */ - cycles *= 286; - return (cycles >> 10); -} - -/* - * this gets called during each timer interrupt - * - Called while holding the writer xtime_lock - */ -static void mark_offset_pmtmr(void) -{ - u32 lost, delta, last_offset; - static int first_run = 1; - last_offset = offset_tick; - - write_seqlock(&monotonic_lock); - - offset_tick = read_pmtmr(); - - /* calculate tick interval */ - delta = (offset_tick - last_offset) & ACPI_PM_MASK; - - /* convert to usecs */ - delta = cyc2us(delta); - - /* update the monotonic base value */ - monotonic_base += delta * NSEC_PER_USEC; - write_sequnlock(&monotonic_lock); - - /* convert to ticks */ - delta += offset_delay; - lost = delta / (USEC_PER_SEC / HZ); - offset_delay = delta % (USEC_PER_SEC / HZ); - - - /* compensate for lost ticks */ - if (lost >= 2) - jiffies_64 += lost - 1; - - /* don't calculate delay for first run, - or if we've got less then a tick */ - if (first_run || (lost < 1)) { - first_run = 0; - offset_delay = 0; - } -} - - -static unsigned long long monotonic_clock_pmtmr(void) -{ - u32 last_offset, this_offset; - unsigned long long base, ret; - unsigned seq; - - - /* atomically read monotonic base & last_offset */ - do { - seq = read_seqbegin(&monotonic_lock); - last_offset = offset_tick; - base = monotonic_base; - } while (read_seqretry(&monotonic_lock, seq)); - - /* Read the pmtmr */ - this_offset = read_pmtmr(); - - /* convert to nanoseconds */ - ret = (this_offset - last_offset) & ACPI_PM_MASK; - ret = base + (cyc2us(ret) * NSEC_PER_USEC); - return ret; -} - -static void delay_pmtmr(unsigned long loops) -{ - unsigned long bclock, now; - - rdtscl(bclock); - do - { - rep_nop(); - rdtscl(now); - } while ((now-bclock) < loops); -} - - -/* - * get the offset (in microseconds) from the last call to mark_offset() - * - Called holding a reader xtime_lock - */ -static unsigned long get_offset_pmtmr(void) -{ - u32 now, offset, delta = 0; - - offset = offset_tick; - now = read_pmtmr(); - delta = (now - offset)&ACPI_PM_MASK; - - return (unsigned long) offset_delay + cyc2us(delta); -} - - -/* acpi timer_opts struct */ -static struct timer_opts timer_pmtmr = { - .name = "pmtmr", - .mark_offset = mark_offset_pmtmr, - .get_offset = get_offset_pmtmr, - .monotonic_clock = monotonic_clock_pmtmr, - .delay = delay_pmtmr, -}; - -struct init_timer_opts __initdata timer_pmtmr_init = { - .init = init_pmtmr, - .opts = &timer_pmtmr, -}; - -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Dominik Brodowski <linux@brodo.de>"); -MODULE_DESCRIPTION("Power Management Timer (PMTMR) as primary timing source for x86"); Index: arch/i386/kernel/timers/timer_tsc.c =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/i386/kernel/timers/timer_tsc.c (mode:100644) +++ /dev/null (tree:6f1948595e5fa374fc552a4a01fe5524530ea1dd) @@ -1,580 +0,0 @@ -/* - * This code largely moved from arch/i386/kernel/time.c. - * See comments there for proper credits. - * - * 2004-06-25 Jesper Juhl - * moved mark_offset_tsc below cpufreq_delayed_get to avoid gcc 3.4 - * failing to inline. - */ - -#include <linux/spinlock.h> -#include <linux/init.h> -#include <linux/timex.h> -#include <linux/errno.h> -#include <linux/cpufreq.h> -#include <linux/string.h> -#include <linux/jiffies.h> - -#include <asm/timer.h> -#include <asm/io.h> -/* processor.h for distable_tsc flag */ -#include <asm/processor.h> - -#include "io_ports.h" -#include "mach_timer.h" - -#include <asm/hpet.h> - -#ifdef CONFIG_HPET_TIMER -static unsigned long hpet_usec_quotient; -static unsigned long hpet_last; -static struct timer_opts timer_tsc; -#endif - -static inline void cpufreq_delayed_get(void); - -int tsc_disable __initdata = 0; - -extern spinlock_t i8253_lock; - -static int use_tsc; -/* Number of usecs that the last interrupt was delayed */ -static int delay_at_last_interrupt; - -static unsigned long last_tsc_low; /* lsb 32 bits of Time Stamp Counter */ -static unsigned long last_tsc_high; /* msb 32 bits of Time Stamp Counter */ -static unsigned long long monotonic_base; -static seqlock_t monotonic_lock = SEQLOCK_UNLOCKED; - -/* convert from cycles(64bits) => nanoseconds (64bits) - * basic equation: - * ns = cycles / (freq / ns_per_sec) - * ns = cycles * (ns_per_sec / freq) - * ns = cycles * (10^9 / (cpu_mhz * 10^6)) - * ns = cycles * (10^3 / cpu_mhz) - * - * Then we use scaling math (suggested by george@mvista.com) to get: - * ns = cycles * (10^3 * SC / cpu_mhz) / SC - * ns = cycles * cyc2ns_scale / SC - * - * And since SC is a constant power of two, we can convert the div - * into a shift. - * -johnstul@us.ibm.com "math is hard, lets go shopping!" - */ -static unsigned long cyc2ns_scale; -#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */ - -static inline void set_cyc2ns_scale(unsigned long cpu_mhz) -{ - cyc2ns_scale = (1000 << CYC2NS_SCALE_FACTOR)/cpu_mhz; -} - -static inline unsigned long long cycles_2_ns(unsigned long long cyc) -{ - return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR; -} - -static int count2; /* counter for mark_offset_tsc() */ - -/* Cached *multiplier* to convert TSC counts to microseconds. - * (see the equation below). - * Equal to 2^32 * (1 / (clocks per usec) ). - * Initialized in time_init. - */ -static unsigned long fast_gettimeoffset_quotient; - -static unsigned long get_offset_tsc(void) -{ - register unsigned long eax, edx; - - /* Read the Time Stamp Counter */ - - rdtsc(eax,edx); - - /* .. relative to previous jiffy (32 bits is enough) */ - eax -= last_tsc_low; /* tsc_low delta */ - - /* - * Time offset = (tsc_low delta) * fast_gettimeoffset_quotient - * = (tsc_low delta) * (usecs_per_clock) - * = (tsc_low delta) * (usecs_per_jiffy / clocks_per_jiffy) - * - * Using a mull instead of a divl saves up to 31 clock cycles - * in the critical path. - */ - - __asm__("mull %2" - :"=a" (eax), "=d" (edx) - :"rm" (fast_gettimeoffset_quotient), - "0" (eax)); - - /* our adjusted time offset in microseconds */ - return delay_at_last_interrupt + edx; -} - -static unsigned long long monotonic_clock_tsc(void) -{ - unsigned long long last_offset, this_offset, base; - unsigned seq; - - /* atomically read monotonic base & last_offset */ - do { - seq = read_seqbegin(&monotonic_lock); - last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; - base = monotonic_base; - } while (read_seqretry(&monotonic_lock, seq)); - - /* Read the Time Stamp Counter */ - rdtscll(this_offset); - - /* return the value in ns */ - return base + cycles_2_ns(this_offset - last_offset); -} - -/* - * Scheduler clock - returns current time in nanosec units. - */ -unsigned long long sched_clock(void) -{ - unsigned long long this_offset; - - /* - * In the NUMA case we dont use the TSC as they are not - * synchronized across all CPUs. - */ -#ifndef CONFIG_NUMA - if (!use_tsc) -#endif - /* no locking but a rare wrong value is not a big deal */ - return jiffies_64 * (1000000000 / HZ); - - /* Read the Time Stamp Counter */ - rdtscll(this_offset); - - /* return the value in ns */ - return cycles_2_ns(this_offset); -} - -static void delay_tsc(unsigned long loops) -{ - unsigned long bclock, now; - - rdtscl(bclock); - do - { - rep_nop(); - rdtscl(now); - } while ((now-bclock) < loops); -} - -#ifdef CONFIG_HPET_TIMER -static void mark_offset_tsc_hpet(void) -{ - unsigned long long this_offset, last_offset; - unsigned long offset, temp, hpet_current; - - write_seqlock(&monotonic_lock); - last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; - /* - * It is important that these two operations happen almost at - * the same time. We do the RDTSC stuff first, since it's - * faster. To avoid any inconsistencies, we need interrupts - * disabled locally. - */ - /* - * Interrupts are just disabled locally since the timer irq - * has the SA_INTERRUPT flag set. -arca - */ - /* read Pentium cycle counter */ - - hpet_current = hpet_readl(HPET_COUNTER); - rdtsc(last_tsc_low, last_tsc_high); - - /* lost tick compensation */ - offset = hpet_readl(HPET_T0_CMP) - hpet_tick; - if (unlikely(((offset - hpet_last) > hpet_tick) && (hpet_last != 0))) { - int lost_ticks = (offset - hpet_last) / hpet_tick; - jiffies_64 += lost_ticks; - } - hpet_last = hpet_current; - - /* update the monotonic base value */ - this_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; - monotonic_base += cycles_2_ns(this_offset - last_offset); - write_sequnlock(&monotonic_lock); - - /* calculate delay_at_last_interrupt */ - /* - * Time offset = (hpet delta) * ( usecs per HPET clock ) - * = (hpet delta) * ( usecs per tick / HPET clocks per tick) - * = (hpet delta) * ( hpet_usec_quotient ) / (2^32) - * Where, - * hpet_usec_quotient = (2^32 * usecs per tick)/HPET clocks per tick - */ - delay_at_last_interrupt = hpet_current - offset; - ASM_MUL64_REG(temp, delay_at_last_interrupt, - hpet_usec_quotient, delay_at_last_interrupt); -} -#endif - - -#ifdef CONFIG_CPU_FREQ -#include <linux/workqueue.h> - -static unsigned int cpufreq_delayed_issched = 0; -static unsigned int cpufreq_init = 0; -static struct work_struct cpufreq_delayed_get_work; - -static void handle_cpufreq_delayed_get(void *v) -{ - unsigned int cpu; - for_each_online_cpu(cpu) { - cpufreq_get(cpu); - } - cpufreq_delayed_issched = 0; -} - -/* if we notice lost ticks, schedule a call to cpufreq_get() as it tries - * to verify the CPU frequency the timing core thinks the CPU is running - * at is still correct. - */ -static inline void cpufreq_delayed_get(void) -{ - if (cpufreq_init && !cpufreq_delayed_issched) { - cpufreq_delayed_issched = 1; - printk(KERN_DEBUG "Losing some ticks... checking if CPU frequency changed.\n"); - schedule_work(&cpufreq_delayed_get_work); - } -} - -/* If the CPU frequency is scaled, TSC-based delays will need a different - * loops_per_jiffy value to function properly. - */ - -static unsigned int ref_freq = 0; -static unsigned long loops_per_jiffy_ref = 0; - -#ifndef CONFIG_SMP -static unsigned long fast_gettimeoffset_ref = 0; -static unsigned long cpu_khz_ref = 0; -#endif - -static int -time_cpufreq_notifier(struct notifier_block *nb, unsigned long val, - void *data) -{ - struct cpufreq_freqs *freq = data; - - if (val != CPUFREQ_RESUMECHANGE) - write_seqlock_irq(&xtime_lock); - if (!ref_freq) { - ref_freq = freq->old; - loops_per_jiffy_ref = cpu_data[freq->cpu].loops_per_jiffy; -#ifndef CONFIG_SMP - fast_gettimeoffset_ref = fast_gettimeoffset_quotient; - cpu_khz_ref = cpu_khz; -#endif - } - - if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) || - (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) || - (val == CPUFREQ_RESUMECHANGE)) { - if (!(freq->flags & CPUFREQ_CONST_LOOPS)) - cpu_data[freq->cpu].loops_per_jiffy = cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new); -#ifndef CONFIG_SMP - if (cpu_khz) - cpu_khz = cpufreq_scale(cpu_khz_ref, ref_freq, freq->new); - if (use_tsc) { - if (!(freq->flags & CPUFREQ_CONST_LOOPS)) { - fast_gettimeoffset_quotient = cpufreq_scale(fast_gettimeoffset_ref, freq->new, ref_freq); - set_cyc2ns_scale(cpu_khz/1000); - } - } -#endif - } - - if (val != CPUFREQ_RESUMECHANGE) - write_sequnlock_irq(&xtime_lock); - - return 0; -} - -static struct notifier_block time_cpufreq_notifier_block = { - .notifier_call = time_cpufreq_notifier -}; - - -static int __init cpufreq_tsc(void) -{ - int ret; - INIT_WORK(&cpufreq_delayed_get_work, handle_cpufreq_delayed_get, NULL); - ret = cpufreq_register_notifier(&time_cpufreq_notifier_block, - CPUFREQ_TRANSITION_NOTIFIER); - if (!ret) - cpufreq_init = 1; - return ret; -} -core_initcall(cpufreq_tsc); - -#else /* CONFIG_CPU_FREQ */ -static inline void cpufreq_delayed_get(void) { return; } -#endif - -int recalibrate_cpu_khz(void) -{ -#ifndef CONFIG_SMP - unsigned long cpu_khz_old = cpu_khz; - - if (cpu_has_tsc) { - init_cpu_khz(); - cpu_data[0].loops_per_jiffy = - cpufreq_scale(cpu_data[0].loops_per_jiffy, - cpu_khz_old, - cpu_khz); - return 0; - } else - return -ENODEV; -#else - return -ENODEV; -#endif -} -EXPORT_SYMBOL(recalibrate_cpu_khz); - -static void mark_offset_tsc(void) -{ - unsigned long lost,delay; - unsigned long delta = last_tsc_low; - int count; - int countmp; - static int count1 = 0; - unsigned long long this_offset, last_offset; - static int lost_count = 0; - - write_seqlock(&monotonic_lock); - last_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; - /* - * It is important that these two operations happen almost at - * the same time. We do the RDTSC stuff first, since it's - * faster. To avoid any inconsistencies, we need interrupts - * disabled locally. - */ - - /* - * Interrupts are just disabled locally since the timer irq - * has the SA_INTERRUPT flag set. -arca - */ - - /* read Pentium cycle counter */ - - rdtsc(last_tsc_low, last_tsc_high); - - spin_lock(&i8253_lock); - outb_p(0x00, PIT_MODE); /* latch the count ASAP */ - - count = inb_p(PIT_CH0); /* read the latched count */ - count |= inb(PIT_CH0) << 8; - - /* - * VIA686a test code... reset the latch if count > max + 1 - * from timer_pit.c - cjb - */ - if (count > LATCH) { - outb_p(0x34, PIT_MODE); - outb_p(LATCH & 0xff, PIT_CH0); - outb(LATCH >> 8, PIT_CH0); - count = LATCH - 1; - } - - spin_unlock(&i8253_lock); - - if (pit_latch_buggy) { - /* get center value of last 3 time lutch */ - if ((count2 >= count && count >= count1) - || (count1 >= count && count >= count2)) { - count2 = count1; count1 = count; - } else if ((count1 >= count2 && count2 >= count) - || (count >= count2 && count2 >= count1)) { - countmp = count;count = count2; - count2 = count1;count1 = countmp; - } else { - count2 = count1; count1 = count; count = count1; - } - } - - /* lost tick compensation */ - delta = last_tsc_low - delta; - { - register unsigned long eax, edx; - eax = delta; - __asm__("mull %2" - :"=a" (eax), "=d" (edx) - :"rm" (fast_gettimeoffset_quotient), - "0" (eax)); - delta = edx; - } - delta += delay_at_last_interrupt; - lost = delta/(1000000/HZ); - delay = delta%(1000000/HZ); - if (lost >= 2) { - jiffies_64 += lost-1; - - /* sanity check to ensure we're not always losing ticks */ - if (lost_count++ > 100) { - printk(KERN_WARNING "Losing too many ticks!\n"); - printk(KERN_WARNING "TSC cannot be used as a timesource. \n"); - printk(KERN_WARNING "Possible reasons for this are:\n"); - printk(KERN_WARNING " You're running with Speedstep,\n"); - printk(KERN_WARNING " You don't have DMA enabled for your hard disk (see hdparm),\n"); - printk(KERN_WARNING " Incorrect TSC synchronization on an SMP system (see dmesg).\n"); - printk(KERN_WARNING "Falling back to a sane timesource now.\n"); - - clock_fallback(); - } - /* ... but give the TSC a fair chance */ - if (lost_count > 25) - cpufreq_delayed_get(); - } else - lost_count = 0; - /* update the monotonic base value */ - this_offset = ((unsigned long long)last_tsc_high<<32)|last_tsc_low; - monotonic_base += cycles_2_ns(this_offset - last_offset); - write_sequnlock(&monotonic_lock); - - /* calculate delay_at_last_interrupt */ - count = ((LATCH-1) - count) * TICK_SIZE; - delay_at_last_interrupt = (count + LATCH/2) / LATCH; - - /* catch corner case where tick rollover occured - * between tsc and pit reads (as noted when - * usec delta is > 90% # of usecs/tick) - */ - if (lost && abs(delay - delay_at_last_interrupt) > (900000/HZ)) - jiffies_64++; -} - -static int __init init_tsc(char* override) -{ - - /* check clock override */ - if (override[0] && strncmp(override,"tsc",3)) { -#ifdef CONFIG_HPET_TIMER - if (is_hpet_enabled()) { - printk(KERN_ERR "Warning: clock= override failed. Defaulting to tsc\n"); - } else -#endif - { - return -ENODEV; - } - } - - /* - * If we have APM enabled or the CPU clock speed is variable - * (CPU stops clock on HLT or slows clock to save power) - * then the TSC timestamps may diverge by up to 1 jiffy from - * 'real time' but nothing will break. - * The most frequent case is that the CPU is "woken" from a halt - * state by the timer interrupt itself, so we get 0 error. In the - * rare cases where a driver would "wake" the CPU and request a - * timestamp, the maximum error is < 1 jiffy. But timestamps are - * still perfectly ordered. - * Note that the TSC counter will be reset if APM suspends - * to disk; this won't break the kernel, though, 'cuz we're - * smart. See arch/i386/kernel/apm.c. - */ - /* - * Firstly we have to do a CPU check for chips with - * a potentially buggy TSC. At this point we haven't run - * the ident/bugs checks so we must run this hook as it - * may turn off the TSC flag. - * - * NOTE: this doesn't yet handle SMP 486 machines where only - * some CPU's have a TSC. Thats never worked and nobody has - * moaned if you have the only one in the world - you fix it! - */ - - count2 = LATCH; /* initialize counter for mark_offset_tsc() */ - - if (cpu_has_tsc) { - unsigned long tsc_quotient; -#ifdef CONFIG_HPET_TIMER - if (is_hpet_enabled() && hpet_use_timer) { - unsigned long result, remain; - printk("Using TSC for gettimeofday\n"); - tsc_quotient = calibrate_tsc_hpet(NULL); - timer_tsc.mark_offset = &mark_offset_tsc_hpet; - /* - * Math to calculate hpet to usec multiplier - * Look for the comments at get_offset_tsc_hpet() - */ - ASM_DIV64_REG(result, remain, hpet_tick, - 0, KERNEL_TICK_USEC); - if (remain > (hpet_tick >> 1)) - result++; /* rounding the result */ - - hpet_usec_quotient = result; - } else -#endif - { - tsc_quotient = calibrate_tsc(); - } - - if (tsc_quotient) { - fast_gettimeoffset_quotient = tsc_quotient; - use_tsc = 1; - /* - * We could be more selective here I suspect - * and just enable this for the next intel chips ? - */ - /* report CPU clock rate in Hz. - * The formula is (10^6 * 2^32) / (2^32 * 1 / (clocks/us)) = - * clock/second. Our precision is about 100 ppm. - */ - { unsigned long eax=0, edx=1000; - __asm__("divl %2" - :"=a" (cpu_khz), "=d" (edx) - :"r" (tsc_quotient), - "0" (eax), "1" (edx)); - printk("Detected %lu.%03lu MHz processor.\n", cpu_khz / 1000, cpu_khz % 1000); - } - set_cyc2ns_scale(cpu_khz/1000); - return 0; - } - } - return -ENODEV; -} - -#ifndef CONFIG_X86_TSC -/* disable flag for tsc. Takes effect by clearing the TSC cpu flag - * in cpu/common.c */ -static int __init tsc_setup(char *str) -{ - tsc_disable = 1; - return 1; -} -#else -static int __init tsc_setup(char *str) -{ - printk(KERN_WARNING "notsc: Kernel compiled with CONFIG_X86_TSC, " - "cannot disable TSC.\n"); - return 1; -} -#endif -__setup("notsc", tsc_setup); - - - -/************************************************************/ - -/* tsc timer_opts struct */ -static struct timer_opts timer_tsc = { - .name = "tsc", - .mark_offset = mark_offset_tsc, - .get_offset = get_offset_tsc, - .monotonic_clock = monotonic_clock_tsc, - .delay = delay_tsc, -}; - -struct init_timer_opts __initdata timer_tsc_init = { - .init = init_tsc, - .opts = &timer_tsc, -}; Index: arch/i386/kernel/tsc.c =================================================================== --- /dev/null (tree:15eb8deaa5b22a81f97a9af307d81b0567115674) +++ 6f1948595e5fa374fc552a4a01fe5524530ea1dd/arch/i386/kernel/tsc.c (mode:100644) @@ -0,0 +1,190 @@ +#include <linux/init.h> +#include <linux/timex.h> +#include <linux/cpufreq.h> +#include "mach_timer.h" + +int tsc_disable; + +/* convert from cycles(64bits) => nanoseconds (64bits) + * basic equation: + * ns = cycles / (freq / ns_per_sec) + * ns = cycles * (ns_per_sec / freq) + * ns = cycles * (10^9 / (cpu_mhz * 10^6)) + * ns = cycles * (10^3 / cpu_mhz) + * + * Then we use scaling math (suggested by george@mvista.com) to get: + * ns = cycles * (10^3 * SC / cpu_mhz) / SC + * ns = cycles * cyc2ns_scale / SC + * + * And since SC is a constant power of two, we can convert the div + * into a shift. + * -johnstul@us.ibm.com "math is hard, lets go shopping!" + */ +static unsigned long cyc2ns_scale; +#define CYC2NS_SCALE_FACTOR 10 /* 2^10, carefully chosen */ + +static inline void set_cyc2ns_scale(unsigned long cpu_mhz) +{ + cyc2ns_scale = (1000 << CYC2NS_SCALE_FACTOR)/cpu_mhz; +} + +static inline unsigned long long cycles_2_ns(unsigned long long cyc) +{ + return (cyc * cyc2ns_scale) >> CYC2NS_SCALE_FACTOR; +} + +/* + * Scheduler clock - returns current time in nanosec units. + */ +unsigned long long sched_clock(void) +{ + unsigned long long this_offset; + + /* + * In the NUMA case we dont use the TSC as they are not + * synchronized across all CPUs. + */ +#ifndef CONFIG_NUMA + if (!cpu_khz) +#endif + /* no locking but a rare wrong value is not a big deal */ + return jiffies_64 * (1000000000 / HZ); + + /* Read the Time Stamp Counter */ + rdtscll(this_offset); + + /* return the value in ns */ + return cycles_2_ns(this_offset); +} +static unsigned long calculate_cpu_khz(void) +{ + unsigned long long start, end; + unsigned long count; + u64 delta64; + int i; + + /* repeat 3 times to make sure the cache is warm */ + for(i=0; i < 3; i++) { + /* XXX - we need HPET based calibration too */ + mach_prepare_counter(); + rdtscll(start); + mach_countup(&count); + rdtscll(end); + } + delta64 = end - start; + + /* cpu freq too fast */ + if(delta64 > (1ULL<<32)) + return 0; + /* cpu freq too slow */ + if (delta64 <= CALIBRATE_TIME) + return 0; + + delta64 *= 1000; + do_div(delta64,CALIBRATE_TIME); + + return (unsigned long)delta64; +} + +void tsc_init(void) +{ + if(!cpu_has_tsc) + return; + cpu_khz = calculate_cpu_khz(); + + if (!cpu_khz) + return; + + printk("Detected %lu.%03lu MHz processor.\n", + cpu_khz / 1000, cpu_khz % 1000); + + set_cyc2ns_scale(cpu_khz/1000); +} + +int recalibrate_cpu_khz(void) +{ +#ifndef CONFIG_SMP + unsigned long cpu_khz_old = cpu_khz; + + if (cpu_has_tsc) { + cpu_khz = calculate_cpu_khz(); + cpu_data[0].loops_per_jiffy = + cpufreq_scale(cpu_data[0].loops_per_jiffy, + cpu_khz_old, cpu_khz); + return 0; + } else + return -ENODEV; +#else + return -ENODEV; +#endif +} +EXPORT_SYMBOL(recalibrate_cpu_khz); + +/* All of the code below comes from arch/i386/kernel/timers/timer_tsc.c + * XXX: severly needs better comments and the ifdef's killed. + */ + +#ifdef CONFIG_CPU_FREQ +static unsigned int cpufreq_init = 0; + +/* If the CPU frequency is scaled, TSC-based delays will need a different + * loops_per_jiffy value to function properly. + */ + +static unsigned int ref_freq = 0; +static unsigned long loops_per_jiffy_ref = 0; + +#ifndef CONFIG_SMP +static unsigned long cpu_khz_ref = 0; +#endif + +static int time_cpufreq_notifier(struct notifier_block *nb, + unsigned long val, void *data) +{ + struct cpufreq_freqs *freq = data; + + if (val != CPUFREQ_RESUMECHANGE) + write_seqlock_irq(&xtime_lock); + if (!ref_freq) { + ref_freq = freq->old; + loops_per_jiffy_ref = cpu_data[freq->cpu].loops_per_jiffy; +#ifndef CONFIG_SMP + cpu_khz_ref = cpu_khz; +#endif + } + + if ((val == CPUFREQ_PRECHANGE && freq->old < freq->new) || + (val == CPUFREQ_POSTCHANGE && freq->old > freq->new) || + (val == CPUFREQ_RESUMECHANGE)) { + if (!(freq->flags & CPUFREQ_CONST_LOOPS)) + cpu_data[freq->cpu].loops_per_jiffy = cpufreq_scale(loops_per_jiffy_ref, ref_freq, freq->new); +#ifndef CONFIG_SMP + if (cpu_khz) { + cpu_khz = cpufreq_scale(cpu_khz_ref, ref_freq, freq->new); + set_cyc2ns_scale(cpu_khz/1000); + } +#endif + } + + if (val != CPUFREQ_RESUMECHANGE) + write_sequnlock_irq(&xtime_lock); + + return 0; +} + +static struct notifier_block time_cpufreq_notifier_block = { + .notifier_call = time_cpufreq_notifier +}; + +static int __init cpufreq_tsc(void) +{ + int ret; + ret = cpufreq_register_notifier(&time_cpufreq_notifier_block, + CPUFREQ_TRANSITION_NOTIFIER); + if (!ret) + cpufreq_init = 1; + return ret; +} +core_initcall(cpufreq_tsc); +#endif /* CONFIG_CPU_FREQ */ + Index: arch/i386/lib/delay.c =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/i386/lib/delay.c (mode:100644) +++ 6f1948595e5fa374fc552a4a01fe5524530ea1dd/arch/i386/lib/delay.c (mode:100644) @@ -13,6 +13,7 @@ #include <linux/config.h> #include <linux/sched.h> #include <linux/delay.h> +#include <linux/timeofday.h> #include <asm/processor.h> #include <asm/delay.h> #include <asm/timer.h> @@ -21,11 +22,20 @@ #include <asm/smp.h> #endif -extern struct timer_opts* timer; - +/* XXX - For now just use a simple loop delay + * This has cpufreq issues, but so did the old method. + */ void __delay(unsigned long loops) { - cur_timer->delay(loops); + int d0; + __asm__ __volatile__( + "\tjmp 1f\n" + ".align 16\n" + "1:\tjmp 2f\n" + ".align 16\n" + "2:\tdecl %0\n\tjns 2b" + :"=&a" (d0) + :"0" (loops)); } inline void __const_udelay(unsigned long xloops) Index: include/asm-generic/timeofday.h =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/include/asm-generic/timeofday.h (mode:100644) +++ 6f1948595e5fa374fc552a4a01fe5524530ea1dd/include/asm-generic/timeofday.h (mode:100644) @@ -20,7 +20,7 @@ struct timesource_t* timesource, int ntp_adj); #else #define arch_update_vsyscall_gtod(x,y,z,w) {} -#endif +#endif /* CONFIG_NEWTOD_VSYSCALL */ #endif /* CONFIG_NEWTOD */ #endif Index: include/asm-i386/mach-default/mach_timer.h =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/include/asm-i386/mach-default/mach_timer.h (mode:100644) +++ 6f1948595e5fa374fc552a4a01fe5524530ea1dd/include/asm-i386/mach-default/mach_timer.h (mode:100644) @@ -14,8 +14,12 @@ */ #ifndef _MACH_TIMER_H #define _MACH_TIMER_H +#include <linux/jiffies.h> +#include <asm/io.h> -#define CALIBRATE_LATCH (5 * LATCH) +#define CALIBRATE_ITERATION 50 +#define CALIBRATE_LATCH (CALIBRATE_ITERATION * LATCH) +#define CALIBRATE_TIME (CALIBRATE_ITERATION * 1000020/HZ) static inline void mach_prepare_counter(void) { Index: include/asm-i386/timeofday.h =================================================================== --- /dev/null (tree:15eb8deaa5b22a81f97a9af307d81b0567115674) +++ 6f1948595e5fa374fc552a4a01fe5524530ea1dd/include/asm-i386/timeofday.h (mode:100644) @@ -0,0 +1,4 @@ +#ifndef _ASM_I386_TIMEOFDAY_H +#define _ASM_I386_TIMEOFDAY_H +#include <asm-generic/timeofday.h> +#endif Index: include/asm-i386/timer.h =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/include/asm-i386/timer.h (mode:100644) +++ 6f1948595e5fa374fc552a4a01fe5524530ea1dd/include/asm-i386/timer.h (mode:100644) @@ -2,64 +2,11 @@ #define _ASMi386_TIMER_H #include <linux/init.h> -/** - * struct timer_ops - used to define a timer source - * - * @name: name of the timer. - * @init: Probes and initializes the timer. Takes clock= override - * string as an argument. Returns 0 on success, anything else - * on failure. - * @mark_offset: called by the timer interrupt. - * @get_offset: called by gettimeofday(). Returns the number of microseconds - * since the last timer interupt. - * @monotonic_clock: returns the number of nanoseconds since the init of the - * timer. - * @delay: delays this many clock cycles. - */ -struct timer_opts { - char* name; - void (*mark_offset)(void); - unsigned long (*get_offset)(void); - unsigned long long (*monotonic_clock)(void); - void (*delay)(unsigned long); -}; - -struct init_timer_opts { - int (*init)(char *override); - struct timer_opts *opts; -}; - #define TICK_SIZE (tick_nsec / 1000) - -extern struct timer_opts* __init select_timer(void); -extern void clock_fallback(void); void setup_pit_timer(void); - /* Modifiers for buggy PIT handling */ - extern int pit_latch_buggy; - -extern struct timer_opts *cur_timer; extern int timer_ack; - -/* list of externed timers */ -extern struct timer_opts timer_none; -extern struct timer_opts timer_pit; -extern struct init_timer_opts timer_pit_init; -extern struct init_timer_opts timer_tsc_init; -#ifdef CONFIG_X86_CYCLONE_TIMER -extern struct init_timer_opts timer_cyclone_init; -#endif - -extern unsigned long calibrate_tsc(void); -extern void init_cpu_khz(void); extern int recalibrate_cpu_khz(void); -#ifdef CONFIG_HPET_TIMER -extern struct init_timer_opts timer_hpet_init; -extern unsigned long calibrate_tsc_hpet(unsigned long *tsc_hpet_quotient_ptr); -#endif -#ifdef CONFIG_X86_PM_TIMER -extern struct init_timer_opts timer_pmtmr_init; -#endif #endif Index: include/asm-i386/timex.h =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/include/asm-i386/timex.h (mode:100644) +++ 6f1948595e5fa374fc552a4a01fe5524530ea1dd/include/asm-i386/timex.h (mode:100644) @@ -16,6 +16,8 @@ #endif +/* XXX - All of this should likely move elsewhere -johnstul@us.ibm.com*/ + /* * Standard way to access the cycle counter on i586+ CPUs. * Currently only used on SMP. @@ -48,5 +50,6 @@ } extern unsigned long cpu_khz; +extern void tsc_init(void); #endif ^ permalink raw reply [flat|nested] 42+ messages in thread
* [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-01 23:12 ` [PATCH 2/4] new timeofday i386 arch specific changes " john stultz @ 2005-06-01 23:13 ` john stultz 2005-06-02 0:37 ` Parag Warudkar 0 siblings, 1 reply; 42+ messages in thread From: john stultz @ 2005-06-01 23:13 UTC (permalink / raw) To: Andi Kleen Cc: lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Nishanth Aravamudan, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh Andi, All, I'm just re-spinning this to resolve a conflict w/ the CPUFREQ changes Linus accepted last night. This patch converts the x86-64 arch to use the new timeofday infrastructure. It applies on top of my timeofday-core_B1 patch. This is a full conversion, so most of this patch is subtractions removing the existing arch specific time keeping code. This patch does not provide any x86-64 timesources, so using this patch alone on top of the timeofday-core patch will only give you the jiffies timesource. To get full replacements for the code being removed here, the following timeofday-timesources-i386 patch (x86-64 shares the same timesources as i386) will need to be applied. Andi: I'd like to submit this to Andrew for inclusion into his tree for testing, however I'd like to get an ACK from you first. Please let me know if you have any feedback or suggestions. thanks -john Signed-off-by: John Stultz <johnstul@us.ibm.com> linux-2.6.12-rc5_timeofday-arch-x86-64_B1.patch =============================================== Index: arch/i386/kernel/acpi/boot.c =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/i386/kernel/acpi/boot.c (mode:100644) +++ 85c83ea7c8c2d1f7e94ba65fa8d2a77d1022c973/arch/i386/kernel/acpi/boot.c (mode:100644) @@ -547,7 +547,7 @@ #ifdef CONFIG_HPET_TIMER - +#include <asm/hpet.h> static int __init acpi_parse_hpet(unsigned long phys, unsigned long size) { struct acpi_table_hpet *hpet_tbl; @@ -570,18 +570,12 @@ #ifdef CONFIG_X86_64 vxtime.hpet_address = hpet_tbl->addr.addrl | ((long) hpet_tbl->addr.addrh << 32); - - printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", - hpet_tbl->id, vxtime.hpet_address); + hpet_address = vxtime.hpet_address; #else /* X86 */ - { - extern unsigned long hpet_address; - hpet_address = hpet_tbl->addr.addrl; +#endif /* X86 */ printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", hpet_tbl->id, hpet_address); - } -#endif /* X86 */ return 0; } Index: arch/x86_64/Kconfig =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/x86_64/Kconfig (mode:100644) +++ 85c83ea7c8c2d1f7e94ba65fa8d2a77d1022c973/arch/x86_64/Kconfig (mode:100644) @@ -24,6 +24,14 @@ bool default y +config NEWTOD + bool + default y + +config NEWTOD_VSYSCALL + bool + default y + config MMU bool default y Index: arch/x86_64/kernel/Makefile =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/x86_64/kernel/Makefile (mode:100644) +++ 85c83ea7c8c2d1f7e94ba65fa8d2a77d1022c973/arch/x86_64/kernel/Makefile (mode:100644) @@ -28,7 +28,6 @@ obj-$(CONFIG_DUMMY_IOMMU) += pci-nommu.o pci-dma.o obj-$(CONFIG_SWIOTLB) += swiotlb.o obj-$(CONFIG_KPROBES) += kprobes.o -obj-$(CONFIG_X86_PM_TIMER) += pmtimer.o obj-$(CONFIG_MODULES) += module.o Index: arch/x86_64/kernel/pmtimer.c =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/x86_64/kernel/pmtimer.c (mode:100644) +++ /dev/null (tree:85c83ea7c8c2d1f7e94ba65fa8d2a77d1022c973) @@ -1,101 +0,0 @@ -/* Ported over from i386 by AK, original copyright was: - * - * (C) Dominik Brodowski <linux@brodo.de> 2003 - * - * Driver to use the Power Management Timer (PMTMR) available in some - * southbridges as primary timing source for the Linux kernel. - * - * Based on parts of linux/drivers/acpi/hardware/hwtimer.c, timer_pit.c, - * timer_hpet.c, and on Arjan van de Ven's implementation for 2.4. - * - * This file is licensed under the GPL v2. - * - * Dropped all the hardware bug workarounds for now. Hopefully they - * are not needed on 64bit chipsets. - */ - -#include <linux/jiffies.h> -#include <linux/kernel.h> -#include <linux/time.h> -#include <linux/init.h> -#include <linux/cpumask.h> -#include <asm/io.h> -#include <asm/proto.h> -#include <asm/msr.h> -#include <asm/vsyscall.h> - -/* The I/O port the PMTMR resides at. - * The location is detected during setup_arch(), - * in arch/i386/kernel/acpi/boot.c */ -u32 pmtmr_ioport; - -/* value of the Power timer at last timer interrupt */ -static u32 offset_delay; -static u32 last_pmtmr_tick; - -#define ACPI_PM_MASK 0xFFFFFF /* limit it to 24 bits */ - -static inline u32 cyc2us(u32 cycles) -{ - /* The Power Management Timer ticks at 3.579545 ticks per microsecond. - * 1 / PM_TIMER_FREQUENCY == 0.27936511 =~ 286/1024 [error: 0.024%] - * - * Even with HZ = 100, delta is at maximum 35796 ticks, so it can - * easily be multiplied with 286 (=0x11E) without having to fear - * u32 overflows. - */ - cycles *= 286; - return (cycles >> 10); -} - -int pmtimer_mark_offset(void) -{ - static int first_run = 1; - unsigned long tsc; - u32 lost; - - u32 tick = inl(pmtmr_ioport); - u32 delta; - - delta = cyc2us((tick - last_pmtmr_tick) & ACPI_PM_MASK); - - last_pmtmr_tick = tick; - monotonic_base += delta * NSEC_PER_USEC; - - delta += offset_delay; - - lost = delta / (USEC_PER_SEC / HZ); - offset_delay = delta % (USEC_PER_SEC / HZ); - - rdtscll(tsc); - vxtime.last_tsc = tsc - offset_delay * cpu_khz; - - /* don't calculate delay for first run, - or if we've got less then a tick */ - if (first_run || (lost < 1)) { - first_run = 0; - offset_delay = 0; - } - - return lost - 1; -} - -unsigned int do_gettimeoffset_pm(void) -{ - u32 now, offset, delta = 0; - - offset = last_pmtmr_tick; - now = inl(pmtmr_ioport); - delta = (now - offset) & ACPI_PM_MASK; - - return offset_delay + cyc2us(delta); -} - - -static int __init nopmtimer_setup(char *s) -{ - pmtmr_ioport = 0; - return 0; -} - -__setup("nopmtimer", nopmtimer_setup); Index: arch/x86_64/kernel/time.c =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/x86_64/kernel/time.c (mode:100644) +++ 85c83ea7c8c2d1f7e94ba65fa8d2a77d1022c973/arch/x86_64/kernel/time.c (mode:100644) @@ -26,10 +26,6 @@ #include <linux/sysdev.h> #include <linux/bcd.h> #include <linux/kallsyms.h> -#include <linux/acpi.h> -#ifdef CONFIG_ACPI -#include <acpi/achware.h> /* for PM timer frequency */ -#endif #include <asm/8253pit.h> #include <asm/pgtable.h> #include <asm/vsyscall.h> @@ -39,6 +35,7 @@ #include <asm/sections.h> #include <linux/cpufreq.h> #include <linux/hpet.h> +#include <linux/timeofday.h> #ifdef CONFIG_X86_LOCAL_APIC #include <asm/apic.h> #endif @@ -47,9 +44,6 @@ EXPORT_SYMBOL(jiffies_64); -#ifdef CONFIG_CPU_FREQ -static void cpufreq_delayed_get(void); -#endif extern void i8254_timer_resume(void); extern int using_apic_timer; @@ -62,6 +56,7 @@ #undef HPET_HACK_ENABLE_DANGEROUS unsigned int cpu_khz; /* TSC clocks / usec, not used here */ +unsigned long hpet_address; static unsigned long hpet_period; /* fsecs / HPET clock */ unsigned long hpet_tick; /* HPET clocks / interrupt */ unsigned long vxtime_hz = PIT_TICK_RATE; @@ -83,108 +78,6 @@ rdtscll(*tsc); } -/* - * do_gettimeoffset() returns microseconds since last timer interrupt was - * triggered by hardware. A memory read of HPET is slower than a register read - * of TSC, but much more reliable. It's also synchronized to the timer - * interrupt. Note that do_gettimeoffset() may return more than hpet_tick, if a - * timer interrupt has happened already, but vxtime.trigger wasn't updated yet. - * This is not a problem, because jiffies hasn't updated either. They are bound - * together by xtime_lock. - */ - -static inline unsigned int do_gettimeoffset_tsc(void) -{ - unsigned long t; - unsigned long x; - rdtscll_sync(&t); - if (t < vxtime.last_tsc) t = vxtime.last_tsc; /* hack */ - x = ((t - vxtime.last_tsc) * vxtime.tsc_quot) >> 32; - return x; -} - -static inline unsigned int do_gettimeoffset_hpet(void) -{ - return ((hpet_readl(HPET_COUNTER) - vxtime.last) * vxtime.quot) >> 32; -} - -unsigned int (*do_gettimeoffset)(void) = do_gettimeoffset_tsc; - -/* - * This version of gettimeofday() has microsecond resolution and better than - * microsecond precision, as we're using at least a 10 MHz (usually 14.31818 - * MHz) HPET timer. - */ - -void do_gettimeofday(struct timeval *tv) -{ - unsigned long seq, t; - unsigned int sec, usec; - - do { - seq = read_seqbegin(&xtime_lock); - - sec = xtime.tv_sec; - usec = xtime.tv_nsec / 1000; - - /* i386 does some correction here to keep the clock - monotonous even when ntpd is fixing drift. - But they didn't work for me, there is a non monotonic - clock anyways with ntp. - I dropped all corrections now until a real solution can - be found. Note when you fix it here you need to do the same - in arch/x86_64/kernel/vsyscall.c and export all needed - variables in vmlinux.lds. -AK */ - - t = (jiffies - wall_jiffies) * (1000000L / HZ) + - do_gettimeoffset(); - usec += t; - - } while (read_seqretry(&xtime_lock, seq)); - - tv->tv_sec = sec + usec / 1000000; - tv->tv_usec = usec % 1000000; -} - -EXPORT_SYMBOL(do_gettimeofday); - -/* - * settimeofday() first undoes the correction that gettimeofday would do - * on the time, and then saves it. This is ugly, but has been like this for - * ages already. - */ - -int do_settimeofday(struct timespec *tv) -{ - time_t wtm_sec, sec = tv->tv_sec; - long wtm_nsec, nsec = tv->tv_nsec; - - if ((unsigned long)tv->tv_nsec >= NSEC_PER_SEC) - return -EINVAL; - - write_seqlock_irq(&xtime_lock); - - nsec -= do_gettimeoffset() * 1000 + - (jiffies - wall_jiffies) * (NSEC_PER_SEC/HZ); - - wtm_sec = wall_to_monotonic.tv_sec + (xtime.tv_sec - sec); - wtm_nsec = wall_to_monotonic.tv_nsec + (xtime.tv_nsec - nsec); - - set_normalized_timespec(&xtime, sec, nsec); - set_normalized_timespec(&wall_to_monotonic, wtm_sec, wtm_nsec); - - time_adjust = 0; /* stop active adjtime() */ - time_status |= STA_UNSYNC; - time_maxerror = NTP_PHASE_LIMIT; - time_esterror = NTP_PHASE_LIMIT; - - write_sequnlock_irq(&xtime_lock); - clock_was_set(); - return 0; -} - -EXPORT_SYMBOL(do_settimeofday); - unsigned long profile_pc(struct pt_regs *regs) { unsigned long pc = instruction_pointer(regs); @@ -284,90 +177,8 @@ spin_unlock(&rtc_lock); } - -/* monotonic_clock(): returns # of nanoseconds passed since time_init() - * Note: This function is required to return accurate - * time even in the absence of multiple timer ticks. - */ -unsigned long long monotonic_clock(void) -{ - unsigned long seq; - u32 last_offset, this_offset, offset; - unsigned long long base; - - if (vxtime.mode == VXTIME_HPET) { - do { - seq = read_seqbegin(&xtime_lock); - - last_offset = vxtime.last; - base = monotonic_base; - this_offset = hpet_readl(HPET_T0_CMP) - hpet_tick; - - } while (read_seqretry(&xtime_lock, seq)); - offset = (this_offset - last_offset); - offset *=(NSEC_PER_SEC/HZ)/hpet_tick; - return base + offset; - }else{ - do { - seq = read_seqbegin(&xtime_lock); - - last_offset = vxtime.last_tsc; - base = monotonic_base; - } while (read_seqretry(&xtime_lock, seq)); - sync_core(); - rdtscll(this_offset); - offset = (this_offset - last_offset)*1000/cpu_khz; - return base + offset; - } - - -} -EXPORT_SYMBOL(monotonic_clock); - -static noinline void handle_lost_ticks(int lost, struct pt_regs *regs) -{ - static long lost_count; - static int warned; - - if (report_lost_ticks) { - printk(KERN_WARNING "time.c: Lost %d timer " - "tick(s)! ", lost); - print_symbol("rip %s)\n", regs->rip); - } - - if (lost_count == 1000 && !warned) { - printk(KERN_WARNING - "warning: many lost ticks.\n" - KERN_WARNING "Your time source seems to be instable or " - "some driver is hogging interupts\n"); - print_symbol("rip %s\n", regs->rip); - if (vxtime.mode == VXTIME_TSC && vxtime.hpet_address) { - printk(KERN_WARNING "Falling back to HPET\n"); - vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick; - vxtime.mode = VXTIME_HPET; - do_gettimeoffset = do_gettimeoffset_hpet; - } - /* else should fall back to PIT, but code missing. */ - warned = 1; - } else - lost_count++; - -#ifdef CONFIG_CPU_FREQ - /* In some cases the CPU can change frequency without us noticing - (like going into thermal throttle) - Give cpufreq a change to catch up. */ - if ((lost_count+1) % 25 == 0) { - cpufreq_delayed_get(); - } -#endif -} - static irqreturn_t timer_interrupt(int irq, void *dev_id, struct pt_regs *regs) { - static unsigned long rtc_update = 0; - unsigned long tsc; - int delay, offset = 0, lost = 0; - /* * Here we are in the timer irq handler. We have irqs locally disabled (so we * don't need spin_lock_irqsave()) but we don't know if the timer_bh is running @@ -377,60 +188,6 @@ write_seqlock(&xtime_lock); - if (vxtime.hpet_address) { - offset = hpet_readl(HPET_T0_CMP) - hpet_tick; - delay = hpet_readl(HPET_COUNTER) - offset; - } else { - spin_lock(&i8253_lock); - outb_p(0x00, 0x43); - delay = inb_p(0x40); - delay |= inb(0x40) << 8; - spin_unlock(&i8253_lock); - delay = LATCH - 1 - delay; - } - - rdtscll_sync(&tsc); - - if (vxtime.mode == VXTIME_HPET) { - if (offset - vxtime.last > hpet_tick) { - lost = (offset - vxtime.last) / hpet_tick - 1; - } - - monotonic_base += - (offset - vxtime.last)*(NSEC_PER_SEC/HZ) / hpet_tick; - - vxtime.last = offset; -#ifdef CONFIG_X86_PM_TIMER - } else if (vxtime.mode == VXTIME_PMTMR) { - lost = pmtimer_mark_offset(); -#endif - } else { - offset = (((tsc - vxtime.last_tsc) * - vxtime.tsc_quot) >> 32) - (USEC_PER_SEC / HZ); - - if (offset < 0) - offset = 0; - - if (offset > (USEC_PER_SEC / HZ)) { - lost = offset / (USEC_PER_SEC / HZ); - offset %= (USEC_PER_SEC / HZ); - } - - monotonic_base += (tsc - vxtime.last_tsc)*1000000/cpu_khz ; - - vxtime.last_tsc = tsc - vxtime.quot * delay / vxtime.tsc_quot; - - if ((((tsc - vxtime.last_tsc) * - vxtime.tsc_quot) >> 32) < offset) - vxtime.last_tsc = tsc - - (((long) offset << 32) / vxtime.tsc_quot) - 1; - } - - if (lost > 0) { - handle_lost_ticks(lost, regs); - jiffies += lost; - } - /* * Do the timer stuff. */ @@ -453,20 +210,6 @@ smp_local_timer_interrupt(regs); #endif -/* - * If we have an externally synchronized Linux clock, then update CMOS clock - * accordingly every ~11 minutes. set_rtc_mmss() will be called in the jiffy - * closest to exactly 500 ms before the next second. If the update fails, we - * don't care, as it'll be updated on the next turn, and the problem (time way - * off) isn't likely to go away much sooner anyway. - */ - - if ((~time_status & STA_UNSYNC) && xtime.tv_sec > rtc_update && - abs(xtime.tv_nsec - 500000000) <= tick_nsec / 2) { - set_rtc_mmss(xtime.tv_sec); - rtc_update = xtime.tv_sec + 660; - } - write_sequnlock(&xtime_lock); return IRQ_HANDLED; @@ -567,6 +310,30 @@ return mktime(year, mon, day, hour, min, sec); } +/* arch specific timeofday hooks */ +nsec_t read_persistent_clock(void) +{ + return (nsec_t)get_cmos_time() * NSEC_PER_SEC; +} + +void sync_persistent_clock(struct timespec ts) +{ + static unsigned long rtc_update = 0; + /* + * If we have an externally synchronized Linux clock, then update + * CMOS clock accordingly every ~11 minutes. set_rtc_mmss() will + * be called in the jiffy closest to exactly 500 ms before the + * next second. If the update fails, we don't care, as it'll be + * updated on the next turn, and the problem (time way off) isn't + * likely to go away much sooner anyway. + */ + if (ts.tv_sec > rtc_update && + abs(ts.tv_nsec - 500000000) <= tick_nsec / 2) { + set_rtc_mmss(xtime.tv_sec); + rtc_update = xtime.tv_sec + 660; + } +} + #ifdef CONFIG_CPU_FREQ /* Frequency scaling support. Adjust the TSC based timer when the cpu frequency @@ -594,23 +361,6 @@ cpufreq_delayed_issched = 0; } -/* if we notice lost ticks, schedule a call to cpufreq_get() as it tries - * to verify the CPU frequency the timing core thinks the CPU is running - * at is still correct. - */ -static void cpufreq_delayed_get(void) -{ - static int warned; - if (cpufreq_init && !cpufreq_delayed_issched) { - cpufreq_delayed_issched = 1; - if (!warned) { - warned = 1; - printk(KERN_DEBUG "Losing some ticks... checking if CPU frequency changed.\n"); - } - schedule_work(&cpufreq_delayed_get_work); - } -} - static unsigned int ref_freq = 0; static unsigned long loops_per_jiffy_ref = 0; @@ -906,13 +656,6 @@ hpet_period; cpu_khz = hpet_calibrate_tsc(); timename = "HPET"; -#ifdef CONFIG_X86_PM_TIMER - } else if (pmtmr_ioport) { - vxtime_hz = PM_TIMER_FREQUENCY; - timename = "PM"; - pit_init(); - cpu_khz = pit_calibrate_tsc(); -#endif } else { pit_init(); cpu_khz = pit_calibrate_tsc(); @@ -963,31 +706,8 @@ */ void __init time_init_gtod(void) { - char *timetype; - if (unsynchronized_tsc()) notsc = 1; - if (vxtime.hpet_address && notsc) { - timetype = "HPET"; - vxtime.last = hpet_readl(HPET_T0_CMP) - hpet_tick; - vxtime.mode = VXTIME_HPET; - do_gettimeoffset = do_gettimeoffset_hpet; -#ifdef CONFIG_X86_PM_TIMER - /* Using PM for gettimeofday is quite slow, but we have no other - choice because the TSC is too unreliable on some systems. */ - } else if (pmtmr_ioport && !vxtime.hpet_address && notsc) { - timetype = "PM"; - do_gettimeoffset = do_gettimeoffset_pm; - vxtime.mode = VXTIME_PMTMR; - sysctl_vsyscall = 0; - printk(KERN_INFO "Disabling vsyscall due to use of PM timer\n"); -#endif - } else { - timetype = vxtime.hpet_address ? "HPET/TSC" : "PIT/TSC"; - vxtime.mode = VXTIME_TSC; - } - - printk(KERN_INFO "time.c: Using %s based timekeeping.\n", timetype); } __setup("report_lost_ticks", time_setup); @@ -1010,7 +730,6 @@ static int timer_resume(struct sys_device *dev) { - unsigned long flags; unsigned long sec; unsigned long ctime = get_cmos_time(); unsigned long sleep_length = (ctime - sleep_start) * HZ; @@ -1021,10 +740,6 @@ i8254_timer_resume(); sec = ctime + clock_cmos_diff; - write_seqlock_irqsave(&xtime_lock,flags); - xtime.tv_sec = sec; - xtime.tv_nsec = 0; - write_sequnlock_irqrestore(&xtime_lock,flags); jiffies += sleep_length; wall_jiffies += sleep_length; return 0; Index: arch/x86_64/kernel/vmlinux.lds.S =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/x86_64/kernel/vmlinux.lds.S (mode:100644) +++ 85c83ea7c8c2d1f7e94ba65fa8d2a77d1022c973/arch/x86_64/kernel/vmlinux.lds.S (mode:100644) @@ -71,6 +71,13 @@ . = ALIGN(CONFIG_X86_L1_CACHE_BYTES); .jiffies : AT CACHE_ALIGN(AFTER(.xtime)) { *(.jiffies) } jiffies = LOADADDR(.jiffies); + + .vsyscall_gtod_data : AT AFTER(.jiffies) { *(.vsyscall_gtod_data) } + vsyscall_gtod_data = LOADADDR(.vsyscall_gtod_data); + .vsyscall_gtod_lock : AT AFTER(.vsyscall_gtod_data) { *(.vsyscall_gtod_lock) } + vsyscall_gtod_lock = LOADADDR(.vsyscall_gtod_lock); + + .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT (LOADADDR(.vsyscall_0) + 1024) { *(.vsyscall_1) } . = LOADADDR(.vsyscall_0) + 4096; Index: arch/x86_64/kernel/vsyscall.c =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/arch/x86_64/kernel/vsyscall.c (mode:100644) +++ 85c83ea7c8c2d1f7e94ba65fa8d2a77d1022c973/arch/x86_64/kernel/vsyscall.c (mode:100644) @@ -19,6 +19,8 @@ * want per guest time just set the kernel.vsyscall64 sysctl to 0. */ +#include <linux/timeofday.h> +#include <linux/timesource.h> #include <linux/time.h> #include <linux/init.h> #include <linux/kernel.h> @@ -40,6 +42,21 @@ int __sysctl_vsyscall __section_sysctl_vsyscall = 1; seqlock_t __xtime_lock __section_xtime_lock = SEQLOCK_UNLOCKED; + +struct vsyscall_gtod_data_t { + struct timeval wall_time_tv; + struct timezone sys_tz; + cycle_t offset_base; + struct timesource_t timesource; +}; + +extern struct vsyscall_gtod_data_t vsyscall_gtod_data; +struct vsyscall_gtod_data_t __vsyscall_gtod_data __section_vsyscall_gtod_data; + +extern seqlock_t vsyscall_gtod_lock; +seqlock_t __vsyscall_gtod_lock __section_vsyscall_gtod_lock = SEQLOCK_UNLOCKED; + + #include <asm/unistd.h> static force_inline void timeval_normalize(struct timeval * tv) @@ -53,40 +70,54 @@ } } -static force_inline void do_vgettimeofday(struct timeval * tv) +/* XXX - this is ugly. gettimeofday() has a label in it so we can't + call it twice. + */ +static force_inline int syscall_gtod(struct timeval *tv, struct timezone *tz) { - long sequence, t; - unsigned long sec, usec; - + int ret; + asm volatile("syscall" + : "=a" (ret) + : "0" (__NR_gettimeofday),"D" (tv),"S" (tz) : __syscall_clobber ); + return ret; +} +static force_inline void do_vgettimeofday(struct timeval* tv) +{ + cycle_t now, cycle_delta; + nsec_t nsec_delta; + unsigned long seq; do { - sequence = read_seqbegin(&__xtime_lock); - - sec = __xtime.tv_sec; - usec = (__xtime.tv_nsec / 1000) + - (__jiffies - __wall_jiffies) * (1000000 / HZ); - - if (__vxtime.mode != VXTIME_HPET) { - sync_core(); - rdtscll(t); - if (t < __vxtime.last_tsc) - t = __vxtime.last_tsc; - usec += ((t - __vxtime.last_tsc) * - __vxtime.tsc_quot) >> 32; - /* See comment in x86_64 do_gettimeofday. */ - } else { - usec += ((readl((void *)fix_to_virt(VSYSCALL_HPET) + 0xf0) - - __vxtime.last) * __vxtime.quot) >> 32; + seq = read_seqbegin(&__vsyscall_gtod_lock); + + if (__vsyscall_gtod_data.timesource.type == TIMESOURCE_FUNCTION) { + syscall_gtod(tv, NULL); + return; } - } while (read_seqretry(&__xtime_lock, sequence)); - tv->tv_sec = sec + usec / 1000000; - tv->tv_usec = usec % 1000000; + /* read the timeosurce and calc cycle_delta */ + now = read_timesource(&__vsyscall_gtod_data.timesource); + cycle_delta = (now - __vsyscall_gtod_data.offset_base) + & __vsyscall_gtod_data.timesource.mask; + + /* convert cycles to nsecs */ + nsec_delta = cycle_delta * __vsyscall_gtod_data.timesource.mult; + nsec_delta = nsec_delta >> __vsyscall_gtod_data.timesource.shift; + + /* add nsec offset to wall_time_tv */ + *tv = __vsyscall_gtod_data.wall_time_tv; + do_div(nsec_delta, NSEC_PER_USEC); + tv->tv_usec += (unsigned long) nsec_delta; + while (tv->tv_usec > USEC_PER_SEC) { + tv->tv_sec += 1; + tv->tv_usec -= USEC_PER_SEC; + } + } while (read_seqretry(&__vsyscall_gtod_lock, seq)); } /* RED-PEN may want to readd seq locking, but then the variable should be write-once. */ static force_inline void do_get_tz(struct timezone * tz) { - *tz = __sys_tz; + *tz = __vsyscall_gtod_data.sys_tz; } static force_inline int gettimeofday(struct timeval *tv, struct timezone *tz) @@ -118,15 +149,15 @@ return 0; } -/* This will break when the xtime seconds get inaccurate, but that is - * unlikely */ static time_t __vsyscall(1) vtime(time_t *t) { + struct timeval tv; if (unlikely(!__sysctl_vsyscall)) return time_syscall(t); - else if (t) - *t = __xtime.tv_sec; - return __xtime.tv_sec; + vgettimeofday(&tv, 0); + if (t) + *t = tv.tv_sec; + return tv.tv_sec; } static long __vsyscall(2) venosys_0(void) @@ -139,6 +170,48 @@ return -ENOSYS; } +struct timesource_t* curr_timesource; + +void arch_update_vsyscall_gtod(nsec_t wall_time, cycle_t offset_base, + struct timesource_t* timesource, int ntp_adj) +{ + unsigned long flags; + + write_seqlock_irqsave(&vsyscall_gtod_lock, flags); + + /* XXX - hackitty hack hack. this is terrible! */ + if (curr_timesource != timesource) { + if ((timesource->type == TIMESOURCE_MMIO_32) + || (timesource->type == TIMESOURCE_MMIO_64)) { + unsigned long vaddr = (unsigned long)timesource->mmio_ptr; + pgd_t *pgd = pgd_offset_k(vaddr); + pud_t *pud = pud_offset(pgd, vaddr); + pmd_t *pmd = pmd_offset(pud,vaddr); + pte_t *pte = pte_offset_kernel(pmd, vaddr); + *pte = pte_mkread(*pte); + } + curr_timesource = timesource; + } + + /* save off wall time as timeval */ + vsyscall_gtod_data.wall_time_tv = ns_to_timeval(wall_time); + + /* save offset_base */ + vsyscall_gtod_data.offset_base = offset_base; + + /* copy current timesource */ + vsyscall_gtod_data.timesource = *timesource; + + /* apply ntp adjustment to timesource mult */ + vsyscall_gtod_data.timesource.mult += ntp_adj; + + /* save off current timezone */ + vsyscall_gtod_data.sys_tz = sys_tz; + + write_sequnlock_irqrestore(&vsyscall_gtod_lock, flags); + +} + #ifdef CONFIG_SYSCTL #define SYSCALL 0x050f @@ -217,6 +290,7 @@ BUG_ON((unsigned long) &vtime != VSYSCALL_ADDR(__NR_vtime)); BUG_ON((VSYSCALL_ADDR(0) != __fix_to_virt(VSYSCALL_FIRST_PAGE))); map_vsyscall(); + sysctl_vsyscall = 1; #ifdef CONFIG_SYSCTL register_sysctl_table(kernel_root_table2, 0); #endif Index: include/asm-generic/div64.h =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/include/asm-generic/div64.h (mode:100644) +++ 85c83ea7c8c2d1f7e94ba65fa8d2a77d1022c973/include/asm-generic/div64.h (mode:100644) @@ -55,4 +55,13 @@ #endif /* BITS_PER_LONG */ +#ifndef div_long_long_rem +#define div_long_long_rem(dividend,divisor,remainder) \ +({ \ + u64 result = dividend; \ + *remainder = do_div(result,divisor); \ + result; \ +}) +#endif + #endif /* _ASM_GENERIC_DIV64_H */ Index: include/asm-x86_64/hpet.h =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/include/asm-x86_64/hpet.h (mode:100644) +++ 85c83ea7c8c2d1f7e94ba65fa8d2a77d1022c973/include/asm-x86_64/hpet.h (mode:100644) @@ -1,6 +1,6 @@ #ifndef _ASM_X8664_HPET_H #define _ASM_X8664_HPET_H 1 - +#include <asm/fixmap.h> /* * Documentation on HPET can be found at: * http://www.intel.com/ial/home/sp/pcmmspec.htm @@ -44,6 +44,7 @@ #define HPET_TN_SETVAL 0x040 #define HPET_TN_32BIT 0x100 +extern unsigned long hpet_address; /* hpet memory map physical address */ extern int is_hpet_enabled(void); extern int hpet_rtc_timer_init(void); extern int oem_force_hpet_timer(void); Index: include/asm-x86_64/timeofday.h =================================================================== --- /dev/null (tree:15eb8deaa5b22a81f97a9af307d81b0567115674) +++ 85c83ea7c8c2d1f7e94ba65fa8d2a77d1022c973/include/asm-x86_64/timeofday.h (mode:100644) @@ -0,0 +1,4 @@ +#ifndef _ASM_X86_64_TIMEOFDAY_H +#define _ASM_X86_64_TIMEOFDAY_H +#include <asm-generic/timeofday.h> +#endif Index: include/asm-x86_64/vsyscall.h =================================================================== --- 15eb8deaa5b22a81f97a9af307d81b0567115674/include/asm-x86_64/vsyscall.h (mode:100644) +++ 85c83ea7c8c2d1f7e94ba65fa8d2a77d1022c973/include/asm-x86_64/vsyscall.h (mode:100644) @@ -22,6 +22,8 @@ #define __section_sysctl_vsyscall __attribute__ ((unused, __section__ (".sysctl_vsyscall"), aligned(16))) #define __section_xtime __attribute__ ((unused, __section__ (".xtime"), aligned(16))) #define __section_xtime_lock __attribute__ ((unused, __section__ (".xtime_lock"), aligned(16))) +#define __section_vsyscall_gtod_data __attribute__ ((unused, __section__ (".vsyscall_gtod_data"),aligned(16))) +#define __section_vsyscall_gtod_lock __attribute__ ((unused, __section__ (".vsyscall_gtod_lock"),aligned(16))) #define VXTIME_TSC 1 #define VXTIME_HPET 2 ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-01 23:13 ` [PATCH 3/4] new timeofday x86-64 " john stultz @ 2005-06-02 0:37 ` Parag Warudkar 2005-06-02 17:34 ` john stultz 0 siblings, 1 reply; 42+ messages in thread From: Parag Warudkar @ 2005-06-02 0:37 UTC (permalink / raw) To: john stultz Cc: Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Nishanth Aravamudan, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh [-- Attachment #1: Type: text/plain, Size: 257 bytes --] On Wednesday 01 June 2005 19:13, john stultz wrote: > This patch converts the x86-64 arch to use the new timeofday > infrastructure. It applies on top of my timeofday-core_B1 patch. This one fails to apply - time.c HUNK #1 gets rejected. (Attached) Parag [-- Attachment #2: time.c.rej --] [-- Type: text/x-csrc, Size: 489 bytes --] *************** *** 26,35 **** #include <linux/sysdev.h> #include <linux/bcd.h> #include <linux/kallsyms.h> - #include <linux/acpi.h> - #ifdef CONFIG_ACPI - #include <acpi/achware.h> /* for PM timer frequency */ - #endif #include <asm/8253pit.h> #include <asm/pgtable.h> #include <asm/vsyscall.h> --- 26,31 ---- #include <linux/sysdev.h> #include <linux/bcd.h> #include <linux/kallsyms.h> #include <asm/8253pit.h> #include <asm/pgtable.h> #include <asm/vsyscall.h> ^ permalink raw reply [flat|nested] 42+ messages in thread
* Re: [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) 2005-06-02 0:37 ` Parag Warudkar @ 2005-06-02 17:34 ` john stultz 0 siblings, 0 replies; 42+ messages in thread From: john stultz @ 2005-06-02 17:34 UTC (permalink / raw) To: Parag Warudkar Cc: Andi Kleen, lkml, Tim Schmielau, George Anzinger, albert, Ulrich Windl, Christoph Lameter, Dominik Brodowski, David Mosberger, Andrew Morton, paulus, schwidefsky, keith maanthey, Chris McDermott, Max Asbock, mahuja, Nishanth Aravamudan, Darren Hart, Darrick J. Wong, Anton Blanchard, donf, mpm, benh On Wed, 2005-06-01 at 20:37 -0400, Parag Warudkar wrote: > On Wednesday 01 June 2005 19:13, john stultz wrote: > > This patch converts the x86-64 arch to use the new timeofday > > infrastructure. It applies on top of my timeofday-core_B1 patch. > > This one fails to apply - time.c HUNK #1 gets rejected. (Attached) Yea, sorry. My naming scheme isn't quite granular enough. The patch is against Linus' git tree as of yesterday, not -rc5 vanilla. If you grab Linus' current tree it should apply. Sorry about the confusion. -john ^ permalink raw reply [flat|nested] 42+ messages in thread
end of thread, other threads:[~2005-06-10 0:53 UTC | newest] Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2005-06-02 18:27 [PATCH 3/4] new timeofday x86-64 arch specific changes (v. B1) Parag Warudkar 2005-06-02 18:39 ` Nishanth Aravamudan 2005-06-02 23:05 ` Parag Warudkar 2005-06-02 23:20 ` john stultz 2005-06-02 23:33 ` Parag Warudkar 2005-06-02 23:50 ` Parag Warudkar 2005-06-03 7:05 ` Ulrich Windl 2005-06-03 15:24 ` john stultz 2005-06-05 17:05 ` Dominik Brodowski 2005-06-06 3:04 ` Parag Warudkar 2005-06-06 3:14 ` Dominik Brodowski 2005-06-10 0:48 ` George Anzinger 2005-06-06 9:21 ` Andi Kleen 2005-06-06 9:24 ` Dominik Brodowski 2005-06-06 9:30 ` Andi Kleen 2005-06-06 13:32 ` Vojtech Pavlik 2005-06-06 22:53 ` john stultz 2005-06-03 16:30 ` Andi Kleen 2005-06-03 18:27 ` john stultz 2005-06-03 19:02 ` Christoph Lameter 2005-06-03 19:21 ` john stultz 2005-06-05 11:27 ` Andi Kleen 2005-06-06 22:51 ` john stultz 2005-06-04 18:40 ` Parag Warudkar 2005-06-05 11:28 ` Andi Kleen 2005-06-05 14:15 ` Parag Warudkar 2005-06-05 20:51 ` Lee Revell 2005-06-05 21:41 ` Parag Warudkar 2005-06-05 22:13 ` Lee Revell 2005-06-06 9:29 ` Andi Kleen 2005-06-06 11:46 ` Parag Warudkar 2005-06-08 13:51 ` Andi Kleen 2005-06-09 1:47 ` Lee Revell 2005-06-09 2:12 ` john stultz 2005-06-09 2:42 ` Parag Warudkar 2005-06-09 14:17 ` Andi Kleen 2005-06-03 13:32 ` Parag Warudkar 2005-06-02 18:40 ` john stultz -- strict thread matches above, loose matches on Subject: below -- 2005-06-02 18:51 Parag Warudkar 2005-06-01 23:09 [PATCH 1/4] new timeofday core subsystem " john stultz 2005-06-01 23:12 ` [PATCH 2/4] new timeofday i386 arch specific changes " john stultz 2005-06-01 23:13 ` [PATCH 3/4] new timeofday x86-64 " john stultz 2005-06-02 0:37 ` Parag Warudkar 2005-06-02 17:34 ` john stultz
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.