* [PATCH v2 1/3] x86/cpu: Introduce INTEL_CPU_FAM*_NODATA() helper macros
@ 2019-01-09 16:57 Andy Shevchenko
2019-01-09 16:57 ` [PATCH v2 2/3] ACPI / LPSS: Get rid of custom ICPU() macro Andy Shevchenko
` (3 more replies)
0 siblings, 4 replies; 7+ messages in thread
From: Andy Shevchenko @ 2019-01-09 16:57 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86,
Rafael J. Wysocki, linux-acpi, linux-kernel
Cc: Andy Shevchenko
These macros are often used by the drivers and we have already a lot of
duplication as ICPU() macro across them.
Provide a generic x86 macro for users.
This adds no driver data variants.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
arch/x86/include/asm/intel-family.h | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/arch/x86/include/asm/intel-family.h b/arch/x86/include/asm/intel-family.h
index 25b28760fada..afd70055a750 100644
--- a/arch/x86/include/asm/intel-family.h
+++ b/arch/x86/include/asm/intel-family.h
@@ -86,10 +86,16 @@
.family = _family, \
.model = _model, \
.feature = X86_FEATURE_ANY, \
- .driver_data = (kernel_ulong_t)&_driver_data \
+ .driver_data = (kernel_ulong_t)_driver_data \
}
#define INTEL_CPU_FAM6(_model, _driver_data) \
- INTEL_CPU_FAM_ANY(6, INTEL_FAM6_##_model, _driver_data)
+ INTEL_CPU_FAM_ANY(6, INTEL_FAM6_##_model, &_driver_data)
+
+#define INTEL_CPU_FAM_ANY_NODATA(_family, _model) \
+ INTEL_CPU_FAM_ANY(_family, _model, 0)
+
+#define INTEL_CPU_FAM6_NODATA(_model) \
+ INTEL_CPU_FAM_ANY_NODATA(6, INTEL_FAM6_##_model)
#endif /* _ASM_X86_INTEL_FAMILY_H */
--
2.20.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/3] ACPI / LPSS: Get rid of custom ICPU() macro
2019-01-09 16:57 [PATCH v2 1/3] x86/cpu: Introduce INTEL_CPU_FAM*_NODATA() helper macros Andy Shevchenko
@ 2019-01-09 16:57 ` Andy Shevchenko
2019-01-14 11:08 ` Borislav Petkov
2019-01-09 16:57 ` [PATCH v2 3/3] ACPI / x86: utils: " Andy Shevchenko
` (2 subsequent siblings)
3 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2019-01-09 16:57 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86,
Rafael J. Wysocki, linux-acpi, linux-kernel
Cc: Andy Shevchenko, Rafael J . Wysocki
Replace custom grown macro with generic INTEL_CPU_FAM6_NODATA() one.
No functional change intended.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/acpi/acpi_lpss.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
index 5f94c35d165f..633a528bb6ea 100644
--- a/drivers/acpi/acpi_lpss.c
+++ b/drivers/acpi/acpi_lpss.c
@@ -311,11 +311,9 @@ static const struct lpss_device_desc bsw_spi_dev_desc = {
.setup = lpss_deassert_reset,
};
-#define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, }
-
static const struct x86_cpu_id lpss_cpu_ids[] = {
- ICPU(INTEL_FAM6_ATOM_SILVERMONT), /* Valleyview, Bay Trail */
- ICPU(INTEL_FAM6_ATOM_AIRMONT), /* Braswell, Cherry Trail */
+ INTEL_CPU_FAM6_NODATA(ATOM_SILVERMONT), /* Valleyview, Bay Trail */
+ INTEL_CPU_FAM6_NODATA(ATOM_AIRMONT), /* Braswell, Cherry Trail */
{}
};
--
2.20.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 3/3] ACPI / x86: utils: Get rid of custom ICPU() macro
2019-01-09 16:57 [PATCH v2 1/3] x86/cpu: Introduce INTEL_CPU_FAM*_NODATA() helper macros Andy Shevchenko
2019-01-09 16:57 ` [PATCH v2 2/3] ACPI / LPSS: Get rid of custom ICPU() macro Andy Shevchenko
@ 2019-01-09 16:57 ` Andy Shevchenko
2019-01-11 10:35 ` [PATCH v2 1/3] x86/cpu: Introduce INTEL_CPU_FAM*_NODATA() helper macros Rafael J. Wysocki
2019-01-14 11:08 ` Borislav Petkov
3 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2019-01-09 16:57 UTC (permalink / raw)
To: Thomas Gleixner, Ingo Molnar, Borislav Petkov, x86,
Rafael J. Wysocki, linux-acpi, linux-kernel
Cc: Andy Shevchenko, Rafael J . Wysocki
Replace custom grown macro with generic INTEL_CPU_FAM6_NODATA() one.
No functional change intended.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
---
drivers/acpi/x86/utils.c | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/drivers/acpi/x86/utils.c b/drivers/acpi/x86/utils.c
index 9a8e286dd86f..408131bcc1fa 100644
--- a/drivers/acpi/x86/utils.c
+++ b/drivers/acpi/x86/utils.c
@@ -40,8 +40,6 @@ struct always_present_id {
const char *uid;
};
-#define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, }
-
#define ENTRY(hid, uid, cpu_models, dmi...) { \
{ { hid, }, {} }, \
{ cpu_models, {} }, \
@@ -54,24 +52,24 @@ static const struct always_present_id always_present_ids[] = {
* Bay / Cherry Trail PWM directly poked by GPU driver in win10,
* but Linux uses a separate PWM driver, harmless if not used.
*/
- ENTRY("80860F09", "1", ICPU(INTEL_FAM6_ATOM_SILVERMONT), {}),
- ENTRY("80862288", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {}),
+ ENTRY("80860F09", "1", INTEL_CPU_FAM6_NODATA(ATOM_SILVERMONT), {}),
+ ENTRY("80862288", "1", INTEL_CPU_FAM6_NODATA(ATOM_AIRMONT), {}),
/*
* The INT0002 device is necessary to clear wakeup interrupt sources
* on Cherry Trail devices, without it we get nobody cared IRQ msgs.
*/
- ENTRY("INT0002", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {}),
+ ENTRY("INT0002", "1", INTEL_CPU_FAM6_NODATA(ATOM_AIRMONT), {}),
/*
* On the Dell Venue 11 Pro 7130 and 7139, the DSDT hides
* the touchscreen ACPI device until a certain time
* after _SB.PCI0.GFX0.LCD.LCD1._ON gets called has passed
* *and* _STA has been called at least 3 times since.
*/
- ENTRY("SYNA7500", "1", ICPU(INTEL_FAM6_HASWELL_ULT), {
+ ENTRY("SYNA7500", "1", INTEL_CPU_FAM6_NODATA(HASWELL_ULT), {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "Venue 11 Pro 7130"),
}),
- ENTRY("SYNA7500", "1", ICPU(INTEL_FAM6_HASWELL_ULT), {
+ ENTRY("SYNA7500", "1", INTEL_CPU_FAM6_NODATA(HASWELL_ULT), {
DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."),
DMI_MATCH(DMI_PRODUCT_NAME, "Venue 11 Pro 7139"),
}),
@@ -87,19 +85,19 @@ static const struct always_present_id always_present_ids[] = {
* was copy-pasted from the GPD win, so it has a disabled KIOX000A
* node which we should not enable, thus we also check the BIOS date.
*/
- ENTRY("KIOX000A", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {
+ ENTRY("KIOX000A", "1", INTEL_CPU_FAM6_NODATA(ATOM_AIRMONT), {
DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
DMI_MATCH(DMI_BOARD_NAME, "Default string"),
DMI_MATCH(DMI_PRODUCT_NAME, "Default string"),
DMI_MATCH(DMI_BIOS_DATE, "02/21/2017")
}),
- ENTRY("KIOX000A", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {
+ ENTRY("KIOX000A", "1", INTEL_CPU_FAM6_NODATA(ATOM_AIRMONT), {
DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
DMI_MATCH(DMI_BOARD_NAME, "Default string"),
DMI_MATCH(DMI_PRODUCT_NAME, "Default string"),
DMI_MATCH(DMI_BIOS_DATE, "03/20/2017")
}),
- ENTRY("KIOX000A", "1", ICPU(INTEL_FAM6_ATOM_AIRMONT), {
+ ENTRY("KIOX000A", "1", INTEL_CPU_FAM6_NODATA(ATOM_AIRMONT), {
DMI_MATCH(DMI_BOARD_VENDOR, "AMI Corporation"),
DMI_MATCH(DMI_BOARD_NAME, "Default string"),
DMI_MATCH(DMI_PRODUCT_NAME, "Default string"),
--
2.20.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/3] x86/cpu: Introduce INTEL_CPU_FAM*_NODATA() helper macros
2019-01-09 16:57 [PATCH v2 1/3] x86/cpu: Introduce INTEL_CPU_FAM*_NODATA() helper macros Andy Shevchenko
2019-01-09 16:57 ` [PATCH v2 2/3] ACPI / LPSS: Get rid of custom ICPU() macro Andy Shevchenko
2019-01-09 16:57 ` [PATCH v2 3/3] ACPI / x86: utils: " Andy Shevchenko
@ 2019-01-11 10:35 ` Rafael J. Wysocki
2019-01-11 13:29 ` Andy Shevchenko
2019-01-14 11:08 ` Borislav Petkov
3 siblings, 1 reply; 7+ messages in thread
From: Rafael J. Wysocki @ 2019-01-11 10:35 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Thomas Gleixner, Ingo Molnar, Borislav Petkov,
the arch/x86 maintainers, Rafael J. Wysocki,
ACPI Devel Maling List, Linux Kernel Mailing List
On Wed, Jan 9, 2019 at 5:57 PM Andy Shevchenko
<andriy.shevchenko@linux.intel.com> wrote:
>
> These macros are often used by the drivers and we have already a lot of
> duplication as ICPU() macro across them.
>
> Provide a generic x86 macro for users.
>
> This adds no driver data variants.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
If you want me to apply the series, I need an ACK for this one.
Alternatively, if you want to apply it yourself, please feel free to
add ACKs from me to the ACPI-related patches in it.
> ---
> arch/x86/include/asm/intel-family.h | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/include/asm/intel-family.h b/arch/x86/include/asm/intel-family.h
> index 25b28760fada..afd70055a750 100644
> --- a/arch/x86/include/asm/intel-family.h
> +++ b/arch/x86/include/asm/intel-family.h
> @@ -86,10 +86,16 @@
> .family = _family, \
> .model = _model, \
> .feature = X86_FEATURE_ANY, \
> - .driver_data = (kernel_ulong_t)&_driver_data \
> + .driver_data = (kernel_ulong_t)_driver_data \
> }
>
> #define INTEL_CPU_FAM6(_model, _driver_data) \
> - INTEL_CPU_FAM_ANY(6, INTEL_FAM6_##_model, _driver_data)
> + INTEL_CPU_FAM_ANY(6, INTEL_FAM6_##_model, &_driver_data)
> +
> +#define INTEL_CPU_FAM_ANY_NODATA(_family, _model) \
> + INTEL_CPU_FAM_ANY(_family, _model, 0)
> +
> +#define INTEL_CPU_FAM6_NODATA(_model) \
> + INTEL_CPU_FAM_ANY_NODATA(6, INTEL_FAM6_##_model)
>
> #endif /* _ASM_X86_INTEL_FAMILY_H */
> --
> 2.20.1
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/3] x86/cpu: Introduce INTEL_CPU_FAM*_NODATA() helper macros
2019-01-11 10:35 ` [PATCH v2 1/3] x86/cpu: Introduce INTEL_CPU_FAM*_NODATA() helper macros Rafael J. Wysocki
@ 2019-01-11 13:29 ` Andy Shevchenko
0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2019-01-11 13:29 UTC (permalink / raw)
To: Rafael J. Wysocki
Cc: Andy Shevchenko, Thomas Gleixner, Ingo Molnar, Borislav Petkov,
the arch/x86 maintainers, Rafael J. Wysocki,
ACPI Devel Maling List, Linux Kernel Mailing List
On Fri, Jan 11, 2019 at 3:14 PM Rafael J. Wysocki <rafael@kernel.org> wrote:
>
> On Wed, Jan 9, 2019 at 5:57 PM Andy Shevchenko
> <andriy.shevchenko@linux.intel.com> wrote:
> >
> > These macros are often used by the drivers and we have already a lot of
> > duplication as ICPU() macro across them.
> >
> > Provide a generic x86 macro for users.
> >
> > This adds no driver data variants.
> >
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
>
> If you want me to apply the series, I need an ACK for this one.
I hope Ingo can help with this.
> Alternatively, if you want to apply it yourself, please feel free to
> add ACKs from me to the ACPI-related patches in it.
Thanks, you already gave yours at time of v1.
>
> > ---
> > arch/x86/include/asm/intel-family.h | 10 ++++++++--
> > 1 file changed, 8 insertions(+), 2 deletions(-)
> >
> > diff --git a/arch/x86/include/asm/intel-family.h b/arch/x86/include/asm/intel-family.h
> > index 25b28760fada..afd70055a750 100644
> > --- a/arch/x86/include/asm/intel-family.h
> > +++ b/arch/x86/include/asm/intel-family.h
> > @@ -86,10 +86,16 @@
> > .family = _family, \
> > .model = _model, \
> > .feature = X86_FEATURE_ANY, \
> > - .driver_data = (kernel_ulong_t)&_driver_data \
> > + .driver_data = (kernel_ulong_t)_driver_data \
> > }
> >
> > #define INTEL_CPU_FAM6(_model, _driver_data) \
> > - INTEL_CPU_FAM_ANY(6, INTEL_FAM6_##_model, _driver_data)
> > + INTEL_CPU_FAM_ANY(6, INTEL_FAM6_##_model, &_driver_data)
> > +
> > +#define INTEL_CPU_FAM_ANY_NODATA(_family, _model) \
> > + INTEL_CPU_FAM_ANY(_family, _model, 0)
> > +
> > +#define INTEL_CPU_FAM6_NODATA(_model) \
> > + INTEL_CPU_FAM_ANY_NODATA(6, INTEL_FAM6_##_model)
> >
> > #endif /* _ASM_X86_INTEL_FAMILY_H */
> > --
> > 2.20.1
> >
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/3] x86/cpu: Introduce INTEL_CPU_FAM*_NODATA() helper macros
2019-01-09 16:57 [PATCH v2 1/3] x86/cpu: Introduce INTEL_CPU_FAM*_NODATA() helper macros Andy Shevchenko
` (2 preceding siblings ...)
2019-01-11 10:35 ` [PATCH v2 1/3] x86/cpu: Introduce INTEL_CPU_FAM*_NODATA() helper macros Rafael J. Wysocki
@ 2019-01-14 11:08 ` Borislav Petkov
3 siblings, 0 replies; 7+ messages in thread
From: Borislav Petkov @ 2019-01-14 11:08 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Thomas Gleixner, Ingo Molnar, x86, Rafael J. Wysocki, linux-acpi,
linux-kernel
On Wed, Jan 09, 2019 at 06:57:52PM +0200, Andy Shevchenko wrote:
> These macros are often used by the drivers and we have already a lot of
> duplication as ICPU() macro across them.
>
> Provide a generic x86 macro for users.
>
> This adds no driver data variants.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> arch/x86/include/asm/intel-family.h | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/arch/x86/include/asm/intel-family.h b/arch/x86/include/asm/intel-family.h
> index 25b28760fada..afd70055a750 100644
> --- a/arch/x86/include/asm/intel-family.h
> +++ b/arch/x86/include/asm/intel-family.h
> @@ -86,10 +86,16 @@
> .family = _family, \
> .model = _model, \
> .feature = X86_FEATURE_ANY, \
> - .driver_data = (kernel_ulong_t)&_driver_data \
> + .driver_data = (kernel_ulong_t)_driver_data \
> }
>
> #define INTEL_CPU_FAM6(_model, _driver_data) \
> - INTEL_CPU_FAM_ANY(6, INTEL_FAM6_##_model, _driver_data)
> + INTEL_CPU_FAM_ANY(6, INTEL_FAM6_##_model, &_driver_data)
> +
> +#define INTEL_CPU_FAM_ANY_NODATA(_family, _model) \
"ANY_NODATA" is confusing IMO, as I have no clue what that means. ICPU()
and the full model define was fine.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/3] ACPI / LPSS: Get rid of custom ICPU() macro
2019-01-09 16:57 ` [PATCH v2 2/3] ACPI / LPSS: Get rid of custom ICPU() macro Andy Shevchenko
@ 2019-01-14 11:08 ` Borislav Petkov
0 siblings, 0 replies; 7+ messages in thread
From: Borislav Petkov @ 2019-01-14 11:08 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Thomas Gleixner, Ingo Molnar, x86, Rafael J. Wysocki, linux-acpi,
linux-kernel, Rafael J . Wysocki
On Wed, Jan 09, 2019 at 06:57:53PM +0200, Andy Shevchenko wrote:
> Replace custom grown macro with generic INTEL_CPU_FAM6_NODATA() one.
>
> No functional change intended.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> ---
> drivers/acpi/acpi_lpss.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/acpi/acpi_lpss.c b/drivers/acpi/acpi_lpss.c
> index 5f94c35d165f..633a528bb6ea 100644
> --- a/drivers/acpi/acpi_lpss.c
> +++ b/drivers/acpi/acpi_lpss.c
> @@ -311,11 +311,9 @@ static const struct lpss_device_desc bsw_spi_dev_desc = {
> .setup = lpss_deassert_reset,
> };
>
> -#define ICPU(model) { X86_VENDOR_INTEL, 6, model, X86_FEATURE_ANY, }
> -
> static const struct x86_cpu_id lpss_cpu_ids[] = {
> - ICPU(INTEL_FAM6_ATOM_SILVERMONT), /* Valleyview, Bay Trail */
Sorry but the previous one was better: INTEL_FAM6_ATOM_SILVERMONT I can
find in the tree...
> - ICPU(INTEL_FAM6_ATOM_AIRMONT), /* Braswell, Cherry Trail */
> + INTEL_CPU_FAM6_NODATA(ATOM_SILVERMONT), /* Valleyview, Bay Trail */
For ATOM_SILVERMONT I find different things:
INTEL_CPU_FAM6(ATOM_SILVERMONT
X86_CSTATES_MODEL(INTEL_FAM6_ATOM_SILVERMONT
ICPU(INTEL_FAM6_ATOM_SILVERMONT
...
so you guys need to sit down and agree on a single form of usage and
stick with it.
And I'd advise against the first one which cuts off the
INTEL_FAM6_ATOM_SILVERMONT and other defines.
Thx.
--
Regards/Gruss,
Boris.
Good mailing practices for 400: avoid top-posting and trim the reply.
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-01-14 11:09 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-09 16:57 [PATCH v2 1/3] x86/cpu: Introduce INTEL_CPU_FAM*_NODATA() helper macros Andy Shevchenko
2019-01-09 16:57 ` [PATCH v2 2/3] ACPI / LPSS: Get rid of custom ICPU() macro Andy Shevchenko
2019-01-14 11:08 ` Borislav Petkov
2019-01-09 16:57 ` [PATCH v2 3/3] ACPI / x86: utils: " Andy Shevchenko
2019-01-11 10:35 ` [PATCH v2 1/3] x86/cpu: Introduce INTEL_CPU_FAM*_NODATA() helper macros Rafael J. Wysocki
2019-01-11 13:29 ` Andy Shevchenko
2019-01-14 11:08 ` Borislav Petkov
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).