ACPI: Correct \_SB._OSC bit definition for PRM
PATCH 1/2 ACPI: Correct \_SB._OSC bit definition for PRM
Accord to Platform Runtime Mechanism Specification v1.0 [1], Page 42, _OSC bit (BIT 21) is used to indicate OS support of platform runtime mechanism..
--- include/linux/acpi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/acpi.h +1 -1
@@ -551,8 +551,8 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);#define OSC_SB_OSLPI_SUPPORT 0x00000100#define OSC_SB_CPC_DIVERSE_HIGH_SUPPORT 0x00001000#define OSC_SB_GENERIC_INITIATOR_SUPPORT 0x00002000 -#define OSC_SB_PRM_SUPPORT 0x00020000#define OSC_SB_NATIVE_USB4_SUPPORT 0x00040000 +#define OSC_SB_PRM_SUPPORT 0x00200000extern bool osc_sb_apei_support_acked;extern bool osc_pc_lpi_support_confirmed;
Signature · 1 line
2.7.4
PATCH 2/2 ACPI: let BIOS fall back to legacy handling if PRM disabled
Based on _OSC PRM bit, BIOS can choose switch from legacy handling to using PRM. So if CONFIG_ACPI_PRMT is disabled, this bit should not be set to let BIOS fall back to the legacy handling (such as SMI).
--- drivers/acpi/bus.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/acpi/bus.c +2 -0
@@ -303,7 +303,9 @@ static void acpi_bus_osc_negotiate_platform_control(void) capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_HOTPLUG_OST_SUPPORT ; capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_PCLPI_SUPPORT ; +#ifdef CONFIG_ACPI_PRMT capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_PRM_SUPPORT ; +#endif #ifdef CONFIG_ARM64 capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_GENERIC_INITIATOR_SUPPORT ;
Signature · 1 line
2.7.4
Rafael J. Wysocki
maintainerRe: [PATCH 2/2] ACPI: let BIOS fall back to legacy handling if PRM disabled
Quoted 16 lines · Aubrey Li
Based on
_OSCPRM bit, BIOS can choose switch from legacy handling to using PRM. So ifCONFIG_ACPI_PRMTis disabled, this bit should not be set to let BIOS fall back to the legacy handling (such as SMI).Cc Dan Williams <[email protected]>Signed-off-by Aubrey Li <[email protected]>--- drivers/acpi/bus.c | 2 ++ 1 file changed, 2 insertions(+)drivers/acpi/bus.c +0
-0
drivers/acpi/bus.c static void acpi_bus_osc_negotiate_platform_control(void) · line 308
Quoted 6 lines
drivers/acpi/bus.c +2
-0@@ -303,7 +303,9 @@ static void acpi_bus_osc_negotiate_platform_control(void) capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_HOTPLUG_OST_SUPPORT ; capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_PCLPI_SUPPORT ; +#ifdef CONFIG_ACPI_PRMT capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_PRM_SUPPORT ; +#endif
What about using if (IS_ENABLED()) instead of #ifdef?
Quoted 6 lines
drivers/acpi/bus.c +0
-1#ifdef CONFIG_ARM64 capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_GENERIC_INITIATOR_SUPPORT ; --2.7.4
Rafael J. Wysocki
maintainerRe: [PATCH 2/2] ACPI: let BIOS fall back to legacy handling if PRM disabled
Quoted 19 lines · Rafael J. Wysocki
Quoted 17 lines · Aubrey Li
Based on
_OSCPRM bit, BIOS can choose switch from legacy handling to using PRM. So ifCONFIG_ACPI_PRMTis disabled, this bit should not be set to let BIOS fall back to the legacy handling (such as SMI).Cc Dan Williams <[email protected]>Signed-off-by Aubrey Li <[email protected]>--- drivers/acpi/bus.c | 2 ++ 1 file changed, 2 insertions(+)drivers/acpi/bus.c +0
-0@@ -303,7 +303,9 @@ static void acpi_bus_osc_negotiate_platform_control(void)
Quoted 7 lines
drivers/acpi/bus.c static void acpi_bus_osc_negotiate_platform_control(void) · line 308
Quoted 5 lines
drivers/acpi/bus.c +2
-0capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_HOTPLUG_OST_SUPPORT ; capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_PCLPI_SUPPORT ; +#ifdef CONFIG_ACPI_PRMT capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_PRM_SUPPORT ; +#endif What about using if (
IS_ENABLED()) instead of #ifdef?
I've made this change myself and applied the patch with a rewritten changelog and under a different subject ("ACPI: Do not singal PRM support if not enabled").
Thanks!
Re: [PATCH 2/2] ACPI: let BIOS fall back to legacy handling if PRM disabled
In reply to Rafael J. WysockiQuoted 18 lines · Rafael J. Wysocki
Quoted 17 lines · Aubrey Li
Based on
_OSCPRM bit, BIOS can choose switch from legacy handling to using PRM. So ifCONFIG_ACPI_PRMTis disabled, this bit should not be set to let BIOS fall back to the legacy handling (such as SMI).Cc Dan Williams <[email protected]>Signed-off-by Aubrey Li <[email protected]>--- drivers/acpi/bus.c | 2 ++ 1 file changed, 2 insertions(+)drivers/acpi/bus.c +0
-0@@ -303,7 +303,9 @@ static void acpi_bus_osc_negotiate_platform_control(void)
Quoted 7 lines
drivers/acpi/bus.c static void acpi_bus_osc_negotiate_platform_control(void) · line 308
Quoted 5 lines
drivers/acpi/bus.c +2
-0capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_HOTPLUG_OST_SUPPORT ; capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_PCLPI_SUPPORT ; +#ifdef CONFIG_ACPI_PRMT capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_PRM_SUPPORT ; +#endif What about using if (
IS_ENABLED()) instead of #ifdef?
aha, sorry, using if (IS_ENABLED()) is better, will come up with a new version soon.
Thanks,
-Aubrey
Rafael J. Wysocki
maintainerRe: [PATCH 2/2] ACPI: let BIOS fall back to legacy handling if PRM disabled
Quoted 28 lines · Aubrey Li
Quoted 18 lines · Rafael J. Wysocki
Quoted 17 lines · Aubrey Li
Based on
_OSCPRM bit, BIOS can choose switch from legacy handling to using PRM. So ifCONFIG_ACPI_PRMTis disabled, this bit should not be set to let BIOS fall back to the legacy handling (such as SMI).Cc Dan Williams <[email protected]>Signed-off-by Aubrey Li <[email protected]>--- drivers/acpi/bus.c | 2 ++ 1 file changed, 2 insertions(+)drivers/acpi/bus.c +0
-0@@ -303,7 +303,9 @@ static void acpi_bus_osc_negotiate_platform_control(void)Quoted 7 lines
drivers/acpi/bus.c static void acpi_bus_osc_negotiate_platform_control(void) · line 308
Quoted 5 lines
drivers/acpi/bus.c +2
-0capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_HOTPLUG_OST_SUPPORT ; capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_PCLPI_SUPPORT ; +#ifdef CONFIG_ACPI_PRMT capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_PRM_SUPPORT ; +#endif What about using if (
IS_ENABLED()) instead of #ifdef?
Quoted 1 line
aha, sorry, using if (
IS_ENABLED()) is better, will come up with a new version soon.
No need (see my other reply).
Thanks!
Re: [PATCH 2/2] ACPI: let BIOS fall back to legacy handling if PRM disabled
Quoted 29 lines · Rafael J. Wysocki
Quoted 28 lines · Aubrey Li
Quoted 25 lines · Rafael J. Wysocki
Quoted 16 lines · Aubrey Li
Based on
_OSCPRM bit, BIOS can choose switch from legacy handling to using PRM. So ifCONFIG_ACPI_PRMTis disabled, this bit should not be set to let BIOS fall back to the legacy handling (such as SMI).Cc Dan Williams <[email protected]>Signed-off-by Aubrey Li <[email protected]>--- drivers/acpi/bus.c | 2 ++ 1 file changed, 2 insertions(+)drivers/acpi/bus.c +0
-0drivers/acpi/bus.c static void acpi_bus_osc_negotiate_platform_control(void) · line 308
Quoted 6 lines
drivers/acpi/bus.c +2
-0@@ -303,7 +303,9 @@ static void acpi_bus_osc_negotiate_platform_control(void) capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_HOTPLUG_OST_SUPPORT ; capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_PCLPI_SUPPORT ; +#ifdef CONFIG_ACPI_PRMT capbuf[OSC_SUPPORT_DWORD ] |=OSC_SB_PRM_SUPPORT ; +#endif What about using if (
IS_ENABLED()) instead of #ifdef?
Quoted 6 lines
Quoted 1 line
aha, sorry, using if (
IS_ENABLED()) is better, will come up with a new version soon.No need (see my other reply).
Thanks!
Okay, thanks Rafael!
Quoted 18 lines · Aubrey Li
Accord to Platform Runtime Mechanism Specification v1.0 [1], Page 42,
_OSCbit (BIT 21) is used to indicate OS support of platform runtime mechanism..Cc Dan Williams <[email protected]>Signed-off-by Aubrey Li <[email protected]>--- include/linux/acpi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)include/linux/acpi.h +0
-0
include/linux/acpi.h acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);
Quoted 10 lines
include/linux/acpi.h +1
-2@@ -551,8 +551,8 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);#define OSC_SB_OSLPI_SUPPORT 0x00000100#define OSC_SB_CPC_DIVERSE_HIGH_SUPPORT 0x00001000#define OSC_SB_GENERIC_INITIATOR_SUPPORT 0x00002000 -#define OSC_SB_PRM_SUPPORT 0x00020000#define OSC_SB_NATIVE_USB4_SUPPORT 0x00040000 +#define OSC_SB_PRM_SUPPORT 0x00200000extern bool osc_sb_apei_support_acked;extern bool osc_pc_lpi_support_confirmed; --
Applied as 5.14-rc1 material, thanks!