cpufreq Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dtor_core@ameritech.net>
To: Dominik Brodowski <linux@brodo.de>
Cc: acpi-devel@lists.sourceforge.net, andrew.grover@intel.com,
	cpufreq@www.linux.org.uk
Subject: Re: [ACPI] [PATCHES] ACPI Processor update [idle, throttling, thermal, cpufreq]
Date: Fri, 5 Sep 2003 00:23:06 -0500	[thread overview]
Message-ID: <200309050023.06761.dtor_core@ameritech.net> (raw)
In-Reply-To: <20030904222434.GC6350@brodo.de>

Dominik,

I have couple of concerns regarding P-states IO library, esp. 
acpi_processor_get_frequency. It seems that ACPI does not allow
to read current state without setting it first, at least with
the following code on my notebook I was always getting garbage 
in the status register:

+static int
+acpi_processor_get_current_state(
+       struct acpi_processor_performance       *perf)
+{
+       int     result = 0;
+       int     i;
+       u8      value;
+
+       ACPI_FUNCTION_TRACE("acpi_processor_get_current_state");
+
+       if (!perf->pr->flags.performance)
+               goto out;
+
+       value = inb(perf->status_register);
+
+       ACPI_DEBUG_PRINT((ACPI_DB_INFO,
+               "Got 0x%02x from port 0x%04x\n", value, perf->status_register));
+
+       for (i = 0; i < perf->state_count; i++) {
+               if (value == (u8) perf->states[i].status) {
+                       perf->state = i;
+                       goto out;
+               }
+       }
+
+       /* couldn't match our state table - garbage in status register */
+       ACPI_DEBUG_PRINT((ACPI_DB_ERROR,
+               "Bad data 0x%02x in performance status register 0x%04x\n",
+               value, perf->status_register));
+       result = -EFAULT;
+out:
+       return_VALUE(result);
+}

I am wondering is it just me, my code or general deficiency.

Also, do you really need to do notify_transition twice 
(acpi_processor_set_performance)?

Dmitry

  reply	other threads:[~2003-09-05  5:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-04 22:24 [PATCHES] ACPI Processor update [idle,throttling,thermal,cpufreq] Dominik Brodowski
2003-09-05  5:23 ` Dmitry Torokhov [this message]
2003-09-05  6:52   ` [ACPI] [PATCHES] ACPI Processor update [idle, throttling, thermal, cpufreq] Dominik Brodowski
2003-09-08 13:29 ` Pavel Machek
2003-09-09 17:21   ` linux
2003-09-09 23:13     ` Pavel Machek
2003-09-09 23:29       ` linux
2003-09-10  0:00         ` Pavel Machek

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=200309050023.06761.dtor_core@ameritech.net \
    --to=dtor_core@ameritech.net \
    --cc=acpi-devel@lists.sourceforge.net \
    --cc=andrew.grover@intel.com \
    --cc=cpufreq@www.linux.org.uk \
    --cc=linux@brodo.de \
    /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