From: Dmitry Torokhov <dtor_core-yWtbtysYrB+LZ21kGMrzwg@public.gmane.org>
To: Dominik Brodowski <linux-JhLEnvuH02M@public.gmane.org>
Cc: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
andrew.grover-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
cpufreq-1walMZg8u8rXmaaqVzeoHQ@public.gmane.org
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-JhLEnvuH02M@public.gmane.org>
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
next prev parent reply other threads:[~2003-09-05 5:23 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-09-04 22:24 [PATCHES] ACPI Processor update [idle,throttling,thermal,cpufreq] Dominik Brodowski
[not found] ` <20030904222434.GC6350-JhLEnvuH02M@public.gmane.org>
2003-09-05 5:23 ` Dmitry Torokhov [this message]
[not found] ` <200309050023.06761.dtor_core-yWtbtysYrB+LZ21kGMrzwg@public.gmane.org>
2003-09-05 6:52 ` [ACPI] [PATCHES] ACPI Processor update [idle, throttling, thermal, cpufreq] Dominik Brodowski
2003-09-08 13:29 ` Pavel Machek
[not found] ` <20030908132939.GD3944-u08AdweFZfgxtPtxi4kahqVXKuFTiq87@public.gmane.org>
2003-09-09 17:21 ` linux-JhLEnvuH02M
[not found] ` <20030909172135.GA4106-JhLEnvuH02M@public.gmane.org>
2003-09-09 23:13 ` Pavel Machek
[not found] ` <20030909231303.GH211-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2003-09-09 23:29 ` linux-JhLEnvuH02M
[not found] ` <20030909232916.GA9561-JhLEnvuH02M@public.gmane.org>
2003-09-10 0:00 ` Pavel Machek
[not found] ` <20030910000041.GC217-I/5MKhXcvmPrBKCeMvbIDA@public.gmane.org>
2003-09-10 0:17 ` [PATCH] acpi 2.6: consistent user-forced throttling (9/8) [Was: Re: [PATCHES] ACPI Processor update [idle, throttling, thermal, cpufreq]] linux-JhLEnvuH02M
[not found] ` <20030910001716.GA10324-JhLEnvuH02M@public.gmane.org>
2003-09-10 10:54 ` Nils Faerber
[not found] ` <1063191264.23733.1320.camel-65LrUGLyukAb1SvskN2V4Q@public.gmane.org>
2003-09-10 12:53 ` linux-JhLEnvuH02M
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-ywtbtysyrb+lz21kgmrzwg@public.gmane.org \
--cc=acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
--cc=andrew.grover-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
--cc=cpufreq-1walMZg8u8rXmaaqVzeoHQ@public.gmane.org \
--cc=linux-JhLEnvuH02M@public.gmane.org \
/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