linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] mpparse: Add a knob to disable IRQ 0 through I/O APIC
@ 2008-07-01  0:11 Maciej W. Rozycki
  2008-07-01  4:57 ` Randy Dunlap
  2008-07-01  8:27 ` Ingo Molnar
  0 siblings, 2 replies; 5+ messages in thread
From: Maciej W. Rozycki @ 2008-07-01  0:11 UTC (permalink / raw)
  To: Ingo Molnar, Matthew Garrett, Rafael J. Wysocki
  Cc: Len Brown, Thomas Gleixner, linux-next, linux-acpi, linux-kernel

 As discovered recently some systems exhibit problems when the 8254 timer 
IRQ is routed through the I/O APIC.  These problems do not affect the 
timer IRQ itself and therefore cannot be detected when the correctness of 
operation of the interrupt is verified in check_timer().  Therefore the 
I/O APIC path of the timer IRQ has to be disabled entirely.

 This is a change that lets platforms ask for the timer IRQ not to be 
registered in the I/O APIC interrupt tables.  The local APIC and ExtINTA 
paths are unaffected.  This request is only taken into account for ACPI 
platforms as MP table systems seem unaffected so far.

Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
---
patch-2.6.26-rc1-20080505-mpparse-acpi-noirq0-2
diff -up --recursive --new-file linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/mpparse.c linux-2.6.26-rc1-20080505/arch/x86/kernel/mpparse.c
--- linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/mpparse.c	2008-05-05 02:56:19.000000000 +0000
+++ linux-2.6.26-rc1-20080505/arch/x86/kernel/mpparse.c	2008-06-30 21:53:33.000000000 +0000
@@ -50,6 +50,8 @@ static int mp_current_pci_id;
 
 int pic_mode;
 
+int disable_irq0_through_ioapic __initdata;
+
 /*
  * Intel MP BIOS table parsing routines:
  */
@@ -887,6 +889,10 @@ void __init mp_override_legacy_irq(u8 bu
 	int ioapic = -1;
 	int pin = -1;
 
+	/* Skip the 8254 timer interrupt (IRQ 0) if requested.  */
+	if (bus_irq == 0 && disable_irq0_through_ioapic)
+		return;
+
 	/*
 	 * Convert 'gsi' to 'ioapic.pin'.
 	 */
@@ -955,6 +961,10 @@ void __init mp_config_acpi_legacy_irqs(v
 	for (i = 0; i < 16; i++) {
 		int idx;
 
+		/* Skip the 8254 timer interrupt (IRQ 0) if requested.  */
+		if (i == 0 && disable_irq0_through_ioapic)
+			continue;
+
 		for (idx = 0; idx < mp_irq_entries; idx++) {
 			struct mpc_config_intsrc *irq = mp_irqs + idx;
 
diff -up --recursive --new-file linux-2.6.26-rc1-20080505.macro/include/asm-x86/mpspec.h linux-2.6.26-rc1-20080505/include/asm-x86/mpspec.h
--- linux-2.6.26-rc1-20080505.macro/include/asm-x86/mpspec.h	2008-05-05 02:55:57.000000000 +0000
+++ linux-2.6.26-rc1-20080505/include/asm-x86/mpspec.h	2008-06-30 22:29:23.000000000 +0000
@@ -113,4 +113,15 @@ typedef struct physid_mask physid_mask_t
 
 extern physid_mask_t phys_cpu_present_map;
 
+#ifdef CONFIG_X86_MPPARSE
+static inline void set_disable_irq0_through_ioapic(int v)
+{
+	extern int disable_irq0_through_ioapic;
+
+	disable_irq0_through_ioapic = v;
+}
+#else
+static inline void set_disable_irq0_through_ioapic(int v) { }
+#endif
+
 #endif

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

* Re: [PATCH 1/2] mpparse: Add a knob to disable IRQ 0 through I/O APIC
  2008-07-01  0:11 [PATCH 1/2] mpparse: Add a knob to disable IRQ 0 through I/O APIC Maciej W. Rozycki
@ 2008-07-01  4:57 ` Randy Dunlap
  2008-07-01  6:18   ` Ingo Molnar
  2008-07-01  8:27 ` Ingo Molnar
  1 sibling, 1 reply; 5+ messages in thread
From: Randy Dunlap @ 2008-07-01  4:57 UTC (permalink / raw)
  To: Maciej W. Rozycki
  Cc: Ingo Molnar, Matthew Garrett, Rafael J. Wysocki, Len Brown,
	Thomas Gleixner, linux-next, linux-acpi, linux-kernel

On Tue, 1 Jul 2008 01:11:35 +0100 (BST) Maciej W. Rozycki wrote:

>  As discovered recently some systems exhibit problems when the 8254 timer 
> IRQ is routed through the I/O APIC.  These problems do not affect the 
> timer IRQ itself and therefore cannot be detected when the correctness of 
> operation of the interrupt is verified in check_timer().  Therefore the 
> I/O APIC path of the timer IRQ has to be disabled entirely.
> 
>  This is a change that lets platforms ask for the timer IRQ not to be 
> registered in the I/O APIC interrupt tables.  The local APIC and ExtINTA 
> paths are unaffected.  This request is only taken into account for ACPI 
> platforms as MP table systems seem unaffected so far.
> 
> Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
> ---
> patch-2.6.26-rc1-20080505-mpparse-acpi-noirq0-2
> diff -up --recursive --new-file linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/mpparse.c linux-2.6.26-rc1-20080505/arch/x86/kernel/mpparse.c
> --- linux-2.6.26-rc1-20080505.macro/arch/x86/kernel/mpparse.c	2008-05-05 02:56:19.000000000 +0000
> +++ linux-2.6.26-rc1-20080505/arch/x86/kernel/mpparse.c	2008-06-30 21:53:33.000000000 +0000
> @@ -50,6 +50,8 @@ static int mp_current_pci_id;
>  
>  int pic_mode;
>  
> +int disable_irq0_through_ioapic __initdata;
> +
>  /*
>   * Intel MP BIOS table parsing routines:
>   */
> @@ -887,6 +889,10 @@ void __init mp_override_legacy_irq(u8 bu
>  	int ioapic = -1;
>  	int pin = -1;
>  
> +	/* Skip the 8254 timer interrupt (IRQ 0) if requested.  */
> +	if (bus_irq == 0 && disable_irq0_through_ioapic)
> +		return;
> +
>  	/*
>  	 * Convert 'gsi' to 'ioapic.pin'.
>  	 */
> @@ -955,6 +961,10 @@ void __init mp_config_acpi_legacy_irqs(v
>  	for (i = 0; i < 16; i++) {
>  		int idx;
>  
> +		/* Skip the 8254 timer interrupt (IRQ 0) if requested.  */
> +		if (i == 0 && disable_irq0_through_ioapic)
> +			continue;
> +
>  		for (idx = 0; idx < mp_irq_entries; idx++) {
>  			struct mpc_config_intsrc *irq = mp_irqs + idx;
>  
> diff -up --recursive --new-file linux-2.6.26-rc1-20080505.macro/include/asm-x86/mpspec.h linux-2.6.26-rc1-20080505/include/asm-x86/mpspec.h
> --- linux-2.6.26-rc1-20080505.macro/include/asm-x86/mpspec.h	2008-05-05 02:55:57.000000000 +0000
> +++ linux-2.6.26-rc1-20080505/include/asm-x86/mpspec.h	2008-06-30 22:29:23.000000000 +0000
> @@ -113,4 +113,15 @@ typedef struct physid_mask physid_mask_t
>  
>  extern physid_mask_t phys_cpu_present_map;
>  
> +#ifdef CONFIG_X86_MPPARSE
> +static inline void set_disable_irq0_through_ioapic(int v)
> +{
> +	extern int disable_irq0_through_ioapic;
> +
> +	disable_irq0_through_ioapic = v;
> +}
> +#else
> +static inline void set_disable_irq0_through_ioapic(int v) { }
> +#endif
> +
>  #endif


What calls set_disable_irq0_through_ioapic() ?


---
~Randy
Linux Plumbers Conference, 17-19 September 2008, Portland, Oregon USA
http://linuxplumbersconf.org/

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

* Re: [PATCH 1/2] mpparse: Add a knob to disable IRQ 0 through I/O APIC
  2008-07-01  4:57 ` Randy Dunlap
@ 2008-07-01  6:18   ` Ingo Molnar
  0 siblings, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2008-07-01  6:18 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Maciej W. Rozycki, Matthew Garrett, Rafael J. Wysocki, Len Brown,
	Thomas Gleixner, linux-next, linux-acpi, linux-kernel


* Randy Dunlap <randy.dunlap@oracle.com> wrote:

> What calls set_disable_irq0_through_ioapic() ?

a DMI quirk in the next patch:

+dmi_disable_irq0_through_ioapic(const struct dmi_system_id *d)
+{
+       pr_notice("%s detected: disabling IRQ 0 through I/O APIC\n", d->ident);
+       set_disable_irq0_through_ioapic(1);
+       return 0;

	Ingo

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

* Re: [PATCH 1/2] mpparse: Add a knob to disable IRQ 0 through I/O APIC
  2008-07-01  0:11 [PATCH 1/2] mpparse: Add a knob to disable IRQ 0 through I/O APIC Maciej W. Rozycki
  2008-07-01  4:57 ` Randy Dunlap
@ 2008-07-01  8:27 ` Ingo Molnar
  2008-07-01 16:31   ` Maciej W. Rozycki
  1 sibling, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2008-07-01  8:27 UTC (permalink / raw)
  To: Maciej W. Rozycki
  Cc: Matthew Garrett, Rafael J. Wysocki, Len Brown, Thomas Gleixner,
	linux-next, linux-acpi, linux-kernel


* Maciej W. Rozycki <macro@linux-mips.org> wrote:

>  As discovered recently some systems exhibit problems when the 8254 
> timer IRQ is routed through the I/O APIC.  These problems do not 
> affect the timer IRQ itself and therefore cannot be detected when the 
> correctness of operation of the interrupt is verified in 
> check_timer().  Therefore the I/O APIC path of the timer IRQ has to be 
> disabled entirely.
> 
>  This is a change that lets platforms ask for the timer IRQ not to be 
> registered in the I/O APIC interrupt tables.  The local APIC and 
> ExtINTA paths are unaffected.  This request is only taken into account 
> for ACPI platforms as MP table systems seem unaffected so far.

applied to tip/x86/mpparse - thanks Maciej.

Note, since mp_config_acpi_legacy_irqs moved to acpi/boot.c i 
restructured and simplified it slightly - please double-check the form 
below.

	Ingo

--------------->
commit e38502eb8aa82314d5ab0eba45f50e6790dadd88
Author: Matthew Garrett <mjg59@srcf.ucam.org>
Date:   Tue Jul 1 01:12:06 2008 +0100

    x86, ioapic, acpi quirk: disable IRQ 0 through I/O APIC for some HP systems
    
    Some HP laptops have a problem with their DSDT reporting as
    HP/SB400/10000, which includes some code which overrides all temperature
    trip points to 16C if the INTIN2 input of the I/O APIC is enabled.  This
    input is incorrectly designated the ISA IRQ 0 via an interrupt source
    override even though it is wired to the output of the master 8259A and
    INTIN0 is not connected at all.  So far two models have been identified,
    namely nx6125 and nx6325.
    
    Use a knob provided by the I/O APIC interrupt registration code to
    abandon any attempts to route IRQ 0 through the I/O APIC for these
    systems.
    
    Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
    Cc: Len Brown <lenb@kernel.org>
    Cc: Matthew Garrett <mjg59@srcf.ucam.org>
    Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 92a5426..9908ef4 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -1427,6 +1427,17 @@ static int __init force_acpi_ht(const struct dmi_system_id *d)
 }
 
 /*
+ * Don't register any I/O APIC entries for the 8254 timer IRQ.
+ */
+static int __init
+dmi_disable_irq0_through_ioapic(const struct dmi_system_id *d)
+{
+	pr_notice("%s detected: disabling IRQ 0 through I/O APIC\n", d->ident);
+	disable_irq0_through_ioapic = 1;
+	return 0;
+}
+
+/*
  * If your system is blacklisted here, but you find that acpi=force
  * works for you, please contact acpi-devel@sourceforge.net
  */
@@ -1593,6 +1604,32 @@ static struct dmi_system_id __initdata acpi_dmi_table[] = {
 		     DMI_MATCH(DMI_PRODUCT_NAME, "TravelMate 360"),
 		     },
 	 },
+	/*
+	 * HP laptops which use a DSDT reporting as HP/SB400/10000,
+	 * which includes some code which overrides all temperature
+	 * trip points to 16C if the INTIN2 input of the I/O APIC
+	 * is enabled.  This input is incorrectly designated the
+	 * ISA IRQ 0 via an interrupt source override even though
+	 * it is wired to the output of the master 8259A and INTIN0
+	 * is not connected at all.  Abandon any attempts to route
+	 * IRQ 0 through the I/O APIC therefore.
+	 */
+	{
+	 .callback = dmi_disable_irq0_through_ioapic,
+	 .ident = "HP NX6125 laptop",
+	 .matches = {
+		     DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+		     DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nx6125"),
+		     },
+	 },
+	{
+	 .callback = dmi_disable_irq0_through_ioapic,
+	 .ident = "HP NX6325 laptop",
+	 .matches = {
+		     DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"),
+		     DMI_MATCH(DMI_PRODUCT_NAME, "HP Compaq nx6325"),
+		     },
+	 },
 	{}
 };
 

commit 0b3d81ad4f765513347a04434efc15cbdc4e1c54
Author: Maciej W. Rozycki <macro@linux-mips.org>
Date:   Tue Jul 1 01:11:35 2008 +0100

    x86, ioapic, acpi: add a knob to disable IRQ 0 through I/O APIC
    
    As discovered recently some systems exhibit problems when the 8254 timer
    IRQ is routed through the I/O APIC.  These problems do not affect the
    timer IRQ itself and therefore cannot be detected when the correctness of
    operation of the interrupt is verified in check_timer().  Therefore the
    I/O APIC path of the timer IRQ has to be disabled entirely.
    
    This is a change that lets platforms ask for the timer IRQ not to be
    registered in the I/O APIC interrupt tables.  The local APIC and ExtINTA
    paths are unaffected.  This request is only taken into account for ACPI
    platforms as MP table systems seem unaffected so far.
    
    Signed-off-by: Maciej W. Rozycki <macro@linux-mips.org>
    Cc: Len Brown <lenb@kernel.org>
    Cc: Matthew Garrett <mjg59@srcf.ucam.org>
    Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c
index 91bb9a9..92a5426 100644
--- a/arch/x86/kernel/acpi/boot.c
+++ b/arch/x86/kernel/acpi/boot.c
@@ -83,6 +83,8 @@ int acpi_lapic;
 int acpi_ioapic;
 int acpi_strict;
 
+static int disable_irq0_through_ioapic __initdata;
+
 u8 acpi_sci_flags __initdata;
 int acpi_sci_override_gsi __initdata;
 int acpi_skip_timer_override __initdata;
@@ -992,6 +994,10 @@ void __init mp_override_legacy_irq(u8 bus_irq, u8 polarity, u8 trigger, u32 gsi)
 	int pin;
 	struct mp_config_intsrc mp_irq;
 
+	/* Skip the 8254 timer interrupt (IRQ 0) if requested.  */
+	if (bus_irq == 0 && disable_irq0_through_ioapic)
+		return;
+
 	/*
 	 * Convert 'gsi' to 'ioapic.pin'.
 	 */
@@ -1058,6 +1064,10 @@ void __init mp_config_acpi_legacy_irqs(void)
 	for (i = 0; i < 16; i++) {
 		int idx;
 
+		/* Skip the 8254 timer interrupt (IRQ 0) if requested.  */
+		if (i == 0 && disable_irq0_through_ioapic)
+			continue;
+
 		for (idx = 0; idx < mp_irq_entries; idx++) {
 			struct mp_config_intsrc *irq = mp_irqs + idx;
 

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

* Re: [PATCH 1/2] mpparse: Add a knob to disable IRQ 0 through I/O APIC
  2008-07-01  8:27 ` Ingo Molnar
@ 2008-07-01 16:31   ` Maciej W. Rozycki
  0 siblings, 0 replies; 5+ messages in thread
From: Maciej W. Rozycki @ 2008-07-01 16:31 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Matthew Garrett, Rafael J. Wysocki, Len Brown, Thomas Gleixner,
	linux-next, linux-acpi, linux-kernel

On Tue, 1 Jul 2008, Ingo Molnar wrote:

> Note, since mp_config_acpi_legacy_irqs moved to acpi/boot.c i 
> restructured and simplified it slightly - please double-check the form 
> below.

 Thanks for sorting this out -- I guess it's time to get my local tree 
updated.  Your version looks good and should work no worse than mine did 
with my tree (which is an older version of upstream).

  Maciej

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

end of thread, other threads:[~2008-07-01 16:32 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-01  0:11 [PATCH 1/2] mpparse: Add a knob to disable IRQ 0 through I/O APIC Maciej W. Rozycki
2008-07-01  4:57 ` Randy Dunlap
2008-07-01  6:18   ` Ingo Molnar
2008-07-01  8:27 ` Ingo Molnar
2008-07-01 16:31   ` Maciej W. Rozycki

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).