* [PATCH] intel_idle: Add Comet Lake support
@ 2020-02-26 17:34 Harry Pan
2020-02-26 21:47 ` Rafael J. Wysocki
2020-03-03 9:09 ` [PATCH v3] " Harry Pan
0 siblings, 2 replies; 11+ messages in thread
From: Harry Pan @ 2020-02-26 17:34 UTC (permalink / raw)
To: LKML; +Cc: gs0622, Harry Pan, Jacob Pan, Len Brown, linux-pm
Add Comet Lake ID to enable intel_idle driver support.
This is required for PC10 and S0ix.
Signed-off-by: Harry Pan <harry.pan@intel.com>
---
drivers/idle/intel_idle.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index 347b08b56042..3cf292b2b7f1 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1086,6 +1086,8 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
INTEL_CPU_FAM6(KABYLAKE_L, idle_cpu_skl),
INTEL_CPU_FAM6(KABYLAKE, idle_cpu_skl),
INTEL_CPU_FAM6(SKYLAKE_X, idle_cpu_skx),
+ INTEL_CPU_FAM6(COMETLAKE_L, idle_cpu_skl),
+ INTEL_CPU_FAM6(COMETLAKE, idle_cpu_skl),
INTEL_CPU_FAM6(XEON_PHI_KNL, idle_cpu_knl),
INTEL_CPU_FAM6(XEON_PHI_KNM, idle_cpu_knl),
INTEL_CPU_FAM6(ATOM_GOLDMONT, idle_cpu_bxt),
--
2.24.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] intel_idle: Add Comet Lake support
2020-02-26 17:34 [PATCH] intel_idle: Add Comet Lake support Harry Pan
@ 2020-02-26 21:47 ` Rafael J. Wysocki
2020-02-27 10:56 ` Rafael J. Wysocki
2020-03-03 9:09 ` [PATCH v3] " Harry Pan
1 sibling, 1 reply; 11+ messages in thread
From: Rafael J. Wysocki @ 2020-02-26 21:47 UTC (permalink / raw)
To: Harry Pan; +Cc: LKML, Harry Pan, Jacob Pan, Len Brown, Linux PM
On Wed, Feb 26, 2020 at 6:34 PM Harry Pan <harry.pan@intel.com> wrote:
>
> Add Comet Lake ID to enable intel_idle driver support.
> This is required for PC10 and S0ix.
That shouldn't be the case for Linux 5.6-rc as long as the ACPI tables
expose C10 in _CST, so have you checked that?
> Signed-off-by: Harry Pan <harry.pan@intel.com>
>
> ---
>
> drivers/idle/intel_idle.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
> index 347b08b56042..3cf292b2b7f1 100644
> --- a/drivers/idle/intel_idle.c
> +++ b/drivers/idle/intel_idle.c
> @@ -1086,6 +1086,8 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
> INTEL_CPU_FAM6(KABYLAKE_L, idle_cpu_skl),
> INTEL_CPU_FAM6(KABYLAKE, idle_cpu_skl),
> INTEL_CPU_FAM6(SKYLAKE_X, idle_cpu_skx),
> + INTEL_CPU_FAM6(COMETLAKE_L, idle_cpu_skl),
> + INTEL_CPU_FAM6(COMETLAKE, idle_cpu_skl),
> INTEL_CPU_FAM6(XEON_PHI_KNL, idle_cpu_knl),
> INTEL_CPU_FAM6(XEON_PHI_KNM, idle_cpu_knl),
> INTEL_CPU_FAM6(ATOM_GOLDMONT, idle_cpu_bxt),
> --
> 2.24.1
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] intel_idle: Add Comet Lake support
2020-02-26 21:47 ` Rafael J. Wysocki
@ 2020-02-27 10:56 ` Rafael J. Wysocki
0 siblings, 0 replies; 11+ messages in thread
From: Rafael J. Wysocki @ 2020-02-27 10:56 UTC (permalink / raw)
To: Harry Pan; +Cc: LKML, Harry Pan, Jacob Pan, Len Brown, Linux PM
On Wed, Feb 26, 2020 at 10:47 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Wed, Feb 26, 2020 at 6:34 PM Harry Pan <harry.pan@intel.com> wrote:
> >
> > Add Comet Lake ID to enable intel_idle driver support.
> > This is required for PC10 and S0ix.
>
> That shouldn't be the case for Linux 5.6-rc as long as the ACPI tables
> expose C10 in _CST, so have you checked that?
Regardless of that (which only is about the changelog), I wouldn't
just use idle_cpu_skl directly for CML like in the patch below.
Instead, I'd define something like
static const struct idle_cpu idle_cpu_cml __initconst = {
.state_table = skl_cstates,
.disable_promotion_to_c1e = true,
.use_acpi = true,
};
and point to it from the CML entries in intel_idle_ids[].
That would allow the driver to avoid enabling the C-states that are
not exposed in the ACPI tables by default which generally is safer
than exposing all of them for all CML platforms unconditionally.
> > Signed-off-by: Harry Pan <harry.pan@intel.com>
> >
> > ---
> >
> > drivers/idle/intel_idle.c | 2 ++
> > 1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
> > index 347b08b56042..3cf292b2b7f1 100644
> > --- a/drivers/idle/intel_idle.c
> > +++ b/drivers/idle/intel_idle.c
> > @@ -1086,6 +1086,8 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
> > INTEL_CPU_FAM6(KABYLAKE_L, idle_cpu_skl),
> > INTEL_CPU_FAM6(KABYLAKE, idle_cpu_skl),
> > INTEL_CPU_FAM6(SKYLAKE_X, idle_cpu_skx),
> > + INTEL_CPU_FAM6(COMETLAKE_L, idle_cpu_skl),
> > + INTEL_CPU_FAM6(COMETLAKE, idle_cpu_skl),
+ INTEL_CPU_FAM6(COMETLAKE_L, idle_cpu_cml),
+ INTEL_CPU_FAM6(COMETLAKE, idle_cpu_cml),
> > INTEL_CPU_FAM6(XEON_PHI_KNL, idle_cpu_knl),
> > INTEL_CPU_FAM6(XEON_PHI_KNM, idle_cpu_knl),
> > INTEL_CPU_FAM6(ATOM_GOLDMONT, idle_cpu_bxt),
> > --
> > 2.24.1
> >
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v3] intel_idle: Add Comet Lake support
2020-02-26 17:34 [PATCH] intel_idle: Add Comet Lake support Harry Pan
2020-02-26 21:47 ` Rafael J. Wysocki
@ 2020-03-03 9:09 ` Harry Pan
2020-03-04 9:53 ` Rafael J. Wysocki
2020-03-04 11:43 ` [PATCH v4] " Harry Pan
1 sibling, 2 replies; 11+ messages in thread
From: Harry Pan @ 2020-03-03 9:09 UTC (permalink / raw)
To: LKML; +Cc: gs0622, Harry Pan, Jacob Pan, Len Brown, linux-pm
Add a general C-state table in order to support Comet Lake.
Signed-off-by: Harry Pan <harry.pan@intel.com>
---
drivers/idle/intel_idle.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index d55606608ac8..05bce595fafe 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1067,6 +1067,11 @@ static const struct idle_cpu idle_cpu_dnv = {
.use_acpi = true,
};
+static const struct idle_cpu idle_cpu_cml = {
+ .state_table = skl_cstates,
+ .disable_promotion_to_c1e = true,
+};
+
static const struct x86_cpu_id intel_idle_ids[] __initconst = {
INTEL_CPU_FAM6(NEHALEM_EP, idle_cpu_nhx),
INTEL_CPU_FAM6(NEHALEM, idle_cpu_nehalem),
@@ -1105,6 +1110,8 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
INTEL_CPU_FAM6(ATOM_GOLDMONT_PLUS, idle_cpu_bxt),
INTEL_CPU_FAM6(ATOM_GOLDMONT_D, idle_cpu_dnv),
INTEL_CPU_FAM6(ATOM_TREMONT_D, idle_cpu_dnv),
+ INTEL_CPU_FAM6(COMETLAKE_L, idle_cpu_cml),
+ INTEL_CPU_FAM6(COMETLAKE, idle_cpu_cml),
{}
};
--
2.24.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v3] intel_idle: Add Comet Lake support
2020-03-03 9:09 ` [PATCH v3] " Harry Pan
@ 2020-03-04 9:53 ` Rafael J. Wysocki
2020-03-04 11:57 ` Pan, Harry
2020-03-04 11:43 ` [PATCH v4] " Harry Pan
1 sibling, 1 reply; 11+ messages in thread
From: Rafael J. Wysocki @ 2020-03-04 9:53 UTC (permalink / raw)
To: Harry Pan; +Cc: LKML, Harry Pan, Jacob Pan, Len Brown, Linux PM
On Tue, Mar 3, 2020 at 10:10 AM Harry Pan <harry.pan@intel.com> wrote:
>
> Add a general C-state table in order to support Comet Lake.
>
> Signed-off-by: Harry Pan <harry.pan@intel.com>
>
> ---
>
> drivers/idle/intel_idle.c | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
> index d55606608ac8..05bce595fafe 100644
> --- a/drivers/idle/intel_idle.c
> +++ b/drivers/idle/intel_idle.c
> @@ -1067,6 +1067,11 @@ static const struct idle_cpu idle_cpu_dnv = {
> .use_acpi = true,
> };
>
> +static const struct idle_cpu idle_cpu_cml = {
> + .state_table = skl_cstates,
> + .disable_promotion_to_c1e = true,
.use_acpi = true,
missing? Otherwise you can just use idle_cpu_skl as is, can't you?
> +};
> +
> static const struct x86_cpu_id intel_idle_ids[] __initconst = {
> INTEL_CPU_FAM6(NEHALEM_EP, idle_cpu_nhx),
> INTEL_CPU_FAM6(NEHALEM, idle_cpu_nehalem),
> @@ -1105,6 +1110,8 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
> INTEL_CPU_FAM6(ATOM_GOLDMONT_PLUS, idle_cpu_bxt),
> INTEL_CPU_FAM6(ATOM_GOLDMONT_D, idle_cpu_dnv),
> INTEL_CPU_FAM6(ATOM_TREMONT_D, idle_cpu_dnv),
> + INTEL_CPU_FAM6(COMETLAKE_L, idle_cpu_cml),
> + INTEL_CPU_FAM6(COMETLAKE, idle_cpu_cml),
> {}
> };
>
> --
> 2.24.1
>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v4] intel_idle: Add Comet Lake support
2020-03-03 9:09 ` [PATCH v3] " Harry Pan
2020-03-04 9:53 ` Rafael J. Wysocki
@ 2020-03-04 11:43 ` Harry Pan
2020-03-12 9:25 ` [PATCH v5] " Harry Pan
1 sibling, 1 reply; 11+ messages in thread
From: Harry Pan @ 2020-03-04 11:43 UTC (permalink / raw)
To: LKML; +Cc: gs0622, Harry Pan, Jacob Pan, Len Brown, linux-pm
Add a general C-state table in order to support Comet Lake.
Signed-off-by: Harry Pan <harry.pan@intel.com>
---
drivers/idle/intel_idle.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index d55606608ac8..d838143f1422 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1105,6 +1105,8 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
INTEL_CPU_FAM6(ATOM_GOLDMONT_PLUS, idle_cpu_bxt),
INTEL_CPU_FAM6(ATOM_GOLDMONT_D, idle_cpu_dnv),
INTEL_CPU_FAM6(ATOM_TREMONT_D, idle_cpu_dnv),
+ INTEL_CPU_FAM6(COMETLAKE_L, idle_cpu_skl),
+ INTEL_CPU_FAM6(COMETLAKE, idle_cpu_skl),
{}
};
--
2.24.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v3] intel_idle: Add Comet Lake support
2020-03-04 9:53 ` Rafael J. Wysocki
@ 2020-03-04 11:57 ` Pan, Harry
2020-03-04 21:14 ` Rafael J. Wysocki
0 siblings, 1 reply; 11+ messages in thread
From: Pan, Harry @ 2020-03-04 11:57 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: LKML, Harry Pan, Jacob Pan, Len Brown, Linux PM
Hi Rafael,
Yes, I skipped it considering to align CML-U V0 and A0 stepping w/ the same table; I sent v4 for your review.
In the other hand, I am proposing using _CST as long term plan in CrOS dev teams.
Sincerely,
Harry
> On Mar 4, 2020, at 17:53, Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Tue, Mar 3, 2020 at 10:10 AM Harry Pan <harry.pan@intel.com> wrote:
>>
>> Add a general C-state table in order to support Comet Lake.
>>
>> Signed-off-by: Harry Pan <harry.pan@intel.com>
>>
>> ---
>>
>> drivers/idle/intel_idle.c | 7 +++++++
>> 1 file changed, 7 insertions(+)
>>
>> diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
>> index d55606608ac8..05bce595fafe 100644
>> --- a/drivers/idle/intel_idle.c
>> +++ b/drivers/idle/intel_idle.c
>> @@ -1067,6 +1067,11 @@ static const struct idle_cpu idle_cpu_dnv = {
>> .use_acpi = true,
>> };
>>
>> +static const struct idle_cpu idle_cpu_cml = {
>> + .state_table = skl_cstates,
>> + .disable_promotion_to_c1e = true,
>
> .use_acpi = true,
>
> missing? Otherwise you can just use idle_cpu_skl as is, can't you?
>
>> +};
>> +
>> static const struct x86_cpu_id intel_idle_ids[] __initconst = {
>> INTEL_CPU_FAM6(NEHALEM_EP, idle_cpu_nhx),
>> INTEL_CPU_FAM6(NEHALEM, idle_cpu_nehalem),
>> @@ -1105,6 +1110,8 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
>> INTEL_CPU_FAM6(ATOM_GOLDMONT_PLUS, idle_cpu_bxt),
>> INTEL_CPU_FAM6(ATOM_GOLDMONT_D, idle_cpu_dnv),
>> INTEL_CPU_FAM6(ATOM_TREMONT_D, idle_cpu_dnv),
>> + INTEL_CPU_FAM6(COMETLAKE_L, idle_cpu_cml),
>> + INTEL_CPU_FAM6(COMETLAKE, idle_cpu_cml),
>> {}
>> };
>>
>> --
>> 2.24.1
>>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3] intel_idle: Add Comet Lake support
2020-03-04 11:57 ` Pan, Harry
@ 2020-03-04 21:14 ` Rafael J. Wysocki
2020-03-09 9:02 ` Pan, Harry
0 siblings, 1 reply; 11+ messages in thread
From: Rafael J. Wysocki @ 2020-03-04 21:14 UTC (permalink / raw)
To: Pan, Harry
Cc: Rafael J. Wysocki, LKML, Harry Pan, Jacob Pan, Len Brown, Linux PM
On Wed, Mar 4, 2020 at 12:57 PM Pan, Harry <harry.pan@intel.com> wrote:
>
> Hi Rafael,
>
> Yes, I skipped it considering to align CML-U V0 and A0 stepping w/ the same table; I sent v4 for your review.
Skipping that flag is risky, because it may cause some C-states to be
enabled on systems where they have not been validated (e.g. systems
shipping with other OSes which only use _CST C-states). There were
problems related to that in the past which is one of the reasons for
adding _CST support to intel_idle. use_acpi should be set for all new
platforms going forward as a rule.
> In the other hand, I am proposing using _CST as long term plan in CrOS dev teams.
That I obviously agree with. :-)
> > On Mar 4, 2020, at 17:53, Rafael J. Wysocki <rafael@kernel.org> wrote:
> >
> > On Tue, Mar 3, 2020 at 10:10 AM Harry Pan <harry.pan@intel.com> wrote:
> >>
> >> Add a general C-state table in order to support Comet Lake.
> >>
> >> Signed-off-by: Harry Pan <harry.pan@intel.com>
> >>
> >> ---
> >>
> >> drivers/idle/intel_idle.c | 7 +++++++
> >> 1 file changed, 7 insertions(+)
> >>
> >> diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
> >> index d55606608ac8..05bce595fafe 100644
> >> --- a/drivers/idle/intel_idle.c
> >> +++ b/drivers/idle/intel_idle.c
> >> @@ -1067,6 +1067,11 @@ static const struct idle_cpu idle_cpu_dnv = {
> >> .use_acpi = true,
> >> };
> >>
> >> +static const struct idle_cpu idle_cpu_cml = {
> >> + .state_table = skl_cstates,
> >> + .disable_promotion_to_c1e = true,
> >
> > .use_acpi = true,
> >
> > missing? Otherwise you can just use idle_cpu_skl as is, can't you?
> >
> >> +};
> >> +
> >> static const struct x86_cpu_id intel_idle_ids[] __initconst = {
> >> INTEL_CPU_FAM6(NEHALEM_EP, idle_cpu_nhx),
> >> INTEL_CPU_FAM6(NEHALEM, idle_cpu_nehalem),
> >> @@ -1105,6 +1110,8 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
> >> INTEL_CPU_FAM6(ATOM_GOLDMONT_PLUS, idle_cpu_bxt),
> >> INTEL_CPU_FAM6(ATOM_GOLDMONT_D, idle_cpu_dnv),
> >> INTEL_CPU_FAM6(ATOM_TREMONT_D, idle_cpu_dnv),
> >> + INTEL_CPU_FAM6(COMETLAKE_L, idle_cpu_cml),
> >> + INTEL_CPU_FAM6(COMETLAKE, idle_cpu_cml),
> >> {}
> >> };
> >>
> >> --
> >> 2.24.1
> >>
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [PATCH v3] intel_idle: Add Comet Lake support
2020-03-04 21:14 ` Rafael J. Wysocki
@ 2020-03-09 9:02 ` Pan, Harry
2020-03-10 8:37 ` Rafael J. Wysocki
0 siblings, 1 reply; 11+ messages in thread
From: Pan, Harry @ 2020-03-09 9:02 UTC (permalink / raw)
To: Rafael J. Wysocki; +Cc: LKML, Harry Pan, Jacob Pan, Len Brown, Linux PM
Hi Rafael,
Thanks for the comments.
I have some questions, I am wondering if you can share upstream thought w.r.t the future development of intel_idle.
- It looks to me since v5.6 intel_idle will prefer _CST of ACPI rather than the general table embedded in this driver.
- Any pros and cons of using the tables of _CST in firmware and embedded one in the kernel?
- Can the table in _CST archive more optimal idle states management?
If there is already any reference, documents I missed, kindly enlighten me then I would like to read it first before refining the questions.
Thanks and take care,
Harry
________________________________________
從: Rafael J. Wysocki [rafael@kernel.org]
寄件日期: 2020年3月5日 上午 05:14
至: Pan, Harry
副本: Rafael J. Wysocki; LKML; Harry Pan; Jacob Pan; Len Brown; Linux PM
主旨: Re: [PATCH v3] intel_idle: Add Comet Lake support
On Wed, Mar 4, 2020 at 12:57 PM Pan, Harry <harry.pan@intel.com> wrote:
>
> Hi Rafael,
>
> Yes, I skipped it considering to align CML-U V0 and A0 stepping w/ the same table; I sent v4 for your review.
Skipping that flag is risky, because it may cause some C-states to be
enabled on systems where they have not been validated (e.g. systems
shipping with other OSes which only use _CST C-states). There were
problems related to that in the past which is one of the reasons for
adding _CST support to intel_idle. use_acpi should be set for all new
platforms going forward as a rule.
> In the other hand, I am proposing using _CST as long term plan in CrOS dev teams.
That I obviously agree with. :-)
> > On Mar 4, 2020, at 17:53, Rafael J. Wysocki <rafael@kernel.org> wrote:
> >
> > On Tue, Mar 3, 2020 at 10:10 AM Harry Pan <harry.pan@intel.com> wrote:
> >>
> >> Add a general C-state table in order to support Comet Lake.
> >>
> >> Signed-off-by: Harry Pan <harry.pan@intel.com>
> >>
> >> ---
> >>
> >> drivers/idle/intel_idle.c | 7 +++++++
> >> 1 file changed, 7 insertions(+)
> >>
> >> diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
> >> index d55606608ac8..05bce595fafe 100644
> >> --- a/drivers/idle/intel_idle.c
> >> +++ b/drivers/idle/intel_idle.c
> >> @@ -1067,6 +1067,11 @@ static const struct idle_cpu idle_cpu_dnv = {
> >> .use_acpi = true,
> >> };
> >>
> >> +static const struct idle_cpu idle_cpu_cml = {
> >> + .state_table = skl_cstates,
> >> + .disable_promotion_to_c1e = true,
> >
> > .use_acpi = true,
> >
> > missing? Otherwise you can just use idle_cpu_skl as is, can't you?
> >
> >> +};
> >> +
> >> static const struct x86_cpu_id intel_idle_ids[] __initconst = {
> >> INTEL_CPU_FAM6(NEHALEM_EP, idle_cpu_nhx),
> >> INTEL_CPU_FAM6(NEHALEM, idle_cpu_nehalem),
> >> @@ -1105,6 +1110,8 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
> >> INTEL_CPU_FAM6(ATOM_GOLDMONT_PLUS, idle_cpu_bxt),
> >> INTEL_CPU_FAM6(ATOM_GOLDMONT_D, idle_cpu_dnv),
> >> INTEL_CPU_FAM6(ATOM_TREMONT_D, idle_cpu_dnv),
> >> + INTEL_CPU_FAM6(COMETLAKE_L, idle_cpu_cml),
> >> + INTEL_CPU_FAM6(COMETLAKE, idle_cpu_cml),
> >> {}
> >> };
> >>
> >> --
> >> 2.24.1
> >>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v3] intel_idle: Add Comet Lake support
2020-03-09 9:02 ` Pan, Harry
@ 2020-03-10 8:37 ` Rafael J. Wysocki
0 siblings, 0 replies; 11+ messages in thread
From: Rafael J. Wysocki @ 2020-03-10 8:37 UTC (permalink / raw)
To: Pan, Harry
Cc: Rafael J. Wysocki, LKML, Harry Pan, Jacob Pan, Len Brown, Linux PM
On Mon, Mar 9, 2020 at 10:07 AM Pan, Harry <harry.pan@intel.com> wrote:
>
> Hi Rafael,
>
> Thanks for the comments.
> I have some questions, I am wondering if you can share upstream thought w.r.t the future development of intel_idle.
>
> - It looks to me since v5.6 intel_idle will prefer _CST of ACPI rather than the general table embedded in this driver.
Not exactly.
The rules are as follows:
* If there is a built-in table for the given processor in the driver,
it will be used, but the C-states that are not exposed in _CST will be
disabled by default (the state parameters come from the built-in table
for all C-states).
* Otherwise (i.e. the driver does not recognized the given
processor), C-state definitions will be based on the _CST data.
See https://www.kernel.org/doc/html/latest/admin-guide/pm/intel_idle.html
for details.
> - Any pros and cons of using the tables of _CST in firmware and embedded one in the kernel?
Both can be used at the same time (see above).
The built-in table in the kernel must be suitable for all of the
platforms shipped with the given processor (SoC).
Obviously, the _CST table allows intel_idle to work if the processor
included in the platform is not recognized by it.
Generally, our planned strategy is to provide built-in C-state tables
for all new "mainstream" processors with the use_acpi flag set to
avoid enabling C-states that may have not been validated on a given
platform by default.
> - Can the table in _CST archive more optimal idle states management?
Possibly, but not likely.
> If there is already any reference, documents I missed, kindly enlighten me then I would like to read it first before refining the questions.
See above. :-)
Thanks!
___________________________________
> 從: Rafael J. Wysocki [rafael@kernel.org]
> 寄件日期: 2020年3月5日 上午 05:14
> 至: Pan, Harry
> 副本: Rafael J. Wysocki; LKML; Harry Pan; Jacob Pan; Len Brown; Linux PM
> 主旨: Re: [PATCH v3] intel_idle: Add Comet Lake support
>
> On Wed, Mar 4, 2020 at 12:57 PM Pan, Harry <harry.pan@intel.com> wrote:
> >
> > Hi Rafael,
> >
> > Yes, I skipped it considering to align CML-U V0 and A0 stepping w/ the same table; I sent v4 for your review.
>
> Skipping that flag is risky, because it may cause some C-states to be
> enabled on systems where they have not been validated (e.g. systems
> shipping with other OSes which only use _CST C-states). There were
> problems related to that in the past which is one of the reasons for
> adding _CST support to intel_idle. use_acpi should be set for all new
> platforms going forward as a rule.
>
> > In the other hand, I am proposing using _CST as long term plan in CrOS dev teams.
>
> That I obviously agree with. :-)
>
>
> > > On Mar 4, 2020, at 17:53, Rafael J. Wysocki <rafael@kernel.org> wrote:
> > >
> > > On Tue, Mar 3, 2020 at 10:10 AM Harry Pan <harry.pan@intel.com> wrote:
> > >>
> > >> Add a general C-state table in order to support Comet Lake.
> > >>
> > >> Signed-off-by: Harry Pan <harry.pan@intel.com>
> > >>
> > >> ---
> > >>
> > >> drivers/idle/intel_idle.c | 7 +++++++
> > >> 1 file changed, 7 insertions(+)
> > >>
> > >> diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
> > >> index d55606608ac8..05bce595fafe 100644
> > >> --- a/drivers/idle/intel_idle.c
> > >> +++ b/drivers/idle/intel_idle.c
> > >> @@ -1067,6 +1067,11 @@ static const struct idle_cpu idle_cpu_dnv = {
> > >> .use_acpi = true,
> > >> };
> > >>
> > >> +static const struct idle_cpu idle_cpu_cml = {
> > >> + .state_table = skl_cstates,
> > >> + .disable_promotion_to_c1e = true,
> > >
> > > .use_acpi = true,
> > >
> > > missing? Otherwise you can just use idle_cpu_skl as is, can't you?
> > >
> > >> +};
> > >> +
> > >> static const struct x86_cpu_id intel_idle_ids[] __initconst = {
> > >> INTEL_CPU_FAM6(NEHALEM_EP, idle_cpu_nhx),
> > >> INTEL_CPU_FAM6(NEHALEM, idle_cpu_nehalem),
> > >> @@ -1105,6 +1110,8 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
> > >> INTEL_CPU_FAM6(ATOM_GOLDMONT_PLUS, idle_cpu_bxt),
> > >> INTEL_CPU_FAM6(ATOM_GOLDMONT_D, idle_cpu_dnv),
> > >> INTEL_CPU_FAM6(ATOM_TREMONT_D, idle_cpu_dnv),
> > >> + INTEL_CPU_FAM6(COMETLAKE_L, idle_cpu_cml),
> > >> + INTEL_CPU_FAM6(COMETLAKE, idle_cpu_cml),
> > >> {}
> > >> };
> > >>
> > >> --
> > >> 2.24.1
> > >>
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH v5] intel_idle: Add Comet Lake support
2020-03-04 11:43 ` [PATCH v4] " Harry Pan
@ 2020-03-12 9:25 ` Harry Pan
0 siblings, 0 replies; 11+ messages in thread
From: Harry Pan @ 2020-03-12 9:25 UTC (permalink / raw)
To: LKML; +Cc: gs0622, Harry Pan, Jacob Pan, Len Brown, linux-pm
Add built-in idle states table for Comet Lake.
This patch also respects the exposed ACPI _CST objects in platform firmware
to disable those non-matching C-state by default, defer its enabling to the
userspace through sysfs.
Summary:
- With built-in table and without _CST table, all C-states are enabled
- With both built-in and _CST tables, matching C-states are enabled
Signed-off-by: Harry Pan <harry.pan@intel.com>
---
drivers/idle/intel_idle.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/idle/intel_idle.c b/drivers/idle/intel_idle.c
index d55606608ac8..49b385c36eea 100644
--- a/drivers/idle/intel_idle.c
+++ b/drivers/idle/intel_idle.c
@@ -1067,6 +1067,12 @@ static const struct idle_cpu idle_cpu_dnv = {
.use_acpi = true,
};
+static const struct idle_cpu idle_cpu_cml = {
+ .state_table = skl_cstates,
+ .disable_promotion_to_c1e = true,
+ .use_acpi = true,
+};
+
static const struct x86_cpu_id intel_idle_ids[] __initconst = {
INTEL_CPU_FAM6(NEHALEM_EP, idle_cpu_nhx),
INTEL_CPU_FAM6(NEHALEM, idle_cpu_nehalem),
@@ -1105,6 +1111,8 @@ static const struct x86_cpu_id intel_idle_ids[] __initconst = {
INTEL_CPU_FAM6(ATOM_GOLDMONT_PLUS, idle_cpu_bxt),
INTEL_CPU_FAM6(ATOM_GOLDMONT_D, idle_cpu_dnv),
INTEL_CPU_FAM6(ATOM_TREMONT_D, idle_cpu_dnv),
+ INTEL_CPU_FAM6(COMETLAKE_L, idle_cpu_cml),
+ INTEL_CPU_FAM6(COMETLAKE, idle_cpu_cml),
{}
};
--
2.24.1
^ permalink raw reply related [flat|nested] 11+ messages in thread
end of thread, other threads:[~2020-03-12 9:25 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-26 17:34 [PATCH] intel_idle: Add Comet Lake support Harry Pan
2020-02-26 21:47 ` Rafael J. Wysocki
2020-02-27 10:56 ` Rafael J. Wysocki
2020-03-03 9:09 ` [PATCH v3] " Harry Pan
2020-03-04 9:53 ` Rafael J. Wysocki
2020-03-04 11:57 ` Pan, Harry
2020-03-04 21:14 ` Rafael J. Wysocki
2020-03-09 9:02 ` Pan, Harry
2020-03-10 8:37 ` Rafael J. Wysocki
2020-03-04 11:43 ` [PATCH v4] " Harry Pan
2020-03-12 9:25 ` [PATCH v5] " Harry Pan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).