* [PATCH] AHCI powersaving and port-stopping (2.6.22-rc4)
@ 2007-06-11 10:54 John Fremlin
2007-06-11 11:20 ` Peter Ganzhorn
` (2 more replies)
0 siblings, 3 replies; 9+ messages in thread
From: John Fremlin @ 2007-06-11 10:54 UTC (permalink / raw)
To: linux-ide-u79uwXL29TY76Z2rM5mHXA, power-072X8lT/F9NAfugRpC6u6w
[-- Attachment #1: Type: text/plain, Size: 859 bytes --]
Tejun Heo has made an excellent patch for saving power with the AHCI
chipset. It saves about 1 W on my Thinkpad X60s.
This patch will stop the ports when they are idle. To turn it on,
echo 1 > /sys/module/libata/parameters/powersave
This is very different from the patch I posted a while ago turning on
a few bits in the CMD register (ALPE and ASP) and which Intel is
apparently now trying. That only saves around 250mW. Tejun's patch
saves about 1 W. It should also make the ALPE and ASP stuff irrelevant
because it performs the same operation in software where better
information about usage is (theoretically) available.
I have updated the patch for 2.6.22-rc4. That is the extent of my
involvement - if it works, thank Tejun Heo. But problems are quite
likely to have been introduced by my clumsy update, so if it doesn't
work, blame me first.
[-- Attachment #2: ahci-powersave-linux-2.6.22-rc4-clean.patch.bz2 --]
[-- Type: application/octet-stream, Size: 11253 bytes --]
[-- Attachment #3: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Power mailing list
Power-072X8lT/F9NAfugRpC6u6w@public.gmane.org
http://www.bughost.org/mailman/listinfo/power
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] AHCI powersaving and port-stopping (2.6.22-rc4)
2007-06-11 10:54 [PATCH] AHCI powersaving and port-stopping (2.6.22-rc4) John Fremlin
@ 2007-06-11 11:20 ` Peter Ganzhorn
2007-06-11 11:33 ` Peter Ganzhorn
2007-06-11 14:05 ` Arjan van de Ven
2 siblings, 0 replies; 9+ messages in thread
From: Peter Ganzhorn @ 2007-06-11 11:20 UTC (permalink / raw)
To: John Fremlin; +Cc: linux-ide, power
What Intel chipsets do include "AHCI chipset"?
I guess you are talking about the SATA controller of certain new Intel
chipsets, aren't you?
Just recently I noticed that my new notebooks SATA controller won't work
with the libata Intel ICH* drivers, though ICH8 was mentioned in the
description.
My SATA controller identifies as "Intel Corporation Mobile SATA AHCI
Controller" and seems to work with libata AHCI.
I was wondering when support for this controller will be added through
the ICH* driver, but is it possible that this SATA controller is
supposed to be used with the standard AHCI driver?
The chipset is an i965 (ICH8M).
Peter
John Fremlin wrote:
> Tejun Heo has made an excellent patch for saving power with the AHCI
> chipset. It saves about 1 W on my Thinkpad X60s.
>
> This patch will stop the ports when they are idle. To turn it on,
>
> echo 1 > /sys/module/libata/parameters/powersave
>
> This is very different from the patch I posted a while ago turning on
> a few bits in the CMD register (ALPE and ASP) and which Intel is
> apparently now trying. That only saves around 250mW. Tejun's patch
> saves about 1 W. It should also make the ALPE and ASP stuff irrelevant
> because it performs the same operation in software where better
> information about usage is (theoretically) available.
>
> I have updated the patch for 2.6.22-rc4. That is the extent of my
> involvement - if it works, thank Tejun Heo. But problems are quite
> likely to have been introduced by my clumsy update, so if it doesn't
> work, blame me first.
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Power mailing list
> Power@bughost.org
> http://www.bughost.org/mailman/listinfo/power
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] AHCI powersaving and port-stopping (2.6.22-rc4)
2007-06-11 10:54 [PATCH] AHCI powersaving and port-stopping (2.6.22-rc4) John Fremlin
2007-06-11 11:20 ` Peter Ganzhorn
@ 2007-06-11 11:33 ` Peter Ganzhorn
2007-06-11 14:20 ` John Fremlin
2007-06-11 14:05 ` Arjan van de Ven
2 siblings, 1 reply; 9+ messages in thread
From: Peter Ganzhorn @ 2007-06-11 11:33 UTC (permalink / raw)
To: John Fremlin; +Cc: linux-ide, power
I just wanted to have a look at the patch and see if it works for me -
looks like somethings not all straight, I get this while booting:
ahci 0000:00:1f.2: version 2.2
ACPI: PCI Interrupt 0000:00:1f.2[C] -> GSI 19 (level, low) -> IRQ 19
ahci 0000:00:1f.2: nr_ports (3) and implemented port map (0x1) don't match
ahci 0000:00:1f.2: AHCI 0001.0100 32 slots 3 ports 3 Gbps 0x1 impl SATA mode
ahci 0000:00:1f.2: flags: 64bit ncq pm led clo pio slum part
PCI: Setting latency timer of device 0000:00:1f.2 to 64
scsi0 : ahci
ata1: SATA max UDMA/133 cmd 0xffffc20000048100 ctl 0x0000000000000000
bmdma 0x0000000000000000 irq 0
WARNING: at drivers/ata/libata-eh.c:1917 ata_eh_set_powersave()
Call Trace:
[<ffffffff804a99ce>] ata_eh_set_powersave+0x34e/0x370
[<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
[<ffffffff804a9e27>] ata_do_eh+0xb7/0x16f0
[<ffffffff80229f9d>] find_busiest_group+0x1bd/0x800
[<ffffffff804aece0>] ahci_postreset+0x0/0x80
[<ffffffff804ada70>] ahci_hardreset+0x0/0xf0
[<ffffffff804aee20>] ahci_softreset+0x0/0x270
[<ffffffff804a40f0>] ata_std_prereset+0x0/0xf0
[<ffffffff8023b134>] lock_timer_base+0x34/0x70
[<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
[<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
[<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
[<ffffffff804abc27>] ata_scsi_error+0x297/0x730
[<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
[<ffffffff8048c893>] scsi_error_handler+0xe3/0x330
[<ffffffff80229507>] __wake_up_common+0x47/0x80
[<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
[<ffffffff8024675b>] kthread+0x4b/0x80
[<ffffffff8020a9a8>] child_rip+0xa/0x12
[<ffffffff80246710>] kthread+0x0/0x80
[<ffffffff8020a99e>] child_rip+0x0/0x12
ata1: SATA link up 1.5 Gbps (SStatus 113 SControl 300)
ata1.00: ata_hpa_resize 1: sectors = 312581808, hpa_sectors = 312581808
ata1.00: ATA-7: Hitachi HTS541616J9SA00, SB4OC7DP, max UDMA/100
ata1.00: 312581808 sectors, multi 0: LBA48 NCQ (depth 31/32)
ata1.00: ata_hpa_resize 1: sectors = 312581808, hpa_sectors = 312581808
ata1.00: configured for UDMA/100
scsi 0:0:0:0: Direct-Access ATA Hitachi HTS54161 SB4O PQ: 0 ANSI: 5
sd 0:0:0:0: [sda] 312581808 512-byte hardware sectors (160042 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't
support DPO or FUA
sd 0:0:0:0: [sda] 312581808 512-byte hardware sectors (160042 MB)
sd 0:0:0:0: [sda] Write Protect is off
sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00
sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't
support DPO or FUA
sda: sda1 sda2 sda3 sda4
sd 0:0:0:0: [sda] Attached SCSI disk
sd 0:0:0:0: Attached scsi generic sg0 type 0
I hope this output from dmesg helps to make the patch better - if I can
do any further testing please let me know!
Peter
John Fremlin wrote:
> Tejun Heo has made an excellent patch for saving power with the AHCI
> chipset. It saves about 1 W on my Thinkpad X60s.
>
> This patch will stop the ports when they are idle. To turn it on,
>
> echo 1 > /sys/module/libata/parameters/powersave
>
> This is very different from the patch I posted a while ago turning on
> a few bits in the CMD register (ALPE and ASP) and which Intel is
> apparently now trying. That only saves around 250mW. Tejun's patch
> saves about 1 W. It should also make the ALPE and ASP stuff irrelevant
> because it performs the same operation in software where better
> information about usage is (theoretically) available.
>
> I have updated the patch for 2.6.22-rc4. That is the extent of my
> involvement - if it works, thank Tejun Heo. But problems are quite
> likely to have been introduced by my clumsy update, so if it doesn't
> work, blame me first.
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Power mailing list
> Power@bughost.org
> http://www.bughost.org/mailman/listinfo/power
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] AHCI powersaving and port-stopping (2.6.22-rc4)
2007-06-11 10:54 [PATCH] AHCI powersaving and port-stopping (2.6.22-rc4) John Fremlin
2007-06-11 11:20 ` Peter Ganzhorn
2007-06-11 11:33 ` Peter Ganzhorn
@ 2007-06-11 14:05 ` Arjan van de Ven
2007-06-11 19:44 ` Kristen Carlson Accardi
2 siblings, 1 reply; 9+ messages in thread
From: Arjan van de Ven @ 2007-06-11 14:05 UTC (permalink / raw)
To: John Fremlin; +Cc: linux-ide, power
> This is very different from the patch I posted a while ago turning on
> a few bits in the CMD register (ALPE and ASP) and which Intel is
we've not seen a patch that actually works in this area unfortunately.
We know Kristen's patch does work
> apparently now trying. That only saves around 250mW. Tejun's patch
.. and saves close to a watt on a laptop in our measurements
the patch is available on
http://www.kernel.org/pub/linux/kernel/people/kristen/patches/SATA/alpm/
maybe worth a try as well..
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] AHCI powersaving and port-stopping (2.6.22-rc4)
2007-06-11 11:33 ` Peter Ganzhorn
@ 2007-06-11 14:20 ` John Fremlin
2007-06-11 21:49 ` Peter Ganzhorn
0 siblings, 1 reply; 9+ messages in thread
From: John Fremlin @ 2007-06-11 14:20 UTC (permalink / raw)
To: Peter Ganzhorn; +Cc: linux-ide, power
Peter Ganzhorn <peter.ganzhorn@googlemail.com> writes:
> I just wanted to have a look at the patch and see if it works for me -
> looks like somethings not all straight, I get this while booting:
>
> ahci 0000:00:1f.2: version 2.2
> ACPI: PCI Interrupt 0000:00:1f.2[C] -> GSI 19 (level, low) -> IRQ 19
> ahci 0000:00:1f.2: nr_ports (3) and implemented port map (0x1) don't match
> ahci 0000:00:1f.2: AHCI 0001.0100 32 slots 3 ports 3 Gbps 0x1 impl SATA mode
> ahci 0000:00:1f.2: flags: 64bit ncq pm led clo pio slum part
> PCI: Setting latency timer of device 0000:00:1f.2 to 64
> scsi0 : ahci
> ata1: SATA max UDMA/133 cmd 0xffffc20000048100 ctl 0x0000000000000000
> bmdma 0x0000000000000000 irq 0
> WARNING: at drivers/ata/libata-eh.c:1917 ata_eh_set_powersave()
[...]
> I hope this output from dmesg helps to make the patch better - if I
> can do any further testing please let me know!
That is fine. The warning is expected. There is nothing wrong with
it.
This patch will stop the ports when they are idle. To turn it on,
echo 1 > /sys/module/libata/parameters/powersave
[...]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] AHCI powersaving and port-stopping (2.6.22-rc4)
2007-06-11 14:05 ` Arjan van de Ven
@ 2007-06-11 19:44 ` Kristen Carlson Accardi
2007-06-12 0:52 ` AHCI aggressive powersaving John Fremlin
0 siblings, 1 reply; 9+ messages in thread
From: Kristen Carlson Accardi @ 2007-06-11 19:44 UTC (permalink / raw)
To: Arjan van de Ven; +Cc: John Fremlin, linux-ide, power
On Mon, 11 Jun 2007 07:05:38 -0700
Arjan van de Ven <arjan@linux.intel.com> wrote:
> > This is very different from the patch I posted a while ago turning on
> > a few bits in the CMD register (ALPE and ASP) and which Intel is
>
> we've not seen a patch that actually works in this area unfortunately.
> We know Kristen's patch does work
>
> > apparently now trying. That only saves around 250mW. Tejun's patch
>
> .. and saves close to a watt on a laptop in our measurements
>
> the patch is available on
> http://www.kernel.org/pub/linux/kernel/people/kristen/patches/SATA/alpm/
>
> maybe worth a try as well..
> -
I've updated the hardware based patches and posted to the mailing list -
they do indeed save anywhere from .6-1.5 watts depending on the system,
on my X60 they save about a watt. I don't think that a hardware based
solution is irrelevant at all - it will usually be able to make faster
and more accurrate decisions about when to place the link into lower
power state than software could.
Note that the previous implementation that was posted didn't work for me,
so I just redid everything.
http://marc.info/?l=linux-kernel&m=118158780117084&w=2
Kristen
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] AHCI powersaving and port-stopping (2.6.22-rc4)
2007-06-11 14:20 ` John Fremlin
@ 2007-06-11 21:49 ` Peter Ganzhorn
2007-06-12 0:43 ` John Fremlin
0 siblings, 1 reply; 9+ messages in thread
From: Peter Ganzhorn @ 2007-06-11 21:49 UTC (permalink / raw)
To: John Fremlin; +Cc: linux-ide, power
Well actually I did not worry about the warning, this particular part
made me worry much more:
Call Trace:
[<ffffffff804a99ce>] ata_eh_set_powersave+0x34e/0x370
[<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
[<ffffffff804a9e27>] ata_do_eh+0xb7/0x16f0
[<ffffffff80229f9d>] find_busiest_group+0x1bd/0x800
[<ffffffff804aece0>] ahci_postreset+0x0/0x80
[<ffffffff804ada70>] ahci_hardreset+0x0/0xf0
[<ffffffff804aee20>] ahci_softreset+0x0/0x270
[<ffffffff804a40f0>] ata_std_prereset+0x0/0xf0
[<ffffffff8023b134>] lock_timer_base+0x34/0x70
[<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
[<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
[<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
[<ffffffff804abc27>] ata_scsi_error+0x297/0x730
[<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
[<ffffffff8048c893>] scsi_error_handler+0xe3/0x330
[<ffffffff80229507>] __wake_up_common+0x47/0x80
[<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
[<ffffffff8024675b>] kthread+0x4b/0x80
[<ffffffff8020a9a8>] child_rip+0xa/0x12
[<ffffffff80246710>] kthread+0x0/0x80
[<ffffffff8020a99e>] child_rip+0x0/0x12
Looks like the kernel complains about a bug or something at this point?!
Because I am not a developer I can't tell for sure, but I don't think
this is all good.
It is printed to dmesg when booting and a second time when enabling the
feature via sysfs.
Peter
John Fremlin wrote:
> Peter Ganzhorn <peter.ganzhorn@googlemail.com> writes:
>
>
>> I just wanted to have a look at the patch and see if it works for me -
>> looks like somethings not all straight, I get this while booting:
>>
>> ahci 0000:00:1f.2: version 2.2
>> ACPI: PCI Interrupt 0000:00:1f.2[C] -> GSI 19 (level, low) -> IRQ 19
>> ahci 0000:00:1f.2: nr_ports (3) and implemented port map (0x1) don't match
>> ahci 0000:00:1f.2: AHCI 0001.0100 32 slots 3 ports 3 Gbps 0x1 impl SATA mode
>> ahci 0000:00:1f.2: flags: 64bit ncq pm led clo pio slum part
>> PCI: Setting latency timer of device 0000:00:1f.2 to 64
>> scsi0 : ahci
>> ata1: SATA max UDMA/133 cmd 0xffffc20000048100 ctl 0x0000000000000000
>> bmdma 0x0000000000000000 irq 0
>> WARNING: at drivers/ata/libata-eh.c:1917 ata_eh_set_powersave()
>>
>
> [...]
>
>
>> I hope this output from dmesg helps to make the patch better - if I
>> can do any further testing please let me know!
>>
>
> That is fine. The warning is expected. There is nothing wrong with
> it.
>
> This patch will stop the ports when they are idle. To turn it on,
> echo 1 > /sys/module/libata/parameters/powersave
>
> [...]
>
>
>
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: [PATCH] AHCI powersaving and port-stopping (2.6.22-rc4)
2007-06-11 21:49 ` Peter Ganzhorn
@ 2007-06-12 0:43 ` John Fremlin
0 siblings, 0 replies; 9+ messages in thread
From: John Fremlin @ 2007-06-12 0:43 UTC (permalink / raw)
To: Peter Ganzhorn; +Cc: linux-ide, power
Peter Ganzhorn <peter.ganzhorn@googlemail.com> writes:
> Well actually I did not worry about the warning, this particular part
> made me worry much more:
This comes with the warning. The warning prints this stack trace.
> Call Trace:
> [<ffffffff804a99ce>] ata_eh_set_powersave+0x34e/0x370
> [<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
> [<ffffffff804a9e27>] ata_do_eh+0xb7/0x16f0
> [<ffffffff80229f9d>] find_busiest_group+0x1bd/0x800
> [<ffffffff804aece0>] ahci_postreset+0x0/0x80
> [<ffffffff804ada70>] ahci_hardreset+0x0/0xf0
> [<ffffffff804aee20>] ahci_softreset+0x0/0x270
> [<ffffffff804a40f0>] ata_std_prereset+0x0/0xf0
> [<ffffffff8023b134>] lock_timer_base+0x34/0x70
> [<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
> [<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
> [<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
> [<ffffffff804abc27>] ata_scsi_error+0x297/0x730
> [<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
> [<ffffffff8048c893>] scsi_error_handler+0xe3/0x330
> [<ffffffff80229507>] __wake_up_common+0x47/0x80
> [<ffffffff8048c7b0>] scsi_error_handler+0x0/0x330
> [<ffffffff8024675b>] kthread+0x4b/0x80
> [<ffffffff8020a9a8>] child_rip+0xa/0x12
> [<ffffffff80246710>] kthread+0x0/0x80
> [<ffffffff8020a99e>] child_rip+0x0/0x12
>
> Looks like the kernel complains about a bug or something at this
> point?! Because I am not a developer I can't tell for sure, but I
> don't think this is all good.
> It is printed to dmesg when booting and a second time when enabling
> the feature via sysfs.
>
> Peter
>
>
> John Fremlin wrote:
>> Peter Ganzhorn <peter.ganzhorn@googlemail.com> writes:
>>
>>
>>> I just wanted to have a look at the patch and see if it works for
>>> me -
>>> looks like somethings not all straight, I get this while booting:
>>>
>>> ahci 0000:00:1f.2: version 2.2
>>> ACPI: PCI Interrupt 0000:00:1f.2[C] -> GSI 19 (level, low) -> IRQ 19
>>> ahci 0000:00:1f.2: nr_ports (3) and implemented port map (0x1) don't match
>>> ahci 0000:00:1f.2: AHCI 0001.0100 32 slots 3 ports 3 Gbps 0x1 impl SATA mode
>>> ahci 0000:00:1f.2: flags: 64bit ncq pm led clo pio slum part
>>> PCI: Setting latency timer of device 0000:00:1f.2 to 64
>>> scsi0 : ahci
>>> ata1: SATA max UDMA/133 cmd 0xffffc20000048100 ctl 0x0000000000000000
>>> bmdma 0x0000000000000000 irq 0
>>> WARNING: at drivers/ata/libata-eh.c:1917 ata_eh_set_powersave()
>>>
>>
>> [...]
>>
>>
>>> I hope this output from dmesg helps to make the patch better - if I
>>> can do any further testing please let me know!
>>>
>>
>> That is fine. The warning is expected. There is nothing wrong with
>> it.
>>
>> This patch will stop the ports when they are idle. To turn it on,
>> echo 1 > /sys/module/libata/parameters/powersave
>>
>> [...]
>>
>>
>>
^ permalink raw reply [flat|nested] 9+ messages in thread
* AHCI aggressive powersaving
2007-06-11 19:44 ` Kristen Carlson Accardi
@ 2007-06-12 0:52 ` John Fremlin
0 siblings, 0 replies; 9+ messages in thread
From: John Fremlin @ 2007-06-12 0:52 UTC (permalink / raw)
To: Kristen Carlson Accardi; +Cc: Arjan van de Ven, linux-ide, power
Kristen Carlson Accardi <kristen.c.accardi@intel.com> writes:
[...]
> I've updated the hardware based patches and posted to the mailing list -
> they do indeed save anywhere from .6-1.5 watts depending on the system,
> on my X60 they save about a watt. I don't think that a hardware based
> solution is irrelevant at all - it will usually be able to make faster
> and more accurrate decisions about when to place the link into lower
> power state than software could.
Fair enough. But could I point out that the patch I posted from Tejun
Heo actually does "stop" the port, not just putting it into low power
slumber modes.
So, I think it might be able to save more power.
Please take a look at it. It is quite sophisticated and could be
generalised to more chipsets. Perhaps, on AHCI it can be used in
combination with the aggressive link power management.
> Note that the previous implementation that was posted didn't work for me,
> so I just redid everything.
Was that my implementation?
I posted it in November last year. It certainly isn't as good as yours
http://marc.info/?l=linux-kernel&m=116343039621877&w=2
As you can see, I too thought it saved about 1 W, but Pavel Machek
measured 250mW.
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2007-06-12 0:53 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-11 10:54 [PATCH] AHCI powersaving and port-stopping (2.6.22-rc4) John Fremlin
2007-06-11 11:20 ` Peter Ganzhorn
2007-06-11 11:33 ` Peter Ganzhorn
2007-06-11 14:20 ` John Fremlin
2007-06-11 21:49 ` Peter Ganzhorn
2007-06-12 0:43 ` John Fremlin
2007-06-11 14:05 ` Arjan van de Ven
2007-06-11 19:44 ` Kristen Carlson Accardi
2007-06-12 0:52 ` AHCI aggressive powersaving John Fremlin
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).