public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* RE: [PATCH] Stall semantics
@ 2003-09-30 22:04 Moore, Robert
       [not found] ` <D3A3AA459175A44CB5326F26DA7A189C1C3DAF-sBd4vmA9Se58QrAoInS571DQ4js95KgL@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Moore, Robert @ 2003-09-30 22:04 UTC (permalink / raw)
  To: Nate Lawson; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f


I'm questioning whether it is appropriate to *ever* call sleep since
this behavior seems to violate the spec.


-----Original Message-----
From: Nate Lawson [mailto:nate-Y6VGUYTwhu0@public.gmane.org] 
Sent: Tuesday, September 30, 2003 2:45 PM
To: Moore, Robert
Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: RE: [ACPI] [PATCH] Stall semantics

On Tue, 30 Sep 2003, Moore, Robert wrote:
> The ACPI spec says this:
>
> 16.2.3.4.1.15  Stall (Stall for a Short Time)

Yes, this is what I was referring to.

> StallTerm	:= Stall(
> 	MicroSecs	//TermArg=>Integer
> )
> The Stall term is used to implement short-term timing requirements.
> Execution is delayed for at least the required number of microseconds.
> The implementation of Stall is OS-specific, but must not relinquish
> control of the processor. Because of this, delays longer than 100
> microseconds must use Sleep instead of Stall.
-----
>
> This seems to imply that sleep() cannot be used to implement long
> "stalls" because it can relinquish the cpu.

Please read the patch and the last sentence you quoted from the spec.
Your code already calls Sleep instead of Stall for values > 1000 us.  I
simply made it stick to the spec of > 100 us.

-Nate


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: [PATCH] Stall semantics
@ 2003-10-03 20:23 Moore, Robert
       [not found] ` <D3A3AA459175A44CB5326F26DA7A189C1C3DD1-sBd4vmA9Se58QrAoInS571DQ4js95KgL@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Moore, Robert @ 2003-10-03 20:23 UTC (permalink / raw)
  To: Nate Lawson, Matthew Wilcox; +Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f


Here's what the MS interpreter does for Stall(n);

1) If n <= 255 (MAX_BYTE), perform the stall.
2) If n > 255, throw an error and abort the control method.

In this case, I suggest that we simply duplicate the MS behavior, it
seems like a good compromise and also provides ACPI CA with exact
compatibility.

Bob


-----Original Message-----
From: Nate Lawson [mailto:nate-Y6VGUYTwhu0@public.gmane.org] 
Sent: Wednesday, October 01, 2003 10:27 AM
To: Matthew Wilcox
Cc: Moore, Robert; acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [ACPI] [PATCH] Stall semantics

On Wed, 1 Oct 2003, Matthew Wilcox wrote:
> On Wed, Oct 01, 2003 at 09:59:49AM -0700, Nate Lawson wrote:
> > Let me quote that line again:
> > > Because of this, delays longer than 100 microseconds must use
Sleep
> > > instead of Stall.
> >
> > The current code is incorrect.  It uses Stall (i.e. a delay loop)
for
> > waits of up to 1000 us, not 100 us like the standard.  My patch
makes the
> > code match the standard.
> >
> > Your point is whether Sleep should automatically be called by OSPM
when
> > the AML specifies a Stall of more than a certain amount (let's stick
to
> > 100 us for this example).  I believe OSPM can and should
automatically
> > call Sleep when the time requested exceeds the maximum for Stall.
Look at
> > that line again.  The key word is "use".  If OSPM automatically
translates
> > the call, delays longer than 100 us will indeed _use_ Sleep instead
of
> > Stall.  This gives correct, standard behavior even when the AML
didn't
> > originally match the standard.
>
> Fundamentally, we're outside the specification and into nasal demon
> territory.  We can do whatever we like.  The question is: what to do
that
> will break the least number of machines.  Sleeping unexpectedly can
easily
> break code -- this is why you can't schedule while holding a spinlock,
> for example.  Of course, Stalling for too long is also a bad idea.

You're assuming the AML mistake is made both ways.  If it is uniformly
made one way, it's easy to work around correctly.

> I think the current ACPI behaviour is probably adequate -- accommodate
> incopetent BIOS writers up to a point, then sleep, and damn them
anyway.

It damns us OS vendors a different way in that we get unacceptably long
idle spin loops on some machines.  Spinning for 1000 us is not correct
any
way you interpret the standard.

If we can't reach agreement, it's better to leave things the same.  The
other part of my patch is still useful in reducing redundant code.

-Nate


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 12+ messages in thread
* RE: [PATCH] Stall semantics
@ 2003-09-30 21:38 Moore, Robert
       [not found] ` <D3A3AA459175A44CB5326F26DA7A189C1C3DAB-sBd4vmA9Se58QrAoInS571DQ4js95KgL@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Moore, Robert @ 2003-09-30 21:38 UTC (permalink / raw)
  To: Nate Lawson, acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

Nate,

The ACPI spec says this:

16.2.3.4.1.15  Stall (Stall for a Short Time)

StallTerm	:= Stall(
	MicroSecs	//TermArg=>Integer
)
The Stall term is used to implement short-term timing requirements.
Execution is delayed for at least the required number of microseconds.
The implementation of Stall is OS-specific, but must not relinquish
control of the processor. Because of this, delays longer than 100
microseconds must use Sleep instead of Stall.



This seems to imply that sleep() cannot be used to implement long
"stalls" because it can relinquish the cpu.

Bob


-----Original Message-----
From: acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
[mailto:acpi-devel-admin-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org] On Behalf Of Nate Lawson
Sent: Tuesday, September 30, 2003 12:38 PM
To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [ACPI] [PATCH] Stall semantics

A simple and low priority patch for sticking to the specified 100 us max
stall delay.

http://bugzilla.kernel.org/show_bug.cgi?id=1299

-Nate


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Acpi-devel mailing list
Acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/acpi-devel


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCH] Stall semantics
@ 2003-09-30 19:37 Nate Lawson
  0 siblings, 0 replies; 12+ messages in thread
From: Nate Lawson @ 2003-09-30 19:37 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f

A simple and low priority patch for sticking to the specified 100 us max
stall delay.

http://bugzilla.kernel.org/show_bug.cgi?id=1299

-Nate


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2003-10-03 20:49 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-30 22:04 [PATCH] Stall semantics Moore, Robert
     [not found] ` <D3A3AA459175A44CB5326F26DA7A189C1C3DAF-sBd4vmA9Se58QrAoInS571DQ4js95KgL@public.gmane.org>
2003-10-01 16:59   ` Nate Lawson
     [not found]     ` <20031001093943.J85056-Y6VGUYTwhu0@public.gmane.org>
2003-10-01 17:16       ` Matthew Wilcox
     [not found]         ` <20031001171657.GW24824-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
2003-10-01 17:27           ` Nate Lawson
     [not found]             ` <20031001101854.J85056-Y6VGUYTwhu0@public.gmane.org>
2003-10-01 18:55               ` Matthew Wilcox
     [not found]                 ` <20031001185524.GX24824-+pPCBgu9SkPzIGdyhVEDUDl5KyyQGfY2kSSpQ9I8OhVaa/9Udqfwiw@public.gmane.org>
2003-10-01 19:45                   ` Nate Lawson
  -- strict thread matches above, loose matches on Subject: below --
2003-10-03 20:23 Moore, Robert
     [not found] ` <D3A3AA459175A44CB5326F26DA7A189C1C3DD1-sBd4vmA9Se58QrAoInS571DQ4js95KgL@public.gmane.org>
2003-10-03 20:28   ` Matthew Wilcox
2003-10-03 20:49   ` Nate Lawson
2003-09-30 21:38 Moore, Robert
     [not found] ` <D3A3AA459175A44CB5326F26DA7A189C1C3DAB-sBd4vmA9Se58QrAoInS571DQ4js95KgL@public.gmane.org>
2003-09-30 21:45   ` Nate Lawson
2003-09-30 19:37 Nate Lawson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox