All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ACPI: bus: Fix osc_sb_cppc_not_supported check
@ 2022-06-24 11:59 Perry Yuan
  2022-06-24 16:11 ` Rafael J. Wysocki
  0 siblings, 1 reply; 3+ messages in thread
From: Perry Yuan @ 2022-06-24 11:59 UTC (permalink / raw)
  To: Ray.Huang, Mario.Limonciello, Rafael J. Wysocki, Len Brown,
	Huang Rui, Mika Westerberg, linux-acpi, linux-kernel
  Cc: Nathan.Fontenot, Jinzhou.Su, Xinmei.Huang, Xiaojian.Du, Li.Meng,
	linux-pm, 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")
Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
---
 drivers/acpi/bus.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index 4d7c51a33b01..9731e4a1e338 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -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
 
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] ACPI: bus: Fix osc_sb_cppc_not_supported check
  2022-06-24 11:59 [PATCH] ACPI: bus: Fix osc_sb_cppc_not_supported check Perry Yuan
@ 2022-06-24 16:11 ` Rafael J. Wysocki
  2022-06-24 17:56   ` Yuan, Perry
  0 siblings, 1 reply; 3+ messages in thread
From: Rafael J. Wysocki @ 2022-06-24 16:11 UTC (permalink / raw)
  To: Perry Yuan
  Cc: Huang Rui, Mario Limonciello, Rafael J. Wysocki, Len Brown,
	Mika Westerberg, ACPI Devel Maling List,
	Linux Kernel Mailing List, Nathan Fontenot, Su, Jinzhou (Joe),
	Xinmei.Huang, Du, Xiaojian, Meng, Li (Jassmine),
	Linux PM

On Fri, Jun 24, 2022 at 2:00 PM Perry Yuan <Perry.Yuan@amd.com> wrote:
>
> 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")
> Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
> ---
>  drivers/acpi/bus.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
> index 4d7c51a33b01..9731e4a1e338 100644
> --- a/drivers/acpi/bus.c
> +++ b/drivers/acpi/bus.c
> @@ -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.

>  #endif
>
> --
> 2.25.1
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* RE: [PATCH] ACPI: bus: Fix osc_sb_cppc_not_supported check
  2022-06-24 16:11 ` Rafael J. Wysocki
@ 2022-06-24 17:56   ` Yuan, Perry
  0 siblings, 0 replies; 3+ messages in thread
From: Yuan, Perry @ 2022-06-24 17:56 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Huang, Ray, Limonciello, Mario, Len Brown, Mika Westerberg,
	ACPI Devel Maling List, Linux Kernel Mailing List, Fontenot,
	Nathan, Su, Jinzhou (Joe),
	Huang, Shimmer, Du, Xiaojian, Meng, Li (Jassmine),
	Linux PM

[AMD Official Use Only - General]

Hi Rafael:

> -----Original Message-----
> From: Rafael J. Wysocki <rafael@kernel.org>
> Sent: Saturday, June 25, 2022 12:12 AM
> To: Yuan, Perry <Perry.Yuan@amd.com>
> Cc: Huang, Ray <Ray.Huang@amd.com>; Limonciello, Mario
> <Mario.Limonciello@amd.com>; Rafael J. Wysocki <rafael@kernel.org>; Len
> Brown <lenb@kernel.org>; Mika Westerberg
> <mika.westerberg@linux.intel.com>; ACPI Devel Maling List <linux-
> acpi@vger.kernel.org>; Linux Kernel Mailing List <linux-kernel@vger.kernel.org>;
> Fontenot, Nathan <Nathan.Fontenot@amd.com>; Su, Jinzhou (Joe)
> <Jinzhou.Su@amd.com>; Huang, Shimmer <Xinmei.Huang@amd.com>; Du,
> Xiaojian <Xiaojian.Du@amd.com>; Meng, Li (Jassmine) <Li.Meng@amd.com>;
> Linux PM <linux-pm@vger.kernel.org>
> Subject: Re: [PATCH] ACPI: bus: Fix osc_sb_cppc_not_supported check
> 
> [CAUTION: External Email]
> 
> On Fri, Jun 24, 2022 at 2:00 PM Perry Yuan <Perry.Yuan@amd.com> wrote:
> >
> > 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")
> > Signed-off-by: Perry Yuan <Perry.Yuan@amd.com>
> > ---
> >  drivers/acpi/bus.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index
> > 4d7c51a33b01..9731e4a1e338 100644
> > --- a/drivers/acpi/bus.c
> > +++ b/drivers/acpi/bus.c
> > @@ -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.
> 
> >  #endif

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

Perry  

> >
> > --
> > 2.25.1
> >

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-06-24 17:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-24 11:59 [PATCH] ACPI: bus: Fix osc_sb_cppc_not_supported check Perry Yuan
2022-06-24 16:11 ` Rafael J. Wysocki
2022-06-24 17:56   ` Yuan, Perry

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.