diff mbox series

[1/2] ACPI: Correct \_SB._OSC bit definition for PRM

Message ID 1625209430-19934-1-git-send-email-aubrey.li@intel.com
State Accepted
Commit bd7a94c0fa41dfbea8564556c7a28b05e353c5da
Headers show
Series [1/2] ACPI: Correct \_SB._OSC bit definition for PRM | expand

Commit Message

Aubrey Li July 2, 2021, 7:03 a.m. UTC
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..

[1]: https://uefi.org/sites/default/files/resources/Platform%20Runtime%20Mechanism%20-%20with%20legal%20notice.pdf

Cc: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
---
 include/linux/acpi.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Rafael J. Wysocki July 2, 2021, 11:37 a.m. UTC | #1
On Fri, Jul 2, 2021 at 9:03 AM Aubrey Li <aubrey.li@intel.com> wrote:
>
> 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).
>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
> ---
>  drivers/acpi/bus.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
> index 60fb6a84..30a3d4a 100644
> --- a/drivers/acpi/bus.c
> +++ b/drivers/acpi/bus.c
> @@ -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?

>
>  #ifdef CONFIG_ARM64
>         capbuf[OSC_SUPPORT_DWORD] |= OSC_SB_GENERIC_INITIATOR_SUPPORT;
> --
> 2.7.4
>
Rafael J. Wysocki July 2, 2021, 2:02 p.m. UTC | #2
On Fri, Jul 2, 2021 at 1:37 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Fri, Jul 2, 2021 at 9:03 AM Aubrey Li <aubrey.li@intel.com> wrote:
> >
> > 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).
> >
> > Cc: Dan Williams <dan.j.williams@intel.com>
> > Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
> > ---
> >  drivers/acpi/bus.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
> > index 60fb6a84..30a3d4a 100644
> > --- a/drivers/acpi/bus.c
> > +++ b/drivers/acpi/bus.c
> > @@ -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?

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!
Rafael J. Wysocki July 2, 2021, 2:02 p.m. UTC | #3
On Fri, Jul 2, 2021 at 4:02 PM Aubrey Li <aubrey.li@linux.intel.com> wrote:
>
> On 7/2/21 7:37 PM, Rafael J. Wysocki wrote:
> > On Fri, Jul 2, 2021 at 9:03 AM Aubrey Li <aubrey.li@intel.com> wrote:
> >>
> >> 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).
> >>
> >> Cc: Dan Williams <dan.j.williams@intel.com>
> >> Signed-off-by: Aubrey Li <aubrey.li@linux.intel.com>
> >> ---
> >>  drivers/acpi/bus.c | 2 ++
> >>  1 file changed, 2 insertions(+)
> >>
> >> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
> >> index 60fb6a84..30a3d4a 100644
> >> --- a/drivers/acpi/bus.c
> >> +++ b/drivers/acpi/bus.c
> >> @@ -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?
>
> aha, sorry, using if (IS_ENABLED()) is better, will come up with a new version soon.

No need (see my other reply).

Thanks!
diff mbox series

Patch

diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index b338613..4df6a81 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -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			0x00200000
 
 extern bool osc_sb_apei_support_acked;
 extern bool osc_pc_lpi_support_confirmed;