Skip to content

Commit

Permalink
Add pci-aspm-custom property to signalise about the effects
Browse files Browse the repository at this point in the history
  • Loading branch information
vit9696 committed Apr 29, 2021
1 parent ada3baf commit 1ca48be
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
4 changes: 3 additions & 1 deletion NVMeFix/NVMeFix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,9 @@ void NVMeFixPlugin::forceEnableASPM(IOService *device) {

auto linkControl = pci->configRead16(space, offset);
pci->configWrite16(space, offset, (linkControl & ~ASPM_Mask) | ASPM_L1EntryEnabled);
DBGLOG(Log::Plugin, "ASPM transition on %s from %X to %X", safeString(device->getName()), linkControl, pci->configRead16(space, offset));
auto newLinkControl = pci->configRead16(space, offset);
DBGLOG(Log::Plugin, "ASPM transition on %s from %X to %X", safeString(device->getName()), linkControl, newLinkControl);
pci->setProperty("pci-aspm-custom", newLinkControl, 32);
}

void NVMeFixPlugin::handleController(ControllerEntry& entry) {
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ Configuration

`-nvmefaspm` forces ASPM L1 on all the devices. This argument is recommended exclusively for testing purposes,
as for daily usage one could inject `pci-aspm-default` device property with `<02 00 00 00>` value into the SSD devices and bridge devices they are connected to onboard.
Updated values will be visible as `pci-aspm-custom` in the affected devices.

Some SSDs misbehave when APST is on. NVMeFix attempts to detect broken motherboard and SSD
combinations and work around them. Motherboard is detected via IORegistry keys injected by Clover,
Expand Down

0 comments on commit 1ca48be

Please sign in to comment.