[PATCH 0/2] Add a workaround for s2idle resume on Lenovo laptops

Mario Limonciello posted 2 patches 4 years, 1 month ago
drivers/platform/x86/thinkpad_acpi.c | 134 ++++++++++++++++++++++++++-
1 file changed, 131 insertions(+), 3 deletions(-)
[PATCH 0/2] Add a workaround for s2idle resume on Lenovo laptops
Posted by Mario Limonciello 4 years, 1 month ago
Lenovo Thinkpads have a SMI handler during the D0 transition for NVME
devices specifically during resume from s2idle.  When the IOMMU
translation layer is enabled for NVME devices (which is the default
behavior per the IVRS table), then this SMI handler causes a very long
resume time (10+ seconds).

For the common s2idle circumstance on Linux this SMI handler is
unnecessary and just significantly inflates resume time. To avoid it,
add a new s2idle resume handler to thinkpad_acpi that will prevent it
from running on known problematic systems.  If the SMI handler is fixed on
these systems the DMI data can be modified to exclude them or only match
problematic BIOS versions.

Mario Limonciello (2):
  platform/x86: thinkpad_acpi: Convert btusb DMI list to quirks
  platform/x86: thinkpad_acpi: Add a s2idle resume quirk for a number of
    laptops

 drivers/platform/x86/thinkpad_acpi.c | 134 ++++++++++++++++++++++++++-
 1 file changed, 131 insertions(+), 3 deletions(-)

-- 
2.34.1
Re: [PATCH 0/2] Add a workaround for s2idle resume on Lenovo laptops
Posted by Hans de Goede 4 years, 1 month ago
Hi,

On 4/29/22 05:04, Mario Limonciello wrote:
> Lenovo Thinkpads have a SMI handler during the D0 transition for NVME
> devices specifically during resume from s2idle.  When the IOMMU
> translation layer is enabled for NVME devices (which is the default
> behavior per the IVRS table), then this SMI handler causes a very long
> resume time (10+ seconds).
> 
> For the common s2idle circumstance on Linux this SMI handler is
> unnecessary and just significantly inflates resume time. To avoid it,
> add a new s2idle resume handler to thinkpad_acpi that will prevent it
> from running on known problematic systems.  If the SMI handler is fixed on
> these systems the DMI data can be modified to exclude them or only match
> problematic BIOS versions.
> 
> Mario Limonciello (2):
>   platform/x86: thinkpad_acpi: Convert btusb DMI list to quirks
>   platform/x86: thinkpad_acpi: Add a s2idle resume quirk for a number of
>     laptops
> 
>  drivers/platform/x86/thinkpad_acpi.c | 134 ++++++++++++++++++++++++++-
>  1 file changed, 131 insertions(+), 3 deletions(-)

Thank you for your patch-series, I've applied the series to my
review-hans branch:
https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans

Note it will show up in my review-hans branch once I've pushed my
local branch there, which might take a while.

Once I've run some tests on this branch the patches there will be
added to the platform-drivers-x86/for-next branch and eventually
will be included in the pdx86 pull-request to Linus for the next
merge-window.

I'll also cherry-pick these into the pdx86 fixes branch and add them
to my next 5.18 fixes pull-req to Linus.

Regards,

Hans