public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix for 2.4.21-pre2 and acpi-20021212
@ 2003-01-03 19:48 Jörg Prante
  0 siblings, 0 replies; 5+ messages in thread
From: Jörg Prante @ 2003-01-03 19:48 UTC (permalink / raw)
  To: acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f; +Cc: Margit Schubert-While

[-- Attachment #1: Type: text/plain, Size: 416 bytes --]

Hi,

this patch is needed for acpi-20021212 with 2.4.21-pre2 on a Pentium 4 with 
ACPI IO-APIC. The dynamic MP busses and IRQ_SOURCES in 2.4.21-pre2 introduced 
a conflict that will rise NULL pointer dereferences when combined with the 
ACPI patch. I don't have the hardware to test it, but Margit Schubert-While 
reported a successful boot.

http://infolinux.de/jp/087_acpi-mpparse-fix

Cheers, 

Jörg

[-- Attachment #2: 087_acpi-mpparse-fix --]
[-- Type: text/x-diff, Size: 2842 bytes --]

--- linux-2.4.21-pre2-jp15/arch/i386/kernel/mpparse.c.orig	2003-01-02 21:13:16.000000000 +0100
+++ linux-2.4.21-pre2-jp15/arch/i386/kernel/mpparse.c	2003-01-03 18:14:10.000000000 +0100
@@ -1132,10 +1132,28 @@
 
 void __init mp_config_acpi_legacy_irqs (void)
 {
-	struct mpc_config_intsrc intsrc;
 	int			i = 0;
 	int			ioapic = -1;
 
+	/*
+	 * Initialize mp_irqs for IRQ configuration.
+	 */
+	unsigned char *bus_data;
+	int count;
+
+	count = (MAX_MP_BUSSES * sizeof(int)) * 4;
+	count += (MAX_IRQ_SOURCES * sizeof(int)) * 4;
+	bus_data = alloc_bootmem(count);
+	if (!bus_data) {
+		panic("Fatal: can't allocate bus memory for ACPI legacy IRQ!");
+	}
+	mp_bus_id_to_type = (int *)&bus_data[0];
+	mp_bus_id_to_node = (int *)&bus_data[(MAX_MP_BUSSES * sizeof(int))];
+	mp_bus_id_to_local = (int *)&bus_data[(MAX_MP_BUSSES * sizeof(int)) * 2];
+	mp_bus_id_to_pci_bus = (int *)&bus_data[(MAX_MP_BUSSES * sizeof(int)) * 3];
+	mp_irqs = (struct mpc_config_intsrc *)&bus_data[(MAX_MP_BUSSES * sizeof(int)) * 4];
+	memset(mp_bus_id_to_pci_bus, -1, MAX_MP_BUSSES);
+
 	/* 
 	 * Fabricate the legacy ISA bus (bus #31).
 	 */
@@ -1149,11 +1167,6 @@
 	if (ioapic < 0)
 		return;
 
-	intsrc.mpc_type = MP_INTSRC;
-	intsrc.mpc_irqflag = 0;					/* Conforming */
-	intsrc.mpc_srcbus = MP_ISA_BUS;
-	intsrc.mpc_dstapic = mp_ioapics[ioapic].mpc_apicid;
-
 	/* 
 	 * Use the default configuration for the IRQs 0-15.  These may be
 	 * overriden by (MADT) interrupt source override entries.
@@ -1162,17 +1175,24 @@
 
 		if (i == 2) continue;			/* Don't connect IRQ2 */
 
-		intsrc.mpc_irqtype = i ? mp_INT : mp_ExtINT;   /* 8259A to #0 */
-		intsrc.mpc_srcbusirq = i;		   /* Identity mapped */
-		intsrc.mpc_dstirq = i;
+		mp_irqs[mp_irq_entries].mpc_type = MP_INTSRC;
+		mp_irqs[mp_irq_entries].mpc_irqflag = 0;	/* Conforming */
+		mp_irqs[mp_irq_entries].mpc_srcbus = MP_ISA_BUS;
+		mp_irqs[mp_irq_entries].mpc_dstapic = mp_ioapics[ioapic].mpc_apicid;
+		mp_irqs[mp_irq_entries].mpc_irqtype = i ? mp_INT : mp_ExtINT;   /* 8259A to #0 */
+		mp_irqs[mp_irq_entries].mpc_srcbusirq = i;	   /* Identity mapped */
+		mp_irqs[mp_irq_entries].mpc_dstirq = i;
 
 		Dprintk("Int: type %d, pol %d, trig %d, bus %d, irq %d, "
-			"%d-%d\n", intsrc.mpc_irqtype, intsrc.mpc_irqflag & 3, 
-			(intsrc.mpc_irqflag >> 2) & 3, intsrc.mpc_srcbus, 
-			intsrc.mpc_srcbusirq, intsrc.mpc_dstapic, 
-			intsrc.mpc_dstirq);
+			"%d-%d\n", 
+			mp_irqs[mp_irq_entries].mpc_irqtype, 
+			mp_irqs[mp_irq_entries].mpc_irqflag & 3, 
+			(mp_irqs[mp_irq_entries].mpc_irqflag >> 2) & 3, 
+			mp_irqs[mp_irq_entries].mpc_srcbus, 
+			mp_irqs[mp_irq_entries].mpc_srcbusirq, 
+			mp_irqs[mp_irq_entries].mpc_dstapic, 
+			mp_irqs[mp_irq_entries].mpc_dstirq);
 
-		mp_irqs[mp_irq_entries] = intsrc;
 		if (++mp_irq_entries == MAX_IRQ_SOURCES)
 			panic("Max # of irq sources exceeded!\n");
 	}

^ permalink raw reply	[flat|nested] 5+ messages in thread
* RE: [PATCH] fix for 2.4.21-pre2 and acpi-20021212
@ 2003-01-03 19:58 Grover, Andrew
  0 siblings, 0 replies; 5+ messages in thread
From: Grover, Andrew @ 2003-01-03 19:58 UTC (permalink / raw)
  To: joergprante-UIqTAjE4tzc5WgrkcBd8vg,
	acpi-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f
  Cc: margitsw-zqRNUXuvxA0b1SvskN2V4Q

> From: Jörg Prante [mailto:joergprante-UIqTAjE4tzc5WgrkcBd8vg@public.gmane.org] 
> this patch is needed for acpi-20021212 with 2.4.21-pre2 on a 
> Pentium 4 with 
> ACPI IO-APIC. The dynamic MP busses and IRQ_SOURCES in 
> 2.4.21-pre2 introduced 
> a conflict that will rise NULL pointer dereferences when 
> combined with the 
> ACPI patch. I don't have the hardware to test it, but Margit 
> Schubert-While 
> reported a successful boot.
> 
> http://infolinux.de/jp/087_acpi-mpparse-fix

Excellent! Thanks, applied.

Regards -- Andy


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf

^ permalink raw reply	[flat|nested] 5+ messages in thread
[parent not found: <F760B14C9561B941B89469F59BA3A847137F23@orsmsx401.jf.intel. com>]

end of thread, other threads:[~2003-01-07 17:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-03 19:48 [PATCH] fix for 2.4.21-pre2 and acpi-20021212 Jörg Prante
  -- strict thread matches above, loose matches on Subject: below --
2003-01-03 19:58 Grover, Andrew
     [not found] <F760B14C9561B941B89469F59BA3A847137F23@orsmsx401.jf.intel. com>
2003-01-03 21:42 ` Margit Schubert-While
     [not found]   ` <4.3.2.7.2.20030103222354.00ae1aa0-KvFWrsCPMkLbFfAX06+HdQ@public.gmane.org>
2003-01-06 17:52     ` Ducrot Bruno
     [not found]       ` <20030106175205.GC374-j6u/t2rXLliUoIHC/UFpr9i2O/JbrIOy@public.gmane.org>
2003-01-07 17:42         ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox