linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* AHCI SATA Runtime PM
@ 2021-03-04 15:34 Alexander Monakov
  2021-03-17 15:02 ` Hans de Goede
  2021-03-18 19:09 ` Enrico Weigelt, metux IT consult
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Monakov @ 2021-03-04 15:34 UTC (permalink / raw)
  To: Hans de Goede; +Cc: linux-kernel, linux-pm, Zhang Rui

Hello, Hans, Linux PM folks,

I'm looking for clarification regarding this patch discussion:

https://patchwork.kernel.org/project/linux-pm/patch/20180420101834.15783-2-0v3rdr0n3@gmail.com/

Hans said,

> Ah, so the AHCI code has runtime pm enabled by default (so there
> is another pm_runtime_allow() somewhere, but then disables it for
> unused ports to make hotpluging something into those ports work.

I have a laptop where two unused AHCI SATA controllers are present (but
obviously nothing can be hotplugged into them). Apparently due to the above,
they do not enter runtime autosuspend.

The problem is, these "ATA port" nodes don't seem to participate in udev
hierarchy, so it's unclear how I'm supposed to automatically re-enable
runtime PM for them. For PCI device nodes, I have

ACTION=="add", SUBSYSTEM=="pci", TEST=="power/control", ATTR{power/control}="auto"

but ata1/uevent is empty, so there's no obvious way to write the corresponding
UDev rule.

Prior to discovering the above patch discussion, I have filed a bug:
https://bugzilla.kernel.org/show_bug.cgi?id=211837

Does the above correctly reflect how AHCI PM is supposed to be? If so, what is
the proper way to enable runtime PM for unused ATA ports?

Thank you.
Alexander

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: AHCI SATA Runtime PM
  2021-03-04 15:34 AHCI SATA Runtime PM Alexander Monakov
@ 2021-03-17 15:02 ` Hans de Goede
  2021-03-18 19:09 ` Enrico Weigelt, metux IT consult
  1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2021-03-17 15:02 UTC (permalink / raw)
  To: Alexander Monakov, Jens Axboe
  Cc: linux-kernel, linux-pm, Zhang Rui, linux-ide

Hi,

On 3/4/21 4:34 PM, Alexander Monakov wrote:
> Hello, Hans, Linux PM folks,
> 
> I'm looking for clarification regarding this patch discussion:
> 
> https://patchwork.kernel.org/project/linux-pm/patch/20180420101834.15783-2-0v3rdr0n3@gmail.com/
> 
> Hans said,
> 
>> Ah, so the AHCI code has runtime pm enabled by default (so there
>> is another pm_runtime_allow() somewhere, but then disables it for
>> unused ports to make hotpluging something into those ports work.
> 
> I have a laptop where two unused AHCI SATA controllers are present (but
> obviously nothing can be hotplugged into them). Apparently due to the above,
> they do not enter runtime autosuspend.
> 
> The problem is, these "ATA port" nodes don't seem to participate in udev
> hierarchy, so it's unclear how I'm supposed to automatically re-enable
> runtime PM for them. For PCI device nodes, I have
> 
> ACTION=="add", SUBSYSTEM=="pci", TEST=="power/control", ATTR{power/control}="auto"
> 
> but ata1/uevent is empty, so there's no obvious way to write the corresponding
> UDev rule.

You can enable runtime-pm from udev using the following rule:

ACTION=="add", SUBSYSTEM=="ata_port", ATTR{../../power/control}="auto"

> Prior to discovering the above patch discussion, I have filed a bug:
> https://bugzilla.kernel.org/show_bug.cgi?id=211837
> 
> Does the above correctly reflect how AHCI PM is supposed to be?

This is a complicated question, I just checked and according to:
https://www.intel.com/content/www/us/en/io/serial-ata/serial-ata-ahci-spec-rev1-3-1.html

AHCI 1.3 compliant controllers should raise a PME signal on hotplug
changes even when in D3. So perhaps the solution is to catch this signal
and then wakeup the controller; and remove the pm_runtime_forbid(dev); call
from ata_tport_add().

I don't have much experience with dealing with the PME stuff, so you will
need to do some research there, or perhaps someone else can help?

This seems to be more of a sata/ahci question then a generic linux-pm question
though, so I have added Jebns and linux-ide to the To / Cc.

> If so, what is
> the proper way to enable runtime PM for unused ATA ports?

Regards,

Hans


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: AHCI SATA Runtime PM
  2021-03-04 15:34 AHCI SATA Runtime PM Alexander Monakov
  2021-03-17 15:02 ` Hans de Goede
@ 2021-03-18 19:09 ` Enrico Weigelt, metux IT consult
  1 sibling, 0 replies; 3+ messages in thread
From: Enrico Weigelt, metux IT consult @ 2021-03-18 19:09 UTC (permalink / raw)
  To: Alexander Monakov, Hans de Goede; +Cc: linux-kernel, linux-pm, Zhang Rui

On 04.03.21 16:34, Alexander Monakov wrote:

> I have a laptop where two unused AHCI SATA controllers are present (but
> obviously nothing can be hotplugged into them). Apparently due to the above,
> they do not enter runtime autosuspend.

if nothing ever can connect to them, shouldn't they be power off
entirely ?


--mtx

-- 
---
Hinweis: unverschlüsselte E-Mails können leicht abgehört und manipuliert
werden ! Für eine vertrauliche Kommunikation senden Sie bitte ihren
GPG/PGP-Schlüssel zu.
---
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-03-18 19:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-04 15:34 AHCI SATA Runtime PM Alexander Monakov
2021-03-17 15:02 ` Hans de Goede
2021-03-18 19:09 ` Enrico Weigelt, metux IT consult

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).