linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mika Westerberg <mika.westerberg@linux.intel.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: linux-acpi@vger.kernel.org,
	"Rafael J. Wysocki" <rafael.j.wysocki@intel.com>,
	Len Brown <lenb@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ACPI: implement acpi_os_get_timer() according the spec
Date: Mon, 20 May 2013 13:25:30 +0300	[thread overview]
Message-ID: <20130520102530.GG11878@intel.com> (raw)
In-Reply-To: <20130513114432.GK20562@intel.com>

On Mon, May 13, 2013 at 02:44:32PM +0300, Mika Westerberg wrote:
> On Mon, May 13, 2013 at 01:38:46PM +0200, Rafael J. Wysocki wrote:
> > On Monday, May 13, 2013 01:27:51 PM Mika Westerberg wrote:
> > > ACPI Timer() opcode should return monotonically increasing clock with 100ns
> > > granularity. Implement this with the help of ktime_get().
> > > 
> > > Signed-off-by: Mika Westerberg <mika.westerberg@linux.intel.com>
> > 
> > That looks reasobable.  Have you tested it?
> 
> Very lightly. Basically I added some debug printks() between two
> successsive calls of Timer() and it seemed like it returned correct time.
> 
> It is certainly better than returning t+1 every time Timer() is called :)

I did somewhat better test for this. I added following ASL code:

	...
	Store(Timer, Local1)
	Sleep(10)
	Divide(Subtract(Timer, Local1), 10000,, Local1)
	Sleep(Local1)

	Store(Timer, Local1)
	Sleep(200)
	Divide(Subtract(Timer, Local1), 10000,, Local1)
	Sleep(Local1)

	Store(Timer, Local1)
	Sleep(1300)
	Divide(Subtract(Timer, Local1), 10000,, Local1)
	Sleep(Local1)

The second sleep should be pretty close to the first one.

Without this patch I get:

[   11.488100] ACPI: acpi_os_get_timer() TBD
[   11.492150] ACPI: Sleep(10)
[   11.502993] ACPI: Sleep(0)
[   11.506315] ACPI: Sleep(200)
[   11.706237] ACPI: Sleep(0)
[   11.709550] ACPI: Sleep(1300)
[   13.008929] ACPI: Sleep(0)

With the patch applied I get:

[   11.486786] ACPI: Sleep(10)
[   11.499029] ACPI: Sleep(12)
[   11.512350] ACPI: Sleep(200)
[   11.712282] ACPI: Sleep(200)
[   11.912170] ACPI: Sleep(1300)
[   13.211577] ACPI: Sleep(1300)

The above looks much more correct to me.

  reply	other threads:[~2013-05-20 10:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-13 10:27 [PATCH] ACPI: implement acpi_os_get_timer() according the spec Mika Westerberg
2013-05-13 11:38 ` Rafael J. Wysocki
2013-05-13 11:44   ` Mika Westerberg
2013-05-20 10:25     ` Mika Westerberg [this message]
2013-05-20 11:07       ` Rafael J. Wysocki
2013-05-20 11:28         ` [PATCH v2] " Mika Westerberg
2013-05-23  7:27           ` [PATCH v3] " Mika Westerberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130520102530.GG11878@intel.com \
    --to=mika.westerberg@linux.intel.com \
    --cc=lenb@kernel.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael.j.wysocki@intel.com \
    --cc=rjw@sisk.pl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).