Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NVMeFix - Use to force a low power state when entering sleep? #980

Closed
herb2k opened this issue Jun 15, 2020 · 2 comments
Closed

NVMeFix - Use to force a low power state when entering sleep? #980

herb2k opened this issue Jun 15, 2020 · 2 comments
Labels
invalid This doesn't seem right project:nvme

Comments

@herb2k
Copy link

herb2k commented Jun 15, 2020

I was reviewing debug info and noticed these entries when entering sleep, is it possible to force the change to a low power state on entering sleep, similar to Apple SSDs?

While in sleep - before the device enters standby, I notice the SSD stays powered up - ie it's warm and drawing current the whole time, which leads me to believe it's not being idled properly?

2020-06-14 23:53:52.981921-0700  localhost kernel[0]: (Lilu) NVMeFix        pm: @ (DBG) powerStateDidChangeTo 0x0
2020-06-14 23:53:52.981929-0700  localhost kernel[0]: (Lilu) NVMeFix        pm: @ (DBG) Ignoring transition to non-usable state 0x0

Also grabbed the APST details from linux for comparison:

get-feature:0xc (Autonomous Power State Transition), Current value:0x000001
Autonomous Power State Transition Enable (APSTE): Enabled
Auto PST Entries .................
Entry[ 0]  
.................
Idle Time Prior to Transition (ITPT): 500 ms
Idle Transition Power State   (ITPS): 3
.................
Entry[ 1]  
.................
Idle Time Prior to Transition (ITPT): 500 ms
Idle Transition Power State   (ITPS): 3
.................
Entry[ 2]  
.................
Idle Time Prior to Transition (ITPT): 500 ms
Idle Transition Power State   (ITPS): 3
.................
Entry[ 3]  
.................
Idle Time Prior to Transition (ITPT): 700 ms
Idle Transition Power State   (ITPS): 4
.................
Entry[ 4]  
.................
Idle Time Prior to Transition (ITPT): 0 ms
Idle Transition Power State   (ITPS): 0
.................
Entry[ 5]  
.................
Idle Time Prior to Transition (ITPT): 0 ms
Idle Transition Power State   (ITPS): 0



@07151129
Copy link

07151129 commented Jun 15, 2020

The log message just states that the controller is not waking up from sleep, so APST re-enable is not needed. There is nothing wrong with this.

For system sleep, ACPI S1-S4 low-power states should be used that disable the controller. There is also PCI ASPM support, but you may need to inject an extra property to force it. There was a recent broadcom-related issue that discussed this in detail, see #794. Note that some controllers become unreliable with ASPM, so there may be a potential risk of data loss.

In addition to PCI-level power management, the NVMe specification also has support for the following power management modes:

  • Active host-driven state switching, i.e. when the host explicitly tells the controller to switch to a certain state.

  • Autonomous power state transition (APST), i.e. when the controller decides to switch to a certain state on its own.

The latter is the preferred method of NVMeFix because it is a lot easier to integrate into IONVMeFamily, and it should perform better, as the controller can accurately keep track of the I/O performed. Exactly the same logic as in the Linux NVMe driver is used for APST config, resulting in exactly the same table as you posted.

IONVMeFamily exposes three power states (indexed 0 to 2): off, low-power and active. The log says that state 0 has been entered, so the controller should be off.

To summarise, this issue has nothing to do with APST; rather, it is a problem at PCI level that NVMeFix was not attempting to solve to begin with, because Apple drivers should be adequate for PCI-level power management.

Incidentally, you may want to try hibernation to see if that helps.

@07151129 07151129 added invalid This doesn't seem right project:nvme labels Jun 15, 2020
@herb2k
Copy link
Author

herb2k commented Jun 15, 2020

Thank you! This makes a lot more sense now, appreciate taking the time to explain to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right project:nvme
Development

No branches or pull requests

2 participants