All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@domain.hid>
To: rpm@xenomai.org
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] Kernel lockup with lapic on old AMD Athlon
Date: Mon, 26 Feb 2007 15:54:30 +0100	[thread overview]
Message-ID: <45E2F4A6.4090005@domain.hid> (raw)
In-Reply-To: <1172498970.1764.125.camel@domain.hid>

Philippe Gerum wrote:
> On Mon, 2007-02-26 at 10:08 +0100, Wolfgang Grandegger wrote:
>> 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.
>>>>
> 
> Ok, next try:
> 
> --- ksrc/arch/i386/hal.c	(revision 2256)
> +++ ksrc/arch/i386/hal.c	(working copy)
> @@ -119,23 +119,30 @@
>      }
>  }
>  
> -#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 | 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)
> +{
> +#ifdef CONFIG_SMP
> +	send_IPI_all(LOCAL_TIMER_VECTOR);
> +#else
> +	rthal_trigger_irq(LOCAL_TIMER_VECTOR -  FIRST_EXTERNAL_VECTOR);
> +#endif
> +	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 */

That one worked. At least the kernel boots now.

Thanks.

Wolfgang.


      reply	other threads:[~2007-02-26 14:54 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-25 10:25 [Xenomai-core] Kernel lockup with lapic on old AMD Athlon Wolfgang Grandegger
2007-02-25 13:58 ` Gilles Chanteperdrix
2007-02-25 15:09   ` Wolfgang Grandegger
2007-02-25 22:03     ` Philippe Gerum
2007-02-26  9:08       ` Wolfgang Grandegger
2007-02-26 14:09         ` Philippe Gerum
2007-02-26 14:54           ` Wolfgang Grandegger [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=45E2F4A6.4090005@domain.hid \
    --to=wg@domain.hid \
    --cc=rpm@xenomai.org \
    --cc=xenomai@xenomai.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.