* Re: Fwd: Re: [PATCH] linux-2.5.54_delay-cleanup_A0 [not found] <200301180325.h0I3PGa07081@eng2.beaverton.ibm.com> @ 2003-01-18 3:33 ` john stultz 2003-01-18 13:54 ` Pavel Machek 0 siblings, 1 reply; 4+ messages in thread From: john stultz @ 2003-01-18 3:33 UTC (permalink / raw) To: Pavel Machek; +Cc: lkml > Hi! Hey! Hmm. Odd, this email never got to me directly, instead I found it through lkml. Hopefully my mail isn't bouncing somewhere... > > +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)); > > +} > > + > > But... this is not using pit to do the delay, right? It is sensitive > to CPU clock changes, pit-delay should not be. You're right, basically I took the previous __loop_delay() and __rtsc_delay() and moved them to delay_pit() and delay_tsc(), respectively. I guess the naming is somewhat confusing, but since this was meant as just a cleanup, I'm trying to use the same code in the same conditions.(ie: when using the PIT time-source, use the loop delay. when using the TSC time-source, use the TSC delay). A changing the name or a comment explaining it would def clear that up. You do bring up an interesting idea: actually using the PIT to do __delay. I think its possible, but not really worth it, as the PIT is such a nasty bit of hardware to deal with. I'd guess that just reading the PIT would likely delay for more time then what was actually requested. Thanks for the feedback! -john ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Fwd: Re: [PATCH] linux-2.5.54_delay-cleanup_A0 2003-01-18 3:33 ` Fwd: Re: [PATCH] linux-2.5.54_delay-cleanup_A0 john stultz @ 2003-01-18 13:54 ` Pavel Machek 2003-01-20 19:23 ` john stultz 0 siblings, 1 reply; 4+ messages in thread From: Pavel Machek @ 2003-01-18 13:54 UTC (permalink / raw) To: john stultz; +Cc: lkml Hi! > Hey! Hmm. Odd, this email never got to me directly, instead I found it > through lkml. Hopefully my mail isn't bouncing somewhere... ibm had some mail problems --- nasty storm of bounces. I don'tknow if it is related. > > > > > +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)); > > > +} > > > + > > > > But... this is not using pit to do the delay, right? It is sensitive > > to CPU clock changes, pit-delay should not be. > > You're right, basically I took the previous __loop_delay() and > __rtsc_delay() and moved them to delay_pit() and delay_tsc(), > respectively. I guess the naming is somewhat confusing, but since this > was meant as just a cleanup, I'm trying to use the same code in the same > conditions.(ie: when using the PIT time-source, use the loop delay. when > using the TSC time-source, use the TSC delay). A changing the name or a > comment explaining it would def clear that up. > > You do bring up an interesting idea: actually using the PIT to do > __delay. I think its possible, but not really worth it, as the PIT is > such a nasty bit of hardware to deal with. I'd guess that just reading > the PIT would likely delay for more time then what was actually > requested. Well, loop_delay() was big (fatal!) problem -- it can actaully wait for *less* time than told to. That happens if notebook boots during "battery low" and than goes to AC power. Thinkpad 560X is example of such behaviour. Slow (but working!) PIT seems to be only option on such machine. Pavel -- Casualities in World Trade Center: ~3k dead inside the building, cryptography in U.S.A. and free speech in Czech Republic. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Fwd: Re: [PATCH] linux-2.5.54_delay-cleanup_A0 2003-01-18 13:54 ` Pavel Machek @ 2003-01-20 19:23 ` john stultz 2003-01-20 19:54 ` Pavel Machek 0 siblings, 1 reply; 4+ messages in thread From: john stultz @ 2003-01-20 19:23 UTC (permalink / raw) To: Pavel Machek; +Cc: lkml On Sat, 2003-01-18 at 05:54, Pavel Machek wrote: > Well, loop_delay() was big (fatal!) problem -- it can actaully wait > for *less* time than told to. That happens if notebook boots during > "battery low" and than goes to AC power. Thinkpad 560X is example of > such behaviour. Slow (but working!) PIT seems to be only option on > such machine. I need to look more at the cpu_freq code, but I suspect it could it help solve or lessen the problem (if we can detect the event on those older systems). Regardless, you make a good point, so if I get the time I'll look into a real PIT based delay. Thanks for the feeback. -john ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Fwd: Re: [PATCH] linux-2.5.54_delay-cleanup_A0 2003-01-20 19:23 ` john stultz @ 2003-01-20 19:54 ` Pavel Machek 0 siblings, 0 replies; 4+ messages in thread From: Pavel Machek @ 2003-01-20 19:54 UTC (permalink / raw) To: john stultz; +Cc: Pavel Machek, lkml Hi! > > Well, loop_delay() was big (fatal!) problem -- it can actaully wait > > for *less* time than told to. That happens if notebook boots during > > "battery low" and than goes to AC power. Thinkpad 560X is example of > > such behaviour. Slow (but working!) PIT seems to be only option on > > such machine. > > I need to look more at the cpu_freq code, but I suspect it could it help > solve or lessen the problem (if we can detect the event on those > > older > systems). Regardless, you make a good point, so if I get the time > > I'll It is possible to lessen the problem by measuring speed and recalibrating if it changes, but due to delay between measuring and recalibrating it is still not 100% reliable. > look into a real PIT based delay. > -- Casualities in World Trade Center: ~3k dead inside the building, cryptography in U.S.A. and free speech in Czech Republic. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-01-20 19:46 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <200301180325.h0I3PGa07081@eng2.beaverton.ibm.com>
2003-01-18 3:33 ` Fwd: Re: [PATCH] linux-2.5.54_delay-cleanup_A0 john stultz
2003-01-18 13:54 ` Pavel Machek
2003-01-20 19:23 ` john stultz
2003-01-20 19:54 ` Pavel Machek
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®