All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/3] ACPI / x86: boot: Not all platforms require acpi_reduced_hw_init()
@ 2018-01-17 17:34 Andy Shevchenko
  2018-01-17 17:34 ` [PATCH v1 2/3] x86/platform/intel-mid: Move PCI initialization to arch_init() Andy Shevchenko
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Andy Shevchenko @ 2018-01-17 17:34 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Rafael J. Wysocki, linux-acpi, linux-kernel
  Cc: Andy Shevchenko

Some platforms might take care of legacy devices on theirs own.
Let's allow them to do that by exporting a weak function.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 arch/x86/kernel/acpi/boot.c | 2 +-
 include/linux/acpi.h        | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index ec3a286163c3..9a714b79ebed 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -1375,7 +1375,7 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
  *
  * We initialize the Hardware-reduced ACPI model here:
  */
-static void __init acpi_reduced_hw_init(void)
+void __init __weak acpi_reduced_hw_init(void)
 {
 	if (acpi_gbl_reduced_hardware) {
 		/*
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index f0ea50ba0550..eb881516bce6 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -226,6 +226,8 @@ struct acpi_subtable_proc {
 
 void __iomem *__acpi_map_table(unsigned long phys, unsigned long size);
 void __acpi_unmap_table(void __iomem *map, unsigned long size);
+
+void acpi_reduced_hw_init(void);
 int early_acpi_boot_init(void);
 int acpi_boot_init (void);
 void acpi_boot_table_init (void);
@@ -707,6 +709,7 @@ static inline struct device *acpi_get_first_physical_node(struct acpi_device *ad
 static inline void acpi_early_init(void) { }
 static inline void acpi_subsystem_init(void) { }
 
+static inline void acpi_reduced_hw_init(void) { }
 static inline int early_acpi_boot_init(void)
 {
 	return 0;
-- 
2.15.1


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

* [PATCH v1 2/3] x86/platform/intel-mid: Move PCI initialization to arch_init()
  2018-01-17 17:34 [PATCH v1 1/3] ACPI / x86: boot: Not all platforms require acpi_reduced_hw_init() Andy Shevchenko
@ 2018-01-17 17:34 ` Andy Shevchenko
  2018-01-19  8:28   ` [tip:x86/platform] " tip-bot for Andy Shevchenko
  2018-01-17 17:34 ` [PATCH v1 3/3] x86/platform/intel-mid: Add special handling of ACPI HW reduced platforms Andy Shevchenko
  2018-02-04  8:54 ` [PATCH v1 1/3] ACPI / x86: boot: Not all platforms require acpi_reduced_hw_init() Rafael J. Wysocki
  2 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2018-01-17 17:34 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Rafael J. Wysocki, linux-acpi, linux-kernel
  Cc: Andy Shevchenko

ACPI redefines x86_init.pci.init when enabled. Though we still need special
treatment for MID platforms.

Move our specific callback to x86_init.pci.arch_init() and, by calling
acpi_noirq_set(), take back a control over IRQ assignment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 arch/x86/pci/intel_mid_pci.c            | 1 +
 arch/x86/platform/intel-mid/intel-mid.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/pci/intel_mid_pci.c b/arch/x86/pci/intel_mid_pci.c
index 511921045312..43867bc85368 100644
--- a/arch/x86/pci/intel_mid_pci.c
+++ b/arch/x86/pci/intel_mid_pci.c
@@ -300,6 +300,7 @@ int __init intel_mid_pci_init(void)
 	pci_root_ops = intel_mid_pci_ops;
 	pci_soc_mode = 1;
 	/* Continue with standard init */
+	acpi_noirq_set();
 	return 1;
 }
 
diff --git a/arch/x86/platform/intel-mid/intel-mid.c b/arch/x86/platform/intel-mid/intel-mid.c
index 86676cec99a1..2c67bae6bb53 100644
--- a/arch/x86/platform/intel-mid/intel-mid.c
+++ b/arch/x86/platform/intel-mid/intel-mid.c
@@ -194,7 +194,7 @@ void __init x86_intel_mid_early_setup(void)
 	x86_platform.calibrate_tsc = intel_mid_calibrate_tsc;
 	x86_platform.get_nmi_reason = intel_mid_get_nmi_reason;
 
-	x86_init.pci.init = intel_mid_pci_init;
+	x86_init.pci.arch_init = intel_mid_pci_init;
 	x86_init.pci.fixup_irqs = x86_init_noop;
 
 	legacy_pic = &null_legacy_pic;
-- 
2.15.1

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

* [PATCH v1 3/3] x86/platform/intel-mid: Add special handling of ACPI HW reduced platforms
  2018-01-17 17:34 [PATCH v1 1/3] ACPI / x86: boot: Not all platforms require acpi_reduced_hw_init() Andy Shevchenko
  2018-01-17 17:34 ` [PATCH v1 2/3] x86/platform/intel-mid: Move PCI initialization to arch_init() Andy Shevchenko
@ 2018-01-17 17:34 ` Andy Shevchenko
  2018-01-17 17:43   ` Andy Shevchenko
  2018-02-04  8:54 ` [PATCH v1 1/3] ACPI / x86: boot: Not all platforms require acpi_reduced_hw_init() Rafael J. Wysocki
  2 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2018-01-17 17:34 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Rafael J. Wysocki, linux-acpi, linux-kernel
  Cc: Andy Shevchenko

When switching to ACPI HW reduced platforms we still want to initialize timers.
Override acpi_reduced_hw_init() to achieve that.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 arch/x86/platform/intel-mid/intel-mid.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/arch/x86/platform/intel-mid/intel-mid.c b/arch/x86/platform/intel-mid/intel-mid.c
index 2c67bae6bb53..51bf2f6c9e97 100644
--- a/arch/x86/platform/intel-mid/intel-mid.c
+++ b/arch/x86/platform/intel-mid/intel-mid.c
@@ -13,6 +13,7 @@
 
 #define pr_fmt(fmt) "intel_mid: " fmt
 
+#include <linux/acpi.h>
 #include <linux/init.h>
 #include <linux/kernel.h>
 #include <linux/interrupt.h>
@@ -172,6 +173,14 @@ static unsigned char intel_mid_get_nmi_reason(void)
 	return 0;
 }
 
+void __init acpi_reduced_hw_init(void)
+{
+	/*
+	 * Do nothing for now as everything needed done in
+	 * x86_intel_mid_early_setup() below.
+	 */
+}
+
 /*
  * Moorestown specific x86_init function overrides and early setup
  * calls.
-- 
2.15.1

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

* Re: [PATCH v1 3/3] x86/platform/intel-mid: Add special handling of ACPI HW reduced platforms
  2018-01-17 17:34 ` [PATCH v1 3/3] x86/platform/intel-mid: Add special handling of ACPI HW reduced platforms Andy Shevchenko
@ 2018-01-17 17:43   ` Andy Shevchenko
  2018-01-19  8:15     ` Ingo Molnar
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Shevchenko @ 2018-01-17 17:43 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Rafael J. Wysocki, linux-acpi, linux-kernel

On Wed, 2018-01-17 at 19:34 +0200, Andy Shevchenko wrote:
> When switching to ACPI HW reduced platforms we still want to
> initialize timers.
> Override acpi_reduced_hw_init() to achieve that.

Just realized, that it may annihilate the other acpi_reduced_hw_init()
on non-MID platforms...

Open to suggestions how would be better to deal with this (I really
don't like the idea to spread MID quirks all over the code).

P.S. Patch 2 from the series still makes sense per se.

> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  arch/x86/platform/intel-mid/intel-mid.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/arch/x86/platform/intel-mid/intel-mid.c
> b/arch/x86/platform/intel-mid/intel-mid.c
> index 2c67bae6bb53..51bf2f6c9e97 100644
> --- a/arch/x86/platform/intel-mid/intel-mid.c
> +++ b/arch/x86/platform/intel-mid/intel-mid.c
> @@ -13,6 +13,7 @@
>  
>  #define pr_fmt(fmt) "intel_mid: " fmt
>  
> +#include <linux/acpi.h>
>  #include <linux/init.h>
>  #include <linux/kernel.h>
>  #include <linux/interrupt.h>
> @@ -172,6 +173,14 @@ static unsigned char
> intel_mid_get_nmi_reason(void)
>  	return 0;
>  }
>  
> +void __init acpi_reduced_hw_init(void)
> +{
> +	/*
> +	 * Do nothing for now as everything needed done in
> +	 * x86_intel_mid_early_setup() below.
> +	 */
> +}
> +
>  /*
>   * Moorestown specific x86_init function overrides and early setup
>   * calls.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

* Re: [PATCH v1 3/3] x86/platform/intel-mid: Add special handling of ACPI HW reduced platforms
  2018-01-17 17:43   ` Andy Shevchenko
@ 2018-01-19  8:15     ` Ingo Molnar
  0 siblings, 0 replies; 8+ messages in thread
From: Ingo Molnar @ 2018-01-19  8:15 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86,
	Rafael J. Wysocki, linux-acpi, linux-kernel


* Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> On Wed, 2018-01-17 at 19:34 +0200, Andy Shevchenko wrote:
> > When switching to ACPI HW reduced platforms we still want to
> > initialize timers.
> > Override acpi_reduced_hw_init() to achieve that.
> 
> Just realized, that it may annihilate the other acpi_reduced_hw_init()
> on non-MID platforms...
> 
> Open to suggestions how would be better to deal with this (I really
> don't like the idea to spread MID quirks all over the code).
> 
> P.S. Patch 2 from the series still makes sense per se.

Ok, I'll apply patch #2 to tip:x86/platform.

Thanks,

	Ingo

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

* [tip:x86/platform] x86/platform/intel-mid: Move PCI initialization to arch_init()
  2018-01-17 17:34 ` [PATCH v1 2/3] x86/platform/intel-mid: Move PCI initialization to arch_init() Andy Shevchenko
@ 2018-01-19  8:28   ` tip-bot for Andy Shevchenko
  0 siblings, 0 replies; 8+ messages in thread
From: tip-bot for Andy Shevchenko @ 2018-01-19  8:28 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: hpa, linux-kernel, andriy.shevchenko, torvalds, mingo, peterz, tglx, rjw

Commit-ID:  a912a7584ec39647fb032c1001eb69746f27b1d3
Gitweb:     https://git.kernel.org/tip/a912a7584ec39647fb032c1001eb69746f27b1d3
Author:     Andy Shevchenko <andriy.shevchenko@linux.intel.com>
AuthorDate: Wed, 17 Jan 2018 19:34:08 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Fri, 19 Jan 2018 09:15:42 +0100

x86/platform/intel-mid: Move PCI initialization to arch_init()

ACPI redefines x86_init.pci.init when enabled. Though we still need special
treatment for MID platforms.

Move our specific callback to x86_init.pci.arch_init() and, by calling
acpi_noirq_set(), take back a control over IRQ assignment.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-acpi@vger.kernel.org
Link: http://lkml.kernel.org/r/20180117173409.88136-2-andriy.shevchenko@linux.intel.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/pci/intel_mid_pci.c            | 1 +
 arch/x86/platform/intel-mid/intel-mid.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/arch/x86/pci/intel_mid_pci.c b/arch/x86/pci/intel_mid_pci.c
index 5119210..43867bc 100644
--- a/arch/x86/pci/intel_mid_pci.c
+++ b/arch/x86/pci/intel_mid_pci.c
@@ -300,6 +300,7 @@ int __init intel_mid_pci_init(void)
 	pci_root_ops = intel_mid_pci_ops;
 	pci_soc_mode = 1;
 	/* Continue with standard init */
+	acpi_noirq_set();
 	return 1;
 }
 
diff --git a/arch/x86/platform/intel-mid/intel-mid.c b/arch/x86/platform/intel-mid/intel-mid.c
index 86676ce..2c67bae 100644
--- a/arch/x86/platform/intel-mid/intel-mid.c
+++ b/arch/x86/platform/intel-mid/intel-mid.c
@@ -194,7 +194,7 @@ void __init x86_intel_mid_early_setup(void)
 	x86_platform.calibrate_tsc = intel_mid_calibrate_tsc;
 	x86_platform.get_nmi_reason = intel_mid_get_nmi_reason;
 
-	x86_init.pci.init = intel_mid_pci_init;
+	x86_init.pci.arch_init = intel_mid_pci_init;
 	x86_init.pci.fixup_irqs = x86_init_noop;
 
 	legacy_pic = &null_legacy_pic;

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

* Re: [PATCH v1 1/3] ACPI / x86: boot: Not all platforms require acpi_reduced_hw_init()
  2018-01-17 17:34 [PATCH v1 1/3] ACPI / x86: boot: Not all platforms require acpi_reduced_hw_init() Andy Shevchenko
  2018-01-17 17:34 ` [PATCH v1 2/3] x86/platform/intel-mid: Move PCI initialization to arch_init() Andy Shevchenko
  2018-01-17 17:34 ` [PATCH v1 3/3] x86/platform/intel-mid: Add special handling of ACPI HW reduced platforms Andy Shevchenko
@ 2018-02-04  8:54 ` Rafael J. Wysocki
  2018-02-04 14:14   ` Andy Shevchenko
  2 siblings, 1 reply; 8+ messages in thread
From: Rafael J. Wysocki @ 2018-02-04  8:54 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-acpi,
	linux-kernel

On Wednesday, January 17, 2018 6:34:07 PM CET Andy Shevchenko wrote:
> Some platforms might take care of legacy devices on theirs own.
> Let's allow them to do that by exporting a weak function.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
>  arch/x86/kernel/acpi/boot.c | 2 +-
>  include/linux/acpi.h        | 3 +++
>  2 files changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
> index ec3a286163c3..9a714b79ebed 100644
> --- a/arch/x86/kernel/acpi/boot.c
> +++ b/arch/x86/kernel/acpi/boot.c
> @@ -1375,7 +1375,7 @@ static int __init dmi_ignore_irq0_timer_override(const struct dmi_system_id *d)
>   *
>   * We initialize the Hardware-reduced ACPI model here:
>   */
> -static void __init acpi_reduced_hw_init(void)
> +void __init __weak acpi_reduced_hw_init(void)
>  {
>  	if (acpi_gbl_reduced_hardware) {
>  		/*
> diff --git a/include/linux/acpi.h b/include/linux/acpi.h
> index f0ea50ba0550..eb881516bce6 100644
> --- a/include/linux/acpi.h
> +++ b/include/linux/acpi.h
> @@ -226,6 +226,8 @@ struct acpi_subtable_proc {
>  
>  void __iomem *__acpi_map_table(unsigned long phys, unsigned long size);
>  void __acpi_unmap_table(void __iomem *map, unsigned long size);
> +
> +void acpi_reduced_hw_init(void);
>  int early_acpi_boot_init(void);
>  int acpi_boot_init (void);
>  void acpi_boot_table_init (void);
> @@ -707,6 +709,7 @@ static inline struct device *acpi_get_first_physical_node(struct acpi_device *ad
>  static inline void acpi_early_init(void) { }
>  static inline void acpi_subsystem_init(void) { }
>  
> +static inline void acpi_reduced_hw_init(void) { }
>  static inline int early_acpi_boot_init(void)
>  {
>  	return 0;

May I suggest folding this into the [3/3]?

It would be clear why you need the __weak thing then.

OTOH, I guess you'll go for the new init callbacks rather.

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

* Re: [PATCH v1 1/3] ACPI / x86: boot: Not all platforms require acpi_reduced_hw_init()
  2018-02-04  8:54 ` [PATCH v1 1/3] ACPI / x86: boot: Not all platforms require acpi_reduced_hw_init() Rafael J. Wysocki
@ 2018-02-04 14:14   ` Andy Shevchenko
  0 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2018-02-04 14:14 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86, linux-acpi,
	linux-kernel

On Sun, 2018-02-04 at 09:54 +0100, Rafael J. Wysocki wrote:
> OTOH, I guess you'll go for the new init callbacks rather.

Yep, just ignore these two for now. I will remake it later.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

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

end of thread, other threads:[~2018-02-04 14:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-17 17:34 [PATCH v1 1/3] ACPI / x86: boot: Not all platforms require acpi_reduced_hw_init() Andy Shevchenko
2018-01-17 17:34 ` [PATCH v1 2/3] x86/platform/intel-mid: Move PCI initialization to arch_init() Andy Shevchenko
2018-01-19  8:28   ` [tip:x86/platform] " tip-bot for Andy Shevchenko
2018-01-17 17:34 ` [PATCH v1 3/3] x86/platform/intel-mid: Add special handling of ACPI HW reduced platforms Andy Shevchenko
2018-01-17 17:43   ` Andy Shevchenko
2018-01-19  8:15     ` Ingo Molnar
2018-02-04  8:54 ` [PATCH v1 1/3] ACPI / x86: boot: Not all platforms require acpi_reduced_hw_init() Rafael J. Wysocki
2018-02-04 14:14   ` Andy Shevchenko

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.