Skip to contentSkip to conversation

ACPI: bus: Fix osc_sb_cppc_not_supported check

PATCH In review Perry Yuan 2 participants 3 messages Jun 24, 2022 ACPI

lore
Share & tools
lore

Perry Yuan

author
#0 lore raw

PATCH 1/1 ACPI: bus: Fix osc_sb_cppc_not_supported check

The patch fixs the osc_sb_cppc_not_supported variable checking Otherwise the cppc acpi driver will be failed to register causing AMD pstate driver failed to load when calling acpi_cpc_valid()

Fixes c42fa24b447("ACPI: bus: Avoid using CPPC if not supported by firmware")
---
 drivers/acpi/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/bus.c +1 -1
index 4d7c51a33b01..9731e4a1e338 100644
@@ -359,7 +359,7 @@ static void acpi_bus_osc_negotiate_platform_control(void)
 	}
 
 #ifdef CONFIG_ACPI_CPPC_LIB
-	osc_sb_cppc_not_supported = !(capbuf_ret[OSC_SUPPORT_DWORD] &
+	osc_sb_cppc_not_supported = !(capbuf_ret[OSC_SUPPORT_DWORD] &&
 			(OSC_SB_CPC_SUPPORT | OSC_SB_CPCV2_SUPPORT));
 #endif
 
Signature · 1 line
2.25.1
#1 lore raw
Quoted 16 lines · Perry Yuan

The patch fixs the osc_sb_cppc_not_supported variable checking Otherwise the cppc acpi driver will be failed to register causing AMD pstate driver failed to load when calling acpi_cpc_valid()

Fixes c42fa24b447("ACPI: bus: Avoid using CPPC if not supported by firmware")
---
 drivers/acpi/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/bus.c +0 -0
index 4d7c51a33b01..9731e4a1e338 100644

drivers/acpi/bus.c static void acpi_bus_osc_negotiate_platform_control(void) · line 363

Quoted 6 lines
drivers/acpi/bus.c +1 -1
@@ -359,7 +359,7 @@ static void acpi_bus_osc_negotiate_platform_control(void)
        }
 
 #ifdef CONFIG_ACPI_CPPC_LIB
-       osc_sb_cppc_not_supported = !(capbuf_ret[OSC_SUPPORT_DWORD] &
+       osc_sb_cppc_not_supported = !(capbuf_ret[OSC_SUPPORT_DWORD] &&
                        (OSC_SB_CPC_SUPPORT | OSC_SB_CPCV2_SUPPORT));

This certainly is not a correct fix, because it causes osc_sb_cppc_not_supported to always be true if capbuf_ret[OSC_SUPPORT_DWORD] is not zero.

Quoted 5 lines
drivers/acpi/bus.c +0 -1
 #endif
 
--

2.25.1

#2 lore raw

[AMD Official Use Only - General]

Hi Rafael:

Quoted 38 lines

-----Original Message-----
From: Rafael J. Wysocki <[email protected]>
Sent: Saturday, June 25, 2022 12:12 AM
To: Yuan, Perry <[email protected]>
Cc: Huang, Ray <[email protected]>; Limonciello, Mario <[email protected]>; Rafael J. Wysocki <[email protected]>; Len Brown <[email protected]>; Mika Westerberg <[email protected]>; ACPI Devel Maling List <linux- [email protected]>; Linux Kernel Mailing List <[email protected]>; Fontenot, Nathan <[email protected]>; Su, Jinzhou (Joe) <[email protected]>; Huang, Shimmer <[email protected]>; Du, Xiaojian <[email protected]>; Meng, Li (Jassmine) <[email protected]>; Linux PM <[email protected]>
Subject: Re: [PATCH] ACPI: bus: Fix osc_sb_cppc_not_supported check

[CAUTION: External Email]

drivers/acpi/bus.c static void

Quoted 17 lines · Perry Yuan

The patch fixs the osc_sb_cppc_not_supported variable checking Otherwise the cppc acpi driver will be failed to register causing AMD pstate driver failed to load when calling acpi_cpc_valid()

Fixes c42fa24b447("ACPI: bus: Avoid using CPPC if not supported by

firmware")

---
 drivers/acpi/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/acpi/bus.c index renamed from drivers/acpi/bus.c +0 -0

4d7c51a33b01..9731e4a1e338 100644

drivers/acpi/bus.c +0 -0
@@ -359,7 +359,7 @@ static void

acpi_bus_osc_negotiate_platform_control(void)

Quoted 2 lines
drivers/acpi/bus.c +0 -0
        }
 
Quoted 9 lines

drivers/acpi/bus.c static void acpi_bus_osc_negotiate_platform_control(void) · line 363

Quoted 4 lines
drivers/acpi/bus.c +1 -1
 #ifdef CONFIG_ACPI_CPPC_LIB
-       osc_sb_cppc_not_supported = !(capbuf_ret[OSC_SUPPORT_DWORD] &
+       osc_sb_cppc_not_supported = !(capbuf_ret[OSC_SUPPORT_DWORD] &&
                        (OSC_SB_CPC_SUPPORT | OSC_SB_CPCV2_SUPPORT));

This certainly is not a correct fix, because it causes osc_sb_cppc_not_supported to always be true if capbuf_ret[OSC_SUPPORT_DWORD] is not zero.

Quoted 1 line
drivers/acpi/bus.c +0 -0
 #endif

That is true, I will send another fix solution soon.

Perry

Quoted 4 lines
Quoted 4 lines
drivers/acpi/bus.c +0 -1
--

2.25.1