Re: [Xenomai-core] Kernel lockup with lapic on old AMD Athlon
Philippe Gerum wrote: On Sun, 2007-02-25 at 16:09 +0100, Wolfgang Grandegger wrote: Gilles Chanteperdrix wrote: Wolfgang Grandegger wrote: Hello, here is the boot log of an hangup of 2.6.20 with I-pipe 1.7-02 and Xenomai todays trunk. I already reported this hangup a while ago but now I get an oops. At that time Gilles said that lapic on old Athlons might be buggy. Does the attached boot log confirm this assumption? 2.6.20-rt8 is working, BTW. What I had observed with an old Athlon were some random lockups. I was trying to setup a samba print server at the time, and the lockup always occured when some windows machine was trying to use the shared printer through network. I think the IO-APIC was also enabled. Then, at some later time, I read somewhere on the internet that the IO-APIC or LAPIC could be buggy on some Athlons, so I understood what had happened to me. So, I did not investigate this issue any further. I didn't either, especially because it works with lapic disabled in the kernel config. I just thought that this oops might be useful to somebody. Does the following help? --- ksrc/arch/i386/hal.c(revision 2256) +++ ksrc/arch/i386/hal.c(working copy) @@ -119,23 +119,26 @@ } } -#if LINUX_VERSION_CODE KERNEL_VERSION(2,6,19) -irqreturn_t rthal_broadcast_to_local_timers(int irq, -void *dev_id, struct pt_regs *regs) -#else /* = 2.6.19 */ -irqreturn_t rthal_broadcast_to_local_timers(int irq, -void *dev_id) -#endif +#if LINUX_VERSION_CODE KERNEL_VERSION(2,5,0) +#include asm/smpboot.h +static inline void send_IPI_all(int vector) { -unsigned long flags; + unsigned long flags; -rthal_local_irq_save_hw(flags); -apic_wait_icr_idle(); -apic_write_around(APIC_ICR, - APIC_DM_FIXED | APIC_DEST_ALLINC | LOCAL_TIMER_VECTOR); -rthal_local_irq_restore_hw(flags); + rthal_local_irq_save_hw(flags); + apic_wait_icr_idle(); + apic_write_around(APIC_ICR, + APIC_DM_FIXED | APIC_DEST_ALLINC | INT_DEST_ADDR_MODE | LOCAL_TIMER_VECTOR); + rthal_local_irq_restore_hw(flags); +} +#else +#include mach_ipi.h +#endif -return IRQ_HANDLED; +DECLARE_LINUX_IRQ_HANDLER(rthal_broadcast_to_local_timers, irq, dev_id) +{ + send_IPI_all(LOCAL_TIMER_VECTOR); + return IRQ_HANDLED; } unsigned long rthal_timer_calibrate(void) Index: include/asm-i386/wrappers.h === --- include/asm-i386/wrappers.h (revision 2256) +++ include/asm-i386/wrappers.h (working copy) @@ -131,12 +131,19 @@ void *dev_id, struct pt_regs *regs); +#define DECLARE_LINUX_IRQ_HANDLER(fn, irq, dev_id) \ + irqreturn_t fn(int irq, void *dev_id, struct pt_regs *regs) + #define rthal_irq_chip_end(irq)rthal_irq_chip_enable(irq) #else /* = 2.6.19 */ #define rthal_irq_chip_enable(irq) ({ rthal_irq_descp(irq)-chip-enable(irq); 0; }) #define rthal_irq_chip_disable(irq) ({ rthal_irq_descp(irq)-chip-disable(irq); 0; }) #define rthal_irq_chip_end(irq) ({ rthal_irq_descp(irq)-ipipe_end(irq, rthal_irq_descp(irq)); 0; }) typedef irq_handler_t rthal_irq_host_handler_t; + +#define DECLARE_LINUX_IRQ_HANDLER(fn, irq, dev_id) \ + irqreturn_t fn(int irq, void *dev_id) + #endif #endif /* _XENO_ASM_I386_WRAPPERS_H */ Not yet. I get the following buld error: arch/i386/xenomai/built-in.o(.text+0x14): In function `rthal_broadcast_to_local_timers': include/asm-i386/mach-default/mach_ipi.h:14: undefined reference to `send_IPI_mask_bitmask' arch/i386/xenomai/built-in.o(.text+0x25):include/asm-i386/mach-default/mach_ipi.h:33: undefined reference to `__send_IPI_shortcut' make: *** [.tmp_vmlinux1] Error 1 Wolfgang. ___ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core
[Xenomai-core] Kernel lockup with lapic on old AMD Athlon
Hello, here is the boot log of an hangup of 2.6.20 with I-pipe 1.7-02 and Xenomai todays trunk. I already reported this hangup a while ago but now I get an oops. At that time Gilles said that lapic on old Athlons might be buggy. Does the attached boot log confirm this assumption? 2.6.20-rt8 is working, BTW. Thanks. Wolfgang. Linux version 2.6.20-ipipe ([EMAIL PROTECTED]) (gcc version 4.0.2 20051125 (Red Hat 4.0.2-8)) #1 PREEMPT Sun Feb 25 10:21:36 CET 2007 BIOS-provided physical RAM map: sanitize start sanitize end copy_e820_map() start: size: 0009fc00 end: 0009fc00 type: 1 copy_e820_map() type is E820_RAM copy_e820_map() start: 0009fc00 size: 0400 end: 000a type: 2 copy_e820_map() start: 000f size: 0001 end: 0010 type: 2 copy_e820_map() start: 0010 size: 1fef end: 1fff type: 1 copy_e820_map() type is E820_RAM copy_e820_map() start: 1fff size: 3000 end: 1fff3000 type: 4 copy_e820_map() start: 1fff3000 size: d000 end: 2000 type: 3 copy_e820_map() start: size: 0001 end: 0001 type: 2 BIOS-e820: - 0009fc00 (usable) BIOS-e820: 0009fc00 - 000a (reserved) BIOS-e820: 000f - 0010 (reserved) BIOS-e820: 0010 - 1fff (usable) BIOS-e820: 1fff - 1fff3000 (ACPI NVS) BIOS-e820: 1fff3000 - 2000 (ACPI data) BIOS-e820: - 0001 (reserved) 0MB HIGHMEM available. 511MB LOWMEM available. Zone PFN ranges: DMA 0 - 4096 Normal 4096 - 131056 HighMem131056 - 131056 early_node_map[1] active PFN ranges 0:0 - 131056 DMI 2.2 present. ACPI: PM-Timer IO Port: 0x4008 Allocating PCI resources starting at 3000 (gap: 2000:dfff) Detected 1099.576 MHz processor. Built 1 zonelists. Total pages: 130033 Kernel command line: ro root=LABEL=/ rhgb console=tty0 console=ttyS1,19200 lapicLocal APIC disabled by BIOS -- reenabling. Found and enabled local APIC! Enabling fast FPU save and restore... done. Initializing CPU#0 CPU 0 irqstacks, hard=c0434000 soft=c0435000 PID hash table entries: 2048 (order: 11, 8192 bytes) I-pipe 1.7-02: pipeline enabled. Console: colour VGA+ 80x25 Dentry cache hash table entries: 65536 (order: 6, 262144 bytes) Inode-cache hash table entries: 32768 (order: 5, 131072 bytes) Memory: 514108k/524224k available (2165k kernel code, 9552k reserved, 872k data, 216k init, 0k highmem) virtual kernel memory layout: fixmap : 0xfff9c000 - 0xf000 ( 396 kB) pkmap : 0xff80 - 0xffc0 (4096 kB) vmalloc : 0xe080 - 0xff7fe000 ( 495 MB) lowmem : 0xc000 - 0xdfff ( 511 MB) .init : 0xc03f9000 - 0xc042f000 ( 216 kB) .data : 0xc031d467 - 0xc03f75d0 ( 872 kB) .text : 0xc010 - 0xc031d467 (2165 kB) Checking if this processor honours the WP bit even in supervisor mode... Ok. Calibrating delay using timer specific routine.. 2199.58 BogoMIPS (lpj=1099790) Security Framework v1.0.0 initialized SELinux: Initializing. SELinux: Starting in permissive mode selinux_register_security: Registering secondary module capability Capability LSM initialized as secondary Mount-cache hash table entries: 512 CPU: L1 I Cache: 64K (64 bytes/line), D cache 64K (64 bytes/line) CPU: L2 Cache: 256K (64 bytes/line) Intel machine check architecture supported. Intel machine check reporting enabled on CPU#0. CPU: AMD Athlon(tm) Processor stepping 02 Checking 'hlt' instruction... OK. ACPI: Core revision 20060707 ACPI: setting ELCR to 0800 (from 0e20) NET: Registered protocol family 16 ACPI: bus type pci registered PCI: PCI BIOS revision 2.10 entry at 0xfb250, last bus=1 PCI: Using configuration type 1 Setting up standard PCI resources ACPI: Interpreter enabled ACPI: Using PIC for interrupt routing ACPI: PCI Root Bridge [PCI0] (:00) ACPI: Assume root bridge [\_SB_.PCI0] bus is 0 Disabling VIA memory write queue (PCI ID 0305, rev 03): [55] 89 1f - 09 PCI quirk: region 6000-607f claimed by vt82c686 HW-mon PCI quirk: region 5000-500f claimed by vt82c686 SMB ACPI: PCI Interrupt Link [LNKA] (IRQs 1 3 4 5 6 7 10 11 12 14 15) *9 ACPI: PCI Interrupt Link [LNKB] (IRQs 1 3 4 *5 6 7 10 11 12 14 15) ACPI: PCI Interrupt Link [LNKC] (IRQs 1 3 4 5 6 7 *10 11 12 14 15) ACPI: PCI Interrupt Link [LNKD] (IRQs 1 3 4 5 6 7 10 *11 12 14 15) Linux Plug and Play Support v0.97 (c) Adam Belay pnp: PnP ACPI init pnp: PnP ACPI: found 12 devices usbcore: registered new interface driver usbfs usbcore: registered new interface driver hub usbcore: registered new device driver usb PCI: Using ACPI for IRQ routing PCI: If a device doesn't work, try pci=routeirq. If it helps, post a report PCI: Bridge: :00:01.0 IO window: 9000-9fff MEM window:
Re: [Xenomai-core] Kernel lockup with lapic on old AMD Athlon
Wolfgang Grandegger wrote: Hello, here is the boot log of an hangup of 2.6.20 with I-pipe 1.7-02 and Xenomai todays trunk. I already reported this hangup a while ago but now I get an oops. At that time Gilles said that lapic on old Athlons might be buggy. Does the attached boot log confirm this assumption? 2.6.20-rt8 is working, BTW. What I had observed with an old Athlon were some random lockups. I was trying to setup a samba print server at the time, and the lockup always occured when some windows machine was trying to use the shared printer through network. I think the IO-APIC was also enabled. Then, at some later time, I read somewhere on the internet that the IO-APIC or LAPIC could be buggy on some Athlons, so I understood what had happened to me. So, I did not investigate this issue any further. -- Gilles Chanteperdrix. ___ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core
Re: [Xenomai-core] Kernel lockup with lapic on old AMD Athlon
Gilles Chanteperdrix wrote: Wolfgang Grandegger wrote: Hello, here is the boot log of an hangup of 2.6.20 with I-pipe 1.7-02 and Xenomai todays trunk. I already reported this hangup a while ago but now I get an oops. At that time Gilles said that lapic on old Athlons might be buggy. Does the attached boot log confirm this assumption? 2.6.20-rt8 is working, BTW. What I had observed with an old Athlon were some random lockups. I was trying to setup a samba print server at the time, and the lockup always occured when some windows machine was trying to use the shared printer through network. I think the IO-APIC was also enabled. Then, at some later time, I read somewhere on the internet that the IO-APIC or LAPIC could be buggy on some Athlons, so I understood what had happened to me. So, I did not investigate this issue any further. I didn't either, especially because it works with lapic disabled in the kernel config. I just thought that this oops might be useful to somebody. Wolfgang. ___ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core
Re: [Xenomai-core] Kernel lockup with lapic on old AMD Athlon
On Sun, 2007-02-25 at 16:09 +0100, Wolfgang Grandegger wrote: Gilles Chanteperdrix wrote: Wolfgang Grandegger wrote: Hello, here is the boot log of an hangup of 2.6.20 with I-pipe 1.7-02 and Xenomai todays trunk. I already reported this hangup a while ago but now I get an oops. At that time Gilles said that lapic on old Athlons might be buggy. Does the attached boot log confirm this assumption? 2.6.20-rt8 is working, BTW. What I had observed with an old Athlon were some random lockups. I was trying to setup a samba print server at the time, and the lockup always occured when some windows machine was trying to use the shared printer through network. I think the IO-APIC was also enabled. Then, at some later time, I read somewhere on the internet that the IO-APIC or LAPIC could be buggy on some Athlons, so I understood what had happened to me. So, I did not investigate this issue any further. I didn't either, especially because it works with lapic disabled in the kernel config. I just thought that this oops might be useful to somebody. Does the following help? --- ksrc/arch/i386/hal.c(revision 2256) +++ ksrc/arch/i386/hal.c(working copy) @@ -119,23 +119,26 @@ } } -#if LINUX_VERSION_CODE KERNEL_VERSION(2,6,19) -irqreturn_t rthal_broadcast_to_local_timers(int irq, -void *dev_id, struct pt_regs *regs) -#else /* = 2.6.19 */ -irqreturn_t rthal_broadcast_to_local_timers(int irq, -void *dev_id) -#endif +#if LINUX_VERSION_CODE KERNEL_VERSION(2,5,0) +#include asm/smpboot.h +static inline void send_IPI_all(int vector) { -unsigned long flags; + unsigned long flags; -rthal_local_irq_save_hw(flags); -apic_wait_icr_idle(); -apic_write_around(APIC_ICR, - APIC_DM_FIXED | APIC_DEST_ALLINC | LOCAL_TIMER_VECTOR); -rthal_local_irq_restore_hw(flags); + rthal_local_irq_save_hw(flags); + apic_wait_icr_idle(); + apic_write_around(APIC_ICR, + APIC_DM_FIXED | APIC_DEST_ALLINC | INT_DEST_ADDR_MODE | LOCAL_TIMER_VECTOR); + rthal_local_irq_restore_hw(flags); +} +#else +#include mach_ipi.h +#endif -return IRQ_HANDLED; +DECLARE_LINUX_IRQ_HANDLER(rthal_broadcast_to_local_timers, irq, dev_id) +{ + send_IPI_all(LOCAL_TIMER_VECTOR); + return IRQ_HANDLED; } unsigned long rthal_timer_calibrate(void) Index: include/asm-i386/wrappers.h === --- include/asm-i386/wrappers.h (revision 2256) +++ include/asm-i386/wrappers.h (working copy) @@ -131,12 +131,19 @@ void *dev_id, struct pt_regs *regs); +#define DECLARE_LINUX_IRQ_HANDLER(fn, irq, dev_id) \ + irqreturn_t fn(int irq, void *dev_id, struct pt_regs *regs) + #define rthal_irq_chip_end(irq)rthal_irq_chip_enable(irq) #else /* = 2.6.19 */ #define rthal_irq_chip_enable(irq) ({ rthal_irq_descp(irq)-chip-enable(irq); 0; }) #define rthal_irq_chip_disable(irq) ({ rthal_irq_descp(irq)-chip-disable(irq); 0; }) #define rthal_irq_chip_end(irq) ({ rthal_irq_descp(irq)-ipipe_end(irq, rthal_irq_descp(irq)); 0; }) typedef irq_handler_t rthal_irq_host_handler_t; + +#define DECLARE_LINUX_IRQ_HANDLER(fn, irq, dev_id) \ + irqreturn_t fn(int irq, void *dev_id) + #endif #endif /* _XENO_ASM_I386_WRAPPERS_H */ -- Philippe. ___ Xenomai-core mailing list Xenomai-core@gna.org https://mail.gna.org/listinfo/xenomai-core