[PATCH] Compile fix for ACPI in 2.4.22/x86-64 Marcelo unfortunately added an last minute ACPI update that changed ACPI interfaces and broke x86-64 compilation. I didn't catch it in time, so 2.4.22 does not compile out of the box for AMD64. This patch fixes it. You'll have to apply it when compiling 2.4.22 for x86-64 -Andi All diffs for ChangeSet 1.1074 diff -Nru a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c --- a/arch/x86_64/kernel/io_apic.c Tue Jun 24 13:45:14 2003 +++ b/arch/x86_64/kernel/io_apic.c Fri Aug 22 03:38:16 2003 @@ -1762,7 +1762,7 @@ } -int io_apic_set_pci_routing (int ioapic, int pin, int irq) +int io_apic_set_pci_routing (int ioapic, int pin, int irq, int edge_level ,int active_high_low) { struct IO_APIC_route_entry entry; unsigned long flags; @@ -1785,18 +1785,21 @@ entry.dest_mode = INT_DELIVERY_MODE; entry.dest.logical.logical_dest = TARGET_CPUS; entry.mask = 1; /* Disabled (masked) */ - entry.trigger = 1; /* Level sensitive */ - entry.polarity = 1; /* Low active */ + entry.trigger = edge_level; + entry.polarity = active_high_low; add_pin_to_irq(irq, ioapic, pin); entry.vector = assign_irq_vector(irq); printk(KERN_DEBUG "IOAPIC[%d]: Set PCI routing entry (%d-%d -> 0x%x -> " - "IRQ %d)\n", ioapic, - mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq); + "IRQ %d) Mode:%i Active:%i\n", ioapic, + mp_ioapics[ioapic].mpc_apicid, pin, entry.vector, irq, edge_level, active_high_low); - irq_desc[irq].handler = &ioapic_level_irq_type; + if (edge_level) + irq_desc[irq].handler = &ioapic_level_irq_type; + else + irq_desc[irq].handler = &ioapic_edge_irq_type; set_intr_gate(entry.vector, interrupt[irq]); diff -Nru a/arch/x86_64/kernel/mpparse.c b/arch/x86_64/kernel/mpparse.c --- a/arch/x86_64/kernel/mpparse.c Tue Jun 24 14:01:06 2003 +++ b/arch/x86_64/kernel/mpparse.c Fri Aug 22 03:29:25 2003 @@ -923,7 +923,7 @@ ioapic_pin = irq - mp_ioapic_routing[ioapic].irq_start; - io_apic_set_pci_routing(ioapic, ioapic_pin, irq); + io_apic_set_pci_routing(ioapic, ioapic_pin, irq, 1, 1); } #endif /*CONFIG_ACPI_HT_ONLY*/ @@ -939,6 +939,8 @@ int ioapic_pin = 0; int irq = 0; int idx, bit = 0; + int edge_level = 0; + int active_high_low = 0; /* * Parsing through the PCI Interrupt Routing Table (PRT) and program @@ -949,11 +951,14 @@ /* Need to get irq for dynamic entry */ if (entry->link.handle) { - irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index); + irq = acpi_pci_link_get_irq(entry->link.handle, entry->link.index, &edge_level, &active_high_low); if (!irq) continue; - } else + } else { + edge_level = 1; + active_high_low = 1; irq = entry->link.index; + } irq = entry->link.index; ioapic = mp_find_ioapic(irq); @@ -983,7 +988,7 @@ mp_ioapic_routing[ioapic].pin_programmed[idx] |= (1<irq = irq; diff -Nru a/include/asm-x86_64/io_apic.h b/include/asm-x86_64/io_apic.h --- a/include/asm-x86_64/io_apic.h Sat Aug 9 13:32:28 2003 +++ b/include/asm-x86_64/io_apic.h Fri Aug 22 03:29:25 2003 @@ -148,6 +148,6 @@ extern int io_apic_get_unique_id (int ioapic, int apic_id); extern int io_apic_get_version (int ioapic); extern int io_apic_get_redir_entries (int ioapic); -extern int io_apic_set_pci_routing (int ioapic, int pin, int irq); +extern int io_apic_set_pci_routing (int ioapic, int pin, int irq, int, int); #endif ChangeSet@1.1065.1.36 03-08-25 13:58:04-03:00 willy@ods.org all diffs [PATCH] Fix amd67x_pm.c crash with no chipsets / CONFIG_HOTPLUG amd76x_pm.c will crash if no chipsets are found and CONFIG_HOTPLUG is turned on. This patch makes it return with a failure instead. diff -Nru a/drivers/char/amd76x_pm.c b/drivers/char/amd76x_pm.c --- a/drivers/char/amd76x_pm.c Mon Aug 25 09:51:20 2003 +++ b/drivers/char/amd76x_pm.c Mon Aug 25 04:22:01 2003 @@ -577,16 +577,18 @@ int found; /* Find northbridge */ - found = pci_module_init(&amd_nb_driver); - if (found < 0) { + found = pci_register_driver(&amd_nb_driver); + if (found <= 0) { printk(KERN_ERR "amd76x_pm: Could not find northbridge\n"); + pci_unregister_driver(&amd_nb_driver); return 1; } /* Find southbridge */ - found = pci_module_init(&amd_sb_driver); - if (found < 0) { + found = pci_register_driver(&amd_sb_driver); + if (found <= 0) { printk(KERN_ERR "amd76x_pm: Could not find southbridge\n"); + pci_unregister_driver(&amd_sb_driver); pci_unregister_driver(&amd_nb_driver); return 1; } @@ -620,6 +622,8 @@ #ifndef AMD76X_NTH if (!amd76x_pm_cfg.curr_idle) { printk(KERN_ERR "amd76x_pm: Idle function not changed\n"); + pci_unregister_driver(&amd_nb_driver); + pci_unregister_driver(&amd_sb_driver); return 1; } From chas@cmf.nrl.navy.mil Tue Aug 26 13:08:22 2003 Date: Tue, 26 Aug 2003 13:46:34 -0400 From: chas williams To: Lukasz Trabinski Cc: linux-kernel@vger.kernel.org, linux-atm-general@lists.sourceforge.net, Bartlomiej Solarz-Niesluchowski Subject: Re: linux-2.4.22 Oops on ATM PCA-200EPC In message ,Lukasz Tra binski writes: >I have always used vanilla kernel with very old patch for ATM >(name: linux-2.3.99-pre6-fore200e-0.2f.patch) It worked well - >trouble-free. >I have just tried vanilla 2.4.22, here is oops. ATM doesn't work :( yep, i screwed that up. when clip isnt a module, the common code try to manipulate the module count while fails. see if this patch makes it better -- apply with patch -p1 in your linux source tree. --- linux-2.4.22/net/atm/common.c.000 Tue Aug 26 10:40:30 2003 +++ linux-2.4.22/net/atm/common.c Tue Aug 26 13:12:35 2003 @@ -672,7 +672,8 @@ } if (try_atm_clip_ops()) { ret_val = atm_clip_ops->clip_create(arg); - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); } else ret_val = -ENOSYS; goto done; @@ -687,7 +688,8 @@ #endif if (try_atm_clip_ops()) { error = atm_clip_ops->atm_init_atmarp(vcc); - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); if (!error) sock->state = SS_CONNECTED; ret_val = error; @@ -701,7 +703,8 @@ } if (try_atm_clip_ops()) { ret_val = atm_clip_ops->clip_mkip(vcc, arg); - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); } else ret_val = -ENOSYS; goto done; @@ -712,7 +715,8 @@ } if (try_atm_clip_ops()) { ret_val = atm_clip_ops->clip_setentry(vcc, arg); - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); } else ret_val = -ENOSYS; goto done; @@ -723,7 +727,8 @@ } if (try_atm_clip_ops()) { ret_val = atm_clip_ops->clip_encap(vcc, arg); - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); } else ret_val = -ENOSYS; goto done; --- linux-2.4.22/net/atm/proc.c.000 Tue Aug 26 13:30:23 2003 +++ linux-2.4.22/net/atm/proc.c Tue Aug 26 13:31:58 2003 @@ -358,7 +358,7 @@ spin_unlock_irqrestore(&dev->lock, flags); spin_unlock(&atm_dev_lock); #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - if (clip_info) + if (clip_info && atm_clip_ops->owner) __MOD_DEC_USE_COUNT(atm_clip_ops->owner); #endif return strlen(buf); @@ -367,8 +367,8 @@ } spin_unlock(&atm_dev_lock); #if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE) - if (clip_info) - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (clip_info && atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); #endif return 0; } @@ -458,7 +458,8 @@ if (--count) continue; atmarp_info(n->dev,entry,NULL,buf); read_unlock_bh(&clip_tbl_hook->lock); - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); return strlen(buf); } for (vcc = entry->vccs; vcc; @@ -466,12 +467,14 @@ if (--count) continue; atmarp_info(n->dev,entry,vcc,buf); read_unlock_bh(&clip_tbl_hook->lock); - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); return strlen(buf); } } read_unlock_bh(&clip_tbl_hook->lock); - __MOD_DEC_USE_COUNT(atm_clip_ops->owner); + if (atm_clip_ops->owner) + __MOD_DEC_USE_COUNT(atm_clip_ops->owner); return 0; } #endif - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ --- linux-2.4.22/Makefile~ Fri Aug 26 07:54:54 2003 +++ linux-2.4.22/Makefile Fri Aug 26 07:55:50 2003 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 22 -EXTRAVERSION = +EXTRAVERSION =-uv1 KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) From linux-kernel@vger.kernel.org Wed Aug 27 15:59:09 2003 Date: Wed, 27 Aug 2003 14:07:03 +0000 From: Linux Kernel Mailing List To: bk-commits-24@vger.kernel.org Subject: Fix possible IRQ handling SMP race: Kudos to TeJun Huh ChangeSet 1.1084, 2003/08/27 11:07:03-03:00, marcelo@logos.cnet Fix possible IRQ handling SMP race: Kudos to TeJun Huh # This patch includes the following deltas: # ChangeSet 1.1083 -> 1.1084 # include/asm-i386/hardirq.h 1.4 -> 1.5 # hardirq.h | 2 ++ 1 files changed, 2 insertions(+) diff -Nru a/include/asm-i386/hardirq.h b/include/asm-i386/hardirq.h --- a/include/asm-i386/hardirq.h Wed Aug 27 08:02:39 2003 +++ b/include/asm-i386/hardirq.h Wed Aug 27 08:02:39 2003 @@ -67,6 +67,8 @@ { ++local_irq_count(cpu); + smp_mb(); + while (test_bit(0,&global_irq_lock)) { cpu_relax(); } - To unsubscribe from this list: send the line "unsubscribe bk-commits-24" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html [PATCH] Fix initrd with netboot From "Martin Persson" we've encountered a problem when trying to netboot 2.4.21 and above. After /linuxrc has been executed and the kernel tries to remount the root, it panics with the all too well known message "Unable to mount root fs on ...". The kernel bugs out in mount_block_root in the file init/do_mounts.c, to be more precise in the for-loop. What happens is that it tries to mount the file system as type ext2 (which happens to be first in the list in our case), but instead of returning -EINVAL it returns -EBUSY, the loop exits instead of trying the next (correct) fs-type and the kernel panics. In -wolk for some time and maybe others. All diffs for ChangeSet 1.1065.1.42 diff -Nru a/init/do_mounts.c b/init/do_mounts.c --- a/init/do_mounts.c Mon Jul 21 13:13:12 2003 +++ b/init/do_mounts.c Thu Jul 10 06:46:36 2003 @@ -360,6 +360,7 @@ flags |= MS_RDONLY; goto retry; case -EINVAL: + case -EBUSY: continue; } /* pcwd.c: fix oops on unload From Arkadiusz Miskiewicz This patch is from Alan Cox and fixes problems when pcwd driver is loaded while there is no pcwd hardware installed. No idea why it was not feeded to you. Problem is described here http://www.ussg.iu.edu/hypermail/linux/kernel/0308.1/0178.html and tracked down in private conversation with Cox. diff -Nru a/drivers/char/pcwd.c b/drivers/char/pcwd.c --- a/drivers/char/pcwd.c Sun Sep 29 12:29:59 2002 +++ b/drivers/char/pcwd.c Mon Aug 25 10:20:56 2003 @@ -933,8 +933,7 @@ release_region (pcwd_info.io_addr, pcwd_info.card_info->io_size); - if (pcwd_info.flags & PCWD_PCI_REG) - pci_unregister_driver (&pcwd_driver); + pci_unregister_driver (&pcwd_driver); return; } From greg@kroah.com Tue Sep 16 23:06:43 2003 Date: Fri, 5 Sep 2003 08:24:36 -0700 From: Greg KH To: Ingo Oeser Cc: linux-kernel@vger.kernel.org Subject: Re: [OOPS] 2.4.22, USB visor module crashing on HotSync. On Fri, Sep 05, 2003 at 01:30:22PM +0200, Ingo Oeser wrote: > Hi Greg, > > there seems to be a problem with the visor module and usb_serial. > > Please look at __serial_close() and usb_disconnect() calling it > in line 1406 vs. line 1408. I would suggest removing 1408 or > folding it into __serial_close(). > > Formal Bug-Reporting follows: > > [1.] One line summary of the problem: > > USB visor module and usb_serial crashing on HotSync in usb_disconnect > > [2.] Full description of the problem/report: > > usb_disconnect calls __serial_close() which sets the tty = NULL > and afterwards trys to set tty->private_data = NULL > which will crash Nice, someone else reported this yesterday for the ftdi_sio driver. Can you test the patch below and let me know if this fixes it? thanks, greg k-h --- a/drivers/usb/serial/usbserial.c Sat Aug 30 23:27:18 2003 +++ b/drivers/usb/serial/usbserial.c Thu Sep 4 13:48:45 2003 @@ -556,7 +556,10 @@ else generic_close(port, filp); port->open_count = 0; - port->tty = NULL; + if (port->tty) { + port->tty->driver_data = NULL; + port->tty = NULL; + } } if (port->serial->type->owner) @@ -1401,12 +1404,9 @@ for (i = 0; i < serial->num_ports; ++i) { port = &serial->port[i]; down (&port->sem); - if (port->tty != NULL) { - while (port->open_count > 0) { + if (port->tty != NULL) + while (port->open_count > 0) __serial_close(port, NULL); - } - port->tty->driver_data = NULL; - } up (&port->sem); } - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/