Re: Average power consumption in S3?

2005-03-11 Thread Benjamin Herrenschmidt
On Fri, 2005-03-11 at 23:58 -0500, Theodore Ts'o wrote:

> If this is true, then ATI probably won't be able to tell us anything
> useful, so we're only going to find out if people in the Thinkpad
> division are willing to tell us something useful (and their track
> record for being helpful has not been particularly stellar).
> 
> And what I was thinking about doing was having the CONFIG option only
> do it for machines that were detected as being IBM Thinkpads, not all
> Radeon chips.  The blacklist would be for specific IBM thinkpad
> models; what I'm guessing here is that it's likely that all or most
> modern IBM thinkpads are going to be wired the same way on the
> motherboard.  

Fine with me then.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-11 Thread Theodore Ts'o
On Sat, Mar 12, 2005 at 10:48:21AM +1100, Benjamin Herrenschmidt wrote:
> 
> I'm hesitant to switch a whitelist because of a couple of settings in
> there that are specific to the way the chip is wired on the mobo.
> Apparently, thinkpads are similar enough to Macs, but I wouldn't bet on
> this beeing "commmon"...

If this is true, then ATI probably won't be able to tell us anything
useful, so we're only going to find out if people in the Thinkpad
division are willing to tell us something useful (and their track
record for being helpful has not been particularly stellar).

And what I was thinking about doing was having the CONFIG option only
do it for machines that were detected as being IBM Thinkpads, not all
Radeon chips.  The blacklist would be for specific IBM thinkpad
models; what I'm guessing here is that it's likely that all or most
modern IBM thinkpads are going to be wired the same way on the
motherboard.  

- Ted
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-11 Thread Benjamin Herrenschmidt

> What I would suggest doing is changing the code to use a blacklist
> instead of a whitelist, and make it optional with a CONFIG option that
> is marked experimental, and then get it into the mainline for
> additional testing.  If we can get ATI to give us the right way to do
> it, great, but if they aren't being responsive, maybe we should just
> do it empirically.

I'm hesitant to switch a whitelist because of a couple of settings in
there that are specific to the way the chip is wired on the mobo.
Apparently, thinkpads are similar enough to Macs, but I wouldn't bet on
this beeing "commmon"...

Also, the code in there switches to D2, not D3 and is only for M6,M7 and
M9 for now. I may be able to produce code for the M10 as well based on
some dumps we did from the MacOS driver, paulus wrote something that we
ended up not using because the chip is actually powered down on Macs
with the M10.

Then, there is the problem of machines where the chip is powered down
during sleep... I can re-POST an rv280 (M9+) and an M10 but only in
"graphics" mode, not the VGA side for which I know nothing about, with
the same possible issue about video RAM mode register setting.

Ben.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-11 Thread Jan De Luyck
On Wednesday 09 March 2005 15:40, Matthew Garrett wrote:
> Moritz Muehlenhoff <[EMAIL PROTECTED]> wrote:
> > I'm using an IBM Thinkpad X31. With stock 2.6.11 and the additional
> > radeontool to power-off the backlight in suspend, S3 works very well
> > and reliable. During S3 I've measured a power consumption of 1400
> > to 1500 mWh (using 512 megabytes of RAM). Is there still room for
> > optimization? What's the typical amount of energy required for suspend-
> > to-ram? From friends using iBooks with MacOS X I've heard that they
> > left the notebook in suspend when leaving for a week and could still
> > use it after return.
>
> Radeons don't actually power down in D3 unless some registers are set,
> and even then the kernel doesn't currently have any code that would put
> the Radeon in D3. If you're willing to test something, could you try the
> code at
>
> http://www.srcf.ucam.org/~mjg59/radeon/
>
> and do
>
> radeontool power off
>
> immediately before putting the machine into suspend? Make sure that you
> do this from something other than X.

Small question, can this tool do what the boot-radeon tool can? That way I can 
scrap another one in my suspend-to-ram tricks ;p

Jan

-- 
  I tripped over a hole that was sticking up out of the ground.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-11 Thread Bill Davidsen
Benjamin Herrenschmidt wrote:
I've sort-of been waiting for ATI to tell me how to retreive the proper
memory register setting from the BIOS, since the code in there currently
is quite powerbook specific, and might not write the exact correct value
on all models. I suppose it works fine on yours so far, but I'd rather
have a way to know the right value ... unfortunately, they didn't reply
on this request.
Any chance that it will apply to other Radeon based machines? I have an 
ASUS (1681) using the 8700 chipset. At the moment suspecd doesn't work 
at all, but at least somewhere in 2.6.10+ turning off the backlight 
started working with the screen saver.

I guess it's better than my Dell and Toshiba laptops, which suspecnd but 
don't resume :-(

--
   -bill davidsen ([EMAIL PROTECTED])
"The secret to procrastination is to put things off until the
 last possible moment - but no longer"  -me
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-11 Thread Theodore Ts'o
On Fri, Mar 11, 2005 at 03:51:19PM +1100, Benjamin Herrenschmidt wrote:
> I've sort-of been waiting for ATI to tell me how to retreive the proper
> memory register setting from the BIOS, since the code in there currently
> is quite powerbook specific, and might not write the exact correct value
> on all models. I suppose it works fine on yours so far, but I'd rather
> have a way to know the right value ... unfortunately, they didn't reply
> on this request.

There have been probably about 40 or 50 positive reports from people
on a wide variety of Thinkpad laptops (most generally recent models)
where it has worked.  There were two that didn't, but it wasn't clear
at least to me whether they were true incompatibilities or unrelated
problems caused by old BIOS levels, et. al.   

What I would suggest doing is changing the code to use a blacklist
instead of a whitelist, and make it optional with a CONFIG option that
is marked experimental, and then get it into the mainline for
additional testing.  If we can get ATI to give us the right way to do
it, great, but if they aren't being responsive, maybe we should just
do it empirically.

- Ted
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-11 Thread Theodore Ts'o
On Fri, Mar 11, 2005 at 03:51:19PM +1100, Benjamin Herrenschmidt wrote:
 I've sort-of been waiting for ATI to tell me how to retreive the proper
 memory register setting from the BIOS, since the code in there currently
 is quite powerbook specific, and might not write the exact correct value
 on all models. I suppose it works fine on yours so far, but I'd rather
 have a way to know the right value ... unfortunately, they didn't reply
 on this request.

There have been probably about 40 or 50 positive reports from people
on a wide variety of Thinkpad laptops (most generally recent models)
where it has worked.  There were two that didn't, but it wasn't clear
at least to me whether they were true incompatibilities or unrelated
problems caused by old BIOS levels, et. al.   

What I would suggest doing is changing the code to use a blacklist
instead of a whitelist, and make it optional with a CONFIG option that
is marked experimental, and then get it into the mainline for
additional testing.  If we can get ATI to give us the right way to do
it, great, but if they aren't being responsive, maybe we should just
do it empirically.

- Ted
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-11 Thread Bill Davidsen
Benjamin Herrenschmidt wrote:
I've sort-of been waiting for ATI to tell me how to retreive the proper
memory register setting from the BIOS, since the code in there currently
is quite powerbook specific, and might not write the exact correct value
on all models. I suppose it works fine on yours so far, but I'd rather
have a way to know the right value ... unfortunately, they didn't reply
on this request.
Any chance that it will apply to other Radeon based machines? I have an 
ASUS (1681) using the 8700 chipset. At the moment suspecd doesn't work 
at all, but at least somewhere in 2.6.10+ turning off the backlight 
started working with the screen saver.

I guess it's better than my Dell and Toshiba laptops, which suspecnd but 
don't resume :-(

--
   -bill davidsen ([EMAIL PROTECTED])
The secret to procrastination is to put things off until the
 last possible moment - but no longer  -me
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-11 Thread Jan De Luyck
On Wednesday 09 March 2005 15:40, Matthew Garrett wrote:
 Moritz Muehlenhoff [EMAIL PROTECTED] wrote:
  I'm using an IBM Thinkpad X31. With stock 2.6.11 and the additional
  radeontool to power-off the backlight in suspend, S3 works very well
  and reliable. During S3 I've measured a power consumption of 1400
  to 1500 mWh (using 512 megabytes of RAM). Is there still room for
  optimization? What's the typical amount of energy required for suspend-
  to-ram? From friends using iBooks with MacOS X I've heard that they
  left the notebook in suspend when leaving for a week and could still
  use it after return.

 Radeons don't actually power down in D3 unless some registers are set,
 and even then the kernel doesn't currently have any code that would put
 the Radeon in D3. If you're willing to test something, could you try the
 code at

 http://www.srcf.ucam.org/~mjg59/radeon/

 and do

 radeontool power off

 immediately before putting the machine into suspend? Make sure that you
 do this from something other than X.

Small question, can this tool do what the boot-radeon tool can? That way I can 
scrap another one in my suspend-to-ram tricks ;p

Jan

-- 
  I tripped over a hole that was sticking up out of the ground.
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-11 Thread Benjamin Herrenschmidt

 What I would suggest doing is changing the code to use a blacklist
 instead of a whitelist, and make it optional with a CONFIG option that
 is marked experimental, and then get it into the mainline for
 additional testing.  If we can get ATI to give us the right way to do
 it, great, but if they aren't being responsive, maybe we should just
 do it empirically.

I'm hesitant to switch a whitelist because of a couple of settings in
there that are specific to the way the chip is wired on the mobo.
Apparently, thinkpads are similar enough to Macs, but I wouldn't bet on
this beeing commmon...

Also, the code in there switches to D2, not D3 and is only for M6,M7 and
M9 for now. I may be able to produce code for the M10 as well based on
some dumps we did from the MacOS driver, paulus wrote something that we
ended up not using because the chip is actually powered down on Macs
with the M10.

Then, there is the problem of machines where the chip is powered down
during sleep... I can re-POST an rv280 (M9+) and an M10 but only in
graphics mode, not the VGA side for which I know nothing about, with
the same possible issue about video RAM mode register setting.

Ben.


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-11 Thread Theodore Ts'o
On Sat, Mar 12, 2005 at 10:48:21AM +1100, Benjamin Herrenschmidt wrote:
 
 I'm hesitant to switch a whitelist because of a couple of settings in
 there that are specific to the way the chip is wired on the mobo.
 Apparently, thinkpads are similar enough to Macs, but I wouldn't bet on
 this beeing commmon...

If this is true, then ATI probably won't be able to tell us anything
useful, so we're only going to find out if people in the Thinkpad
division are willing to tell us something useful (and their track
record for being helpful has not been particularly stellar).

And what I was thinking about doing was having the CONFIG option only
do it for machines that were detected as being IBM Thinkpads, not all
Radeon chips.  The blacklist would be for specific IBM thinkpad
models; what I'm guessing here is that it's likely that all or most
modern IBM thinkpads are going to be wired the same way on the
motherboard.  

- Ted
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-11 Thread Benjamin Herrenschmidt
On Fri, 2005-03-11 at 23:58 -0500, Theodore Ts'o wrote:

 If this is true, then ATI probably won't be able to tell us anything
 useful, so we're only going to find out if people in the Thinkpad
 division are willing to tell us something useful (and their track
 record for being helpful has not been particularly stellar).
 
 And what I was thinking about doing was having the CONFIG option only
 do it for machines that were detected as being IBM Thinkpads, not all
 Radeon chips.  The blacklist would be for specific IBM thinkpad
 models; what I'm guessing here is that it's likely that all or most
 modern IBM thinkpads are going to be wired the same way on the
 motherboard.  

Fine with me then.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-10 Thread Benjamin Herrenschmidt
On Thu, 2005-03-10 at 22:46 -0500, Theodore Ts'o wrote:
> On Thu, Mar 10, 2005 at 07:08:26PM +0100, Moritz Muehlenhoff wrote:
> > I've got the e100 and with WOL disabled and Matthew's hacked radeontool
> > power consumption decreases to 970 mWh.
> 
> I have a T40p, and with the following patches (versus 2.6.11) and the
> following sleep script, I have power consuption down to 580 mWh.
> 
> The 05-radeonfb-Thinkpad-Power.patch will have to patched with your
> specific Thinkpad model number, or booted with the force_sleep option.
> See the Linux thinkpad mailing list ([EMAIL PROTECTED]) 
> archives for more information.
> 
> Warning: The 05-radeonfb-Thinkpad-Power.patch is not quite ready for
> merging, but compared to completely pathetic battery life when using
> ACPI's suspend-to-memory without them, it's definitely worth it.

Hi Ted !

Hopefully, somebody is gathering those patches. I intend to merge them
all at one point, though I can't promise it will happen before 2.6.12.

It would be good to "ping" me regulary though ;)

I've sort-of been waiting for ATI to tell me how to retreive the proper
memory register setting from the BIOS, since the code in there currently
is quite powerbook specific, and might not write the exact correct value
on all models. I suppose it works fine on yours so far, but I'd rather
have a way to know the right value ... unfortunately, they didn't reply
on this request.

Ben.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-10 Thread Theodore Ts'o
On Thu, Mar 10, 2005 at 07:08:26PM +0100, Moritz Muehlenhoff wrote:
> I've got the e100 and with WOL disabled and Matthew's hacked radeontool
> power consumption decreases to 970 mWh.

I have a T40p, and with the following patches (versus 2.6.11) and the
following sleep script, I have power consuption down to 580 mWh.

The 05-radeonfb-Thinkpad-Power.patch will have to patched with your
specific Thinkpad model number, or booted with the force_sleep option.
See the Linux thinkpad mailing list ([EMAIL PROTECTED]) 
archives for more information.

Warning: The 05-radeonfb-Thinkpad-Power.patch is not quite ready for
merging, but compared to completely pathetic battery life when using
ACPI's suspend-to-memory without them, it's definitely worth it.

- Ted

From: Christian Borntraeger <[EMAIL PROTECTED]>

During the wakeup from suspend-to-ram I get several warnings.

Signed-off-by: Christian Borntraeger <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
---

 25-akpm/drivers/acpi/osl.c  |4 ++--
 25-akpm/drivers/acpi/pci_link.c |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff -puN drivers/acpi/osl.c~acpi-sleep-while-atomic-during-s3-resume-from-ram 
drivers/acpi/osl.c
--- 25/drivers/acpi/osl.c~acpi-sleep-while-atomic-during-s3-resume-from-ram 
2005-01-16 00:45:23.784364208 -0800
+++ 25-akpm/drivers/acpi/osl.c  2005-01-16 00:45:23.789363448 -0800
@@ -145,7 +145,7 @@ acpi_os_vprintf(const char *fmt, va_list
 void *
 acpi_os_allocate(acpi_size size)
 {
-   return kmalloc(size, GFP_KERNEL);
+   return kmalloc(size, GFP_ATOMIC);
 }
 
 void
@@ -905,7 +905,7 @@ acpi_os_wait_semaphore(
 
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, "Waiting for semaphore[%p|%d|%d]\n", 
handle, units, timeout));
 
-   if (in_atomic())
+   if (in_atomic() || irqs_disabled())
timeout = 0;
 
switch (timeout)
diff -puN 
drivers/acpi/pci_link.c~acpi-sleep-while-atomic-during-s3-resume-from-ram 
drivers/acpi/pci_link.c
--- 
25/drivers/acpi/pci_link.c~acpi-sleep-while-atomic-during-s3-resume-from-ram
2005-01-16 00:45:23.785364056 -0800
+++ 25-akpm/drivers/acpi/pci_link.c 2005-01-16 00:45:23.790363296 -0800
@@ -315,7 +315,7 @@ acpi_pci_link_set (
if (!link || !irq)
return_VALUE(-EINVAL);
 
-   resource = kmalloc( sizeof(*resource)+1, GFP_KERNEL);
+   resource = kmalloc( sizeof(*resource)+1, GFP_ATOMIC);
if(!resource)
return_VALUE(-ENOMEM);
 
_
This is needed to remove another sleeping function called from invalid 
context error message when resuming from sleep.

Signed-off-by: "Theodore Ts'o" <[EMAIL PROTECTED]>


Index: src/drivers/acpi/utils.c
===
--- src.orig/drivers/acpi/utils.c   2005-03-03 13:08:44.0 -0500
+++ src/drivers/acpi/utils.c2005-03-03 13:10:04.0 -0500
@@ -252,7 +252,7 @@
if (!data)
return_ACPI_STATUS(AE_BAD_PARAMETER);
 
-   element = kmalloc(sizeof(union acpi_object), GFP_KERNEL);
+   element = kmalloc(sizeof(union acpi_object), GFP_ATOMIC);
if(!element)
return_ACPI_STATUS(AE_NO_MEMORY);
 
= drivers/video/aty/radeon_base.c 1.40 vs edited =
--- 1.40/drivers/video/aty/radeon_base.c2005-02-15 21:25:30 -05:00
+++ edited/drivers/video/aty/radeon_base.c  2005-02-17 20:30:48 -05:00
@@ -273,6 +273,9 @@
 #ifdef CONFIG_MTRR
 static int nomtrr = 0;
 #endif
+#if defined(CONFIG_PM) && defined(CONFIG_X86)
+int radeon_force_sleep = 0;
+#endif
 
 /*
  * prototypes
@@ -2535,6 +2538,10 @@
force_measure_pll = 1;
} else if (!strncmp(this_opt, "ignore_edid", 11)) {
ignore_edid = 1;
+#if defined(CONFIG_PM) && defined(CONFIG_X86)
+   } else if (!strncmp(this_opt, "force_sleep", 11)) {
+   radeon_force_sleep = 1;
+#endif
} else
mode_option = this_opt;
}
@@ -2574,3 +2581,5 @@
 MODULE_PARM_DESC(panel_yres, "int: set panel yres");
 module_param(mode_option, charp, 0);
 MODULE_PARM_DESC(mode_option, "Specify resolution as 
\"x[-][@]\" ");
+module_param(radeon_force_sleep, int, 0);
+MODULE_PARM_DESC(radeon_force_sleep, "bool: force ACPI sleep mode on untested 
machines");
= drivers/video/aty/radeon_pm.c 1.10 vs edited =
--- 1.10/drivers/video/aty/radeon_pm.c  2005-02-12 23:01:11 -05:00
+++ edited/drivers/video/aty/radeon_pm.c2005-02-17 20:23:57 -05:00
@@ -25,8 +25,97 @@
 #include 
 #endif
 
+/* For detecting supported PC laptops */
+#ifdef CONFIG_X86
+#include 
+#endif
+
 #include "ati_ids.h"
 
+#ifdef CONFIG_X86
+/* This array holds a list of supported PC laptops.
+ * Currently only few IBM models are tested.
+ * If you want to experiment, use dmidecode to find out
+ * vendor and product codes for Your laptop.
+ */
+static struct dmi_system_id 

Re: Average power consumption in S3?

2005-03-10 Thread Moritz Muehlenhoff
Martin Josefsson wrote:
> I also have an X31 and I noticed that the e1000 has Wake-On-Lan enabled
> by default and the S3 code doesn't disable that (kind of defeats the
> purpose :)
> Disabling that will make the e1000 driver power down the chip during S3.
> 
> I've had mine suspended for 2-3 days at most, actually havn't left it
> alone for longer than that in S3 so I'm not really sure how much power
> it consumes, but I'd say it's 1-2 percent of the total capacity per
> hour, so somewhere below 1000mW.

I've got the e100 and with WOL disabled and Matthew's hacked radeontool
power consumption decreases to 970 mWh.

Cheers,
Moritz
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-10 Thread Moritz Muehlenhoff
Matthew Garrett wrote:
> Radeons don't actually power down in D3 unless some registers are set,
> and even then the kernel doesn't currently have any code that would put
> the Radeon in D3. If you're willing to test something, could you try the
> code at
> 
> http://www.srcf.ucam.org/~mjg59/radeon/
> 
> immediately before putting the machine into suspend? Make sure that you
> do this from something other than X.

This reduces power consumption from ca. 1500 to ca. 1200 mWh, so it's
already a huge improvement, but with 1.5 days of maximal suspend still
pretty far away from a week.

Cheers,
Moritz
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-10 Thread Moritz Muehlenhoff
Matthew Garrett wrote:
 Radeons don't actually power down in D3 unless some registers are set,
 and even then the kernel doesn't currently have any code that would put
 the Radeon in D3. If you're willing to test something, could you try the
 code at
 
 http://www.srcf.ucam.org/~mjg59/radeon/
 
 immediately before putting the machine into suspend? Make sure that you
 do this from something other than X.

This reduces power consumption from ca. 1500 to ca. 1200 mWh, so it's
already a huge improvement, but with 1.5 days of maximal suspend still
pretty far away from a week.

Cheers,
Moritz
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-10 Thread Moritz Muehlenhoff
Martin Josefsson wrote:
 I also have an X31 and I noticed that the e1000 has Wake-On-Lan enabled
 by default and the S3 code doesn't disable that (kind of defeats the
 purpose :)
 Disabling that will make the e1000 driver power down the chip during S3.
 
 I've had mine suspended for 2-3 days at most, actually havn't left it
 alone for longer than that in S3 so I'm not really sure how much power
 it consumes, but I'd say it's 1-2 percent of the total capacity per
 hour, so somewhere below 1000mW.

I've got the e100 and with WOL disabled and Matthew's hacked radeontool
power consumption decreases to 970 mWh.

Cheers,
Moritz
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-10 Thread Theodore Ts'o
On Thu, Mar 10, 2005 at 07:08:26PM +0100, Moritz Muehlenhoff wrote:
 I've got the e100 and with WOL disabled and Matthew's hacked radeontool
 power consumption decreases to 970 mWh.

I have a T40p, and with the following patches (versus 2.6.11) and the
following sleep script, I have power consuption down to 580 mWh.

The 05-radeonfb-Thinkpad-Power.patch will have to patched with your
specific Thinkpad model number, or booted with the force_sleep option.
See the Linux thinkpad mailing list ([EMAIL PROTECTED]) 
archives for more information.

Warning: The 05-radeonfb-Thinkpad-Power.patch is not quite ready for
merging, but compared to completely pathetic battery life when using
ACPI's suspend-to-memory without them, it's definitely worth it.

- Ted

From: Christian Borntraeger [EMAIL PROTECTED]

During the wakeup from suspend-to-ram I get several warnings.

Signed-off-by: Christian Borntraeger [EMAIL PROTECTED]
Signed-off-by: Andrew Morton [EMAIL PROTECTED]
---

 25-akpm/drivers/acpi/osl.c  |4 ++--
 25-akpm/drivers/acpi/pci_link.c |2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff -puN drivers/acpi/osl.c~acpi-sleep-while-atomic-during-s3-resume-from-ram 
drivers/acpi/osl.c
--- 25/drivers/acpi/osl.c~acpi-sleep-while-atomic-during-s3-resume-from-ram 
2005-01-16 00:45:23.784364208 -0800
+++ 25-akpm/drivers/acpi/osl.c  2005-01-16 00:45:23.789363448 -0800
@@ -145,7 +145,7 @@ acpi_os_vprintf(const char *fmt, va_list
 void *
 acpi_os_allocate(acpi_size size)
 {
-   return kmalloc(size, GFP_KERNEL);
+   return kmalloc(size, GFP_ATOMIC);
 }
 
 void
@@ -905,7 +905,7 @@ acpi_os_wait_semaphore(
 
ACPI_DEBUG_PRINT ((ACPI_DB_MUTEX, Waiting for semaphore[%p|%d|%d]\n, 
handle, units, timeout));
 
-   if (in_atomic())
+   if (in_atomic() || irqs_disabled())
timeout = 0;
 
switch (timeout)
diff -puN 
drivers/acpi/pci_link.c~acpi-sleep-while-atomic-during-s3-resume-from-ram 
drivers/acpi/pci_link.c
--- 
25/drivers/acpi/pci_link.c~acpi-sleep-while-atomic-during-s3-resume-from-ram
2005-01-16 00:45:23.785364056 -0800
+++ 25-akpm/drivers/acpi/pci_link.c 2005-01-16 00:45:23.790363296 -0800
@@ -315,7 +315,7 @@ acpi_pci_link_set (
if (!link || !irq)
return_VALUE(-EINVAL);
 
-   resource = kmalloc( sizeof(*resource)+1, GFP_KERNEL);
+   resource = kmalloc( sizeof(*resource)+1, GFP_ATOMIC);
if(!resource)
return_VALUE(-ENOMEM);
 
_
This is needed to remove another sleeping function called from invalid 
context error message when resuming from sleep.

Signed-off-by: Theodore Ts'o [EMAIL PROTECTED]


Index: src/drivers/acpi/utils.c
===
--- src.orig/drivers/acpi/utils.c   2005-03-03 13:08:44.0 -0500
+++ src/drivers/acpi/utils.c2005-03-03 13:10:04.0 -0500
@@ -252,7 +252,7 @@
if (!data)
return_ACPI_STATUS(AE_BAD_PARAMETER);
 
-   element = kmalloc(sizeof(union acpi_object), GFP_KERNEL);
+   element = kmalloc(sizeof(union acpi_object), GFP_ATOMIC);
if(!element)
return_ACPI_STATUS(AE_NO_MEMORY);
 
= drivers/video/aty/radeon_base.c 1.40 vs edited =
--- 1.40/drivers/video/aty/radeon_base.c2005-02-15 21:25:30 -05:00
+++ edited/drivers/video/aty/radeon_base.c  2005-02-17 20:30:48 -05:00
@@ -273,6 +273,9 @@
 #ifdef CONFIG_MTRR
 static int nomtrr = 0;
 #endif
+#if defined(CONFIG_PM)  defined(CONFIG_X86)
+int radeon_force_sleep = 0;
+#endif
 
 /*
  * prototypes
@@ -2535,6 +2538,10 @@
force_measure_pll = 1;
} else if (!strncmp(this_opt, ignore_edid, 11)) {
ignore_edid = 1;
+#if defined(CONFIG_PM)  defined(CONFIG_X86)
+   } else if (!strncmp(this_opt, force_sleep, 11)) {
+   radeon_force_sleep = 1;
+#endif
} else
mode_option = this_opt;
}
@@ -2574,3 +2581,5 @@
 MODULE_PARM_DESC(panel_yres, int: set panel yres);
 module_param(mode_option, charp, 0);
 MODULE_PARM_DESC(mode_option, Specify resolution as 
\xresxyres[-bpp][@refresh]\ );
+module_param(radeon_force_sleep, int, 0);
+MODULE_PARM_DESC(radeon_force_sleep, bool: force ACPI sleep mode on untested 
machines);
= drivers/video/aty/radeon_pm.c 1.10 vs edited =
--- 1.10/drivers/video/aty/radeon_pm.c  2005-02-12 23:01:11 -05:00
+++ edited/drivers/video/aty/radeon_pm.c2005-02-17 20:23:57 -05:00
@@ -25,8 +25,97 @@
 #include asm/pmac_feature.h
 #endif
 
+/* For detecting supported PC laptops */
+#ifdef CONFIG_X86
+#include linux/dmi.h
+#endif
+
 #include ati_ids.h
 
+#ifdef CONFIG_X86
+/* This array holds a list of supported PC laptops.
+ * Currently only few IBM models are tested.
+ * If you want to experiment, use dmidecode to find out
+ * vendor and product codes for Your laptop.
+ */
+static struct 

Re: Average power consumption in S3?

2005-03-10 Thread Benjamin Herrenschmidt
On Thu, 2005-03-10 at 22:46 -0500, Theodore Ts'o wrote:
 On Thu, Mar 10, 2005 at 07:08:26PM +0100, Moritz Muehlenhoff wrote:
  I've got the e100 and with WOL disabled and Matthew's hacked radeontool
  power consumption decreases to 970 mWh.
 
 I have a T40p, and with the following patches (versus 2.6.11) and the
 following sleep script, I have power consuption down to 580 mWh.
 
 The 05-radeonfb-Thinkpad-Power.patch will have to patched with your
 specific Thinkpad model number, or booted with the force_sleep option.
 See the Linux thinkpad mailing list ([EMAIL PROTECTED]) 
 archives for more information.
 
 Warning: The 05-radeonfb-Thinkpad-Power.patch is not quite ready for
 merging, but compared to completely pathetic battery life when using
 ACPI's suspend-to-memory without them, it's definitely worth it.

Hi Ted !

Hopefully, somebody is gathering those patches. I intend to merge them
all at one point, though I can't promise it will happen before 2.6.12.

It would be good to ping me regulary though ;)

I've sort-of been waiting for ATI to tell me how to retreive the proper
memory register setting from the BIOS, since the code in there currently
is quite powerbook specific, and might not write the exact correct value
on all models. I suppose it works fine on yours so far, but I'd rather
have a way to know the right value ... unfortunately, they didn't reply
on this request.

Ben.


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-09 Thread Martin Josefsson
On Wed, 2005-03-09 at 15:26 +0100, Moritz Muehlenhoff wrote:
> Hi,
> I'm using an IBM Thinkpad X31. With stock 2.6.11 and the additional
> radeontool to power-off the backlight in suspend, S3 works very well
> and reliable. During S3 I've measured a power consumption of 1400
> to 1500 mWh (using 512 megabytes of RAM). Is there still room for
> optimization? What's the typical amount of energy required for suspend-
> to-ram? From friends using iBooks with MacOS X I've heard that they
> left the notebook in suspend when leaving for a week and could still
> use it after return.

I also have an X31 and I noticed that the e1000 has Wake-On-Lan enabled
by default and the S3 code doesn't disable that (kind of defeats the
purpose :)
Disabling that will make the e1000 driver power down the chip during S3.

ethtool -s ethX wol d

I don't know if you have the e1000 or e100 in your machine, but I think
the e100 driver does the same.

I've had mine suspended for 2-3 days at most, actually havn't left it
alone for longer than that in S3 so I'm not really sure how much power
it consumes, but I'd say it's 1-2 percent of the total capacity per
hour, so somewhere below 1000mW.

I also use the standard radeontool to disable the backlight, I'll test
the version Matthew pointed out some day.

-- 
/Martin


signature.asc
Description: This is a digitally signed message part


Re: Average power consumption in S3?

2005-03-09 Thread Matthew Garrett
Moritz Muehlenhoff <[EMAIL PROTECTED]> wrote:

> I'm using an IBM Thinkpad X31. With stock 2.6.11 and the additional
> radeontool to power-off the backlight in suspend, S3 works very well
> and reliable. During S3 I've measured a power consumption of 1400
> to 1500 mWh (using 512 megabytes of RAM). Is there still room for
> optimization? What's the typical amount of energy required for suspend-
> to-ram? From friends using iBooks with MacOS X I've heard that they
> left the notebook in suspend when leaving for a week and could still
> use it after return.

Radeons don't actually power down in D3 unless some registers are set,
and even then the kernel doesn't currently have any code that would put
the Radeon in D3. If you're willing to test something, could you try the
code at

http://www.srcf.ucam.org/~mjg59/radeon/

and do

radeontool power off

immediately before putting the machine into suspend? Make sure that you
do this from something other than X.
-- 
Matthew Garrett | [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-09 Thread Matthew Garrett
Moritz Muehlenhoff [EMAIL PROTECTED] wrote:

 I'm using an IBM Thinkpad X31. With stock 2.6.11 and the additional
 radeontool to power-off the backlight in suspend, S3 works very well
 and reliable. During S3 I've measured a power consumption of 1400
 to 1500 mWh (using 512 megabytes of RAM). Is there still room for
 optimization? What's the typical amount of energy required for suspend-
 to-ram? From friends using iBooks with MacOS X I've heard that they
 left the notebook in suspend when leaving for a week and could still
 use it after return.

Radeons don't actually power down in D3 unless some registers are set,
and even then the kernel doesn't currently have any code that would put
the Radeon in D3. If you're willing to test something, could you try the
code at

http://www.srcf.ucam.org/~mjg59/radeon/

and do

radeontool power off

immediately before putting the machine into suspend? Make sure that you
do this from something other than X.
-- 
Matthew Garrett | [EMAIL PROTECTED]
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: Average power consumption in S3?

2005-03-09 Thread Martin Josefsson
On Wed, 2005-03-09 at 15:26 +0100, Moritz Muehlenhoff wrote:
 Hi,
 I'm using an IBM Thinkpad X31. With stock 2.6.11 and the additional
 radeontool to power-off the backlight in suspend, S3 works very well
 and reliable. During S3 I've measured a power consumption of 1400
 to 1500 mWh (using 512 megabytes of RAM). Is there still room for
 optimization? What's the typical amount of energy required for suspend-
 to-ram? From friends using iBooks with MacOS X I've heard that they
 left the notebook in suspend when leaving for a week and could still
 use it after return.

I also have an X31 and I noticed that the e1000 has Wake-On-Lan enabled
by default and the S3 code doesn't disable that (kind of defeats the
purpose :)
Disabling that will make the e1000 driver power down the chip during S3.

ethtool -s ethX wol d

I don't know if you have the e1000 or e100 in your machine, but I think
the e100 driver does the same.

I've had mine suspended for 2-3 days at most, actually havn't left it
alone for longer than that in S3 so I'm not really sure how much power
it consumes, but I'd say it's 1-2 percent of the total capacity per
hour, so somewhere below 1000mW.

I also use the standard radeontool to disable the backlight, I'll test
the version Matthew pointed out some day.

-- 
/Martin


signature.asc
Description: This is a digitally signed message part