ACPI / LPSS: Ensure LPIOEP is always set on resume
PATCH 1/1 ACPI / LPSS: Ensure LPIOEP is always set on resume
For some number of systems with lpss_quirks enabled, on boot the system goes through an acpi_lpss_resume() without a corresponding acpi_lpss_suspend() having been called. In that case, it requires the IOSF write to LPSS_IOSF_UNIT_LPIOEP / LPSS_IOSF_GPIODEF0 in order to continue booting successfully.
--- drivers/acpi/acpi_lpss.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/acpi/acpi_lpss.c +3 -3
@@ -939,14 +939,14 @@ static void lpss_iosf_exit_d3_state(void)mutex_lock (&lpss_iosf_mutex); +iosf_mbi_modify (LPSS_IOSF_UNIT_LPIOEP ,MBI_CR_WRITE , +LPSS_IOSF_GPIODEF0 , value1, mask1); +if (!lpss_iosf_d3_entered) goto exit; lpss_iosf_d3_entered = false; -iosf_mbi_modify (LPSS_IOSF_UNIT_LPIOEP ,MBI_CR_WRITE , -LPSS_IOSF_GPIODEF0 , value1, mask1); -iosf_mbi_modify (LPSS_IOSF_UNIT_LPIO2 ,MBI_CFG_WRITE ,LPSS_IOSF_PMCSR , value2, mask2);
Signature · 1 line
2.17.1
Hi, William,
Quoted 4 lines · William Lieurance
For some number of systems with
lpss_quirksenabled, on boot the system
goes through anacpi_lpss_resume()without a correspondingacpi_lpss_suspend()having been called.
I read the code but didn't find out why this could happen, but if it is true, please check if the below patch helps
Quoted 1 line
From
27fda1ab0d800966b0ec1c444fe356812bd2f04eMon Sep 17 00:00:00 2001
From: Zhang Rui <[email protected]>
Date: Mon, 3 Sep 2018 10:00:07 +0800
Subject: [PATCH] ACPI / LPSS: Force lpss quirks on boot
Commit 12864ff8545f ("ACPI / LPSS: Avoid PM quirks on suspend and resume from hibernation") bypasses lpss quirks for S3 and S4, by setting a flag for S3/S4 in acpi_lpss_suspend(), and check that flag in acpi_lpss_resume().
But this overlooks the boot case where acpi_lpss_resume() may get called without a corresponding acpi_lpss_suspend() having been called.
Thus force setting the flag during boot.
---
drivers/acpi/acpi_lpss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpi_lpss.c +0 -0
@@ -879,7 +879,7 @@ static void acpi_lpss_dismiss(struct device *dev)
#define LPSS_GPIODEF0_DMA_LLP BIT(13)
static DEFINE_MUTEX(lpss_iosf_mutex);
-static bool lpss_iosf_d3_entered;
+static bool lpss_iosf_d3_entered = true;
static void lpss_iosf_enter_d3_state(void)
{
--
2.7.4
PATCH 1/1 ACPI / LPSS: Force lpss quirks on boot
Quoted 29 lines · Zhang Rui
Hi, William,
Quoted 5 lines · William Lieurance
For some number of systems with
lpss_quirksenabled, on boot the system
goes through anacpi_lpss_resume()without a correspondingacpi_lpss_suspend()having been called.I read the code but didn't find out why this could happen, but if it is
true, please check if the below patch helpsFrom
27fda1ab0d800966b0ec1c444fe356812bd2f04eMon Sep 17 00:00:00 2001
From: Zhang Rui <[email protected]>
Date: Mon, 3 Sep 2018 10:00:07 +0800
Subject: [PATCH] ACPI / LPSS: Force lpss quirks on bootCommit
12864ff8545f("ACPI / LPSS: Avoid PM quirks on suspend and resume
from hibernation") bypasses lpss quirks for S3 and S4, by setting a flag
for S3/S4 inacpi_lpss_suspend(), and check that flag inacpi_lpss_resume().But this overlooks the boot case where
acpi_lpss_resume()may get called
without a correspondingacpi_lpss_suspend()having been called.
Quoted 6 lines
Thus force setting the flag during boot.
Fixes 12864ff8545f (ACPI / LPSS: Avoid PM quirks on suspend andresume from hibernation)
According to https://bugzilla.kernel.org/show_bug.cgi?id=200989#c6,
the patch has been confirmed to fix the problem.
Don't know why the patch does not show up in patchwork. Let me resend.
Quoted 1 line
From
f07303f10e41c2b61d0d4da5f74e98a3bf8e7147Mon Sep 17 00:00:00 2001
From: Zhang Rui <[email protected]>
Date: Mon, 3 Sep 2018 10:00:07 +0800
Subject: [PATCH] ACPI / LPSS: Force lpss quirks on boot
Commit 12864ff8545f ("ACPI / LPSS: Avoid PM quirks on suspend and resume from hibernation") bypasses lpss quirks for S3 and S4, by setting a flag for S3/S4 in acpi_lpss_suspend(), and check that flag in acpi_lpss_resume().
But this overlooks the boot case where acpi_lpss_resume() may get called without a corresponding acpi_lpss_suspend() having been called.
Thus force setting the flag during boot.
---
drivers/acpi/acpi_lpss.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/acpi_lpss.c +0 -0
@@ -879,7 +879,7 @@ static void acpi_lpss_dismiss(struct device *dev)
#define LPSS_GPIODEF0_DMA_LLP BIT(13)
static DEFINE_MUTEX(lpss_iosf_mutex);
-static bool lpss_iosf_d3_entered;
+static bool lpss_iosf_d3_entered = true;
static void lpss_iosf_enter_d3_state(void)
{
--
2.7.4