-
Notifications
You must be signed in to change notification settings - Fork 108
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
Apple NVMe low-power self-refresh mode #133
Comments
There was some discussion regarding LPSR and how it was needed to put the NVMecontroller in sleep mode. However, no solution was ever found. It's believed that this is the reason that suspend/resume does not work on the macbook 12-inch models (8,1 + 9,1 and 10,1) |
@leifliddy you're right about command 0xcc being issued before shutdown, but it is only needed for S3X. I don't believe that LPSR is required for NVM shutdown in general, though. |
@07151129 I'm not a kernel developer and don't know enough about acpi or nvme to know to implement that. There is however, a lot of interest in getting resume/suspend working on the |
Some Apple NVMe controllers support low-power self-refresh mode, LPSR. The following information describes the usage of LPSR by IONVMeFamily. Note that it is not derived from any Apple documentation and may be inaccurate. In addition to LPSR, there's also QoS with power budgets features, which is not considered here.
ACPI property "nvme-self-refresh" for the PCI controller indicates whether LPSR is supported for
that device. It appears that LPSR is not supported by S3ELab.
LPSR is entered when the controller has been idle for some time. The idleness period is determined
by the LPSR counter. Let
lpsrCount
denote the current LPSR counter value,lpsrTimeout
the idletimer period in seconds. Then, whenever the timer expires, the values are updated as follows:
LPSR is prohibited in ACPI S3, S4 states if ACPI property for the controller
nvme-LPSR-during-S3-S4 != 1
.Value
lpsrCount
is initialised whenever the Identify command has been completed for thecontroller. In order to fetch
lpsrCount
, the following command is used:When the timer expires, LPSR entry is initiated:
lpsrCount
is incremented.0b11
toCC.SHN
controller register.For S3X, command with opcode 0xcc is sent (
PrepareForShutdown
) before LPSR entry.Note that for LPSR the reserved bit of
CC.SHN
is used. Otherwise, for a normal shutdown,CC.SHN
is set to
0b01
.IONVMeFamily hardcodes the response timeout for the above procedure to be 30 s for S3ELab, 60 s for S3X, and 5 s otherwise.
There is a public patent, describing parts of LPSR.
The text was updated successfully, but these errors were encountered: