[haiku-development] Re: [gsoc2012] cpuidle support

  • From: Yongcong Du <ycdu.vmcore@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 6 Apr 2012 00:16:07 +0800

Hi tqh and clemens,

On Tue, Mar 27, 2012 at 4:36 PM, Fredrik Holmqvist <
fredrik.holmqvist@xxxxxxxxx> wrote:

> Den 27 mars 2012 09:03 skrev Enrique Medina Gremaldos <quiqueiii@xxxxxxxxx
> >:
> >> 1. I still don't know whether haiku's acpi  can get and change
> > c-states(NOTE: c-states not p-states)
> >
> > I guess it is possible. I found p-states through acpi module and
> performed
> > some transitions, so whenever your acpi table is not a totally crap, it
> > should be the same for c-states.
> >
> >> 2. acpi is complex, I don't know can it be completed in one summer
> >
> > As I said, I guess currect acpi stack is mature enought for your project
>
> A little info about ACPI in Haiku and its current state:
> We use ACPICA, http://www.acpica.org/ to do the ACPI handling (except
> in early boot stages).
> ACPICA has been improving a lot in later years and tries to compensate
> for buggy bioses and is fairly successful at it now. We also have a
> ACPI Embedded Controller driver, based on FreeBSD's which I'm quite
> certain isn't completly bug-free yet and there is also the integration
> code between the OS and ACPICA.
> All this works ok I guess, but it do expose lack of ACPI drivers
> (brightness for instance)  and irq-routing issues (probably fixed) and
> the steps taken on shutdown are not completly right.
>
> Other than that ACPICA should handle most the complexity and is quite
> mature. What may be needed is debugging our integration of it in
> Haiku. So add time for that.
>
>
Thank you all very much for information. I spent one week to learn how to
write driver for haiku and then wrote one simple driver to decode the
c-states from ACPI _CST, but I failed. The driver is attached. Here is the
failure point:

status = device->acpi->evaluate_method(device->acpi_cookie, "_CST", NULL,
&buffer);
if (status != B_OK) {
        dprintf("failed to get _CST\n");
....

I did get "failed to get _CST" log in serial console. Would you please help
to check what's wrong with my driver?

Besides the attached patch, we need the following changes to make it can be
built by jam:

diff --git a/src/add-ons/kernel/drivers/power/Jamfile
b/src/add-ons/kernel/drivers/p
index 56d9143..08d00f5 100644
--- a/src/add-ons/kernel/drivers/power/Jamfile
+++ b/src/add-ons/kernel/drivers/power/Jamfile
@@ -5,3 +5,4 @@ SubInclude HAIKU_TOP src add-ons kernel drivers power
acpi_button ;
 SubInclude HAIKU_TOP src add-ons kernel drivers power acpi_lid ;
 SubInclude HAIKU_TOP src add-ons kernel drivers power acpi_thermal ;
 SubInclude HAIKU_TOP src add-ons kernel drivers power enhanced_speedstep ;
+SubInclude HAIKU_TOP src add-ons kernel drivers power acpi_cpuidle ;


PS: I found that enhanced_speedstep driver hardcodes the p-states rather
than gets them from acpi?

Since the proposal deadline is tomorrow, I need to make a decision whether
to add acpi c-state driver to my goals. Once it's included in my project
goals, I have to implement it. Your help is appreciated!


Thanks in advance,
Yongcong

Other related posts: