All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Best way to port device driver to RTAI/fusion
@ 2005-10-13 14:28 Sean McGranaghan
  2005-10-13 14:50 ` Jan Kiszka
  2005-10-13 15:05 ` Philippe Gerum
  0 siblings, 2 replies; 3+ messages in thread
From: Sean McGranaghan @ 2005-10-13 14:28 UTC (permalink / raw)
  To: xenomai

Hello all,

My name is Sean McGranaghan, I am a software engineer working in 
Rochester, NY. USA. I have recently been tasked with porting a standard 
Linux driver to the RTAI/fusion environment. I have RTAI/fusion 0.8.3 up 
and running with a 2.6.13 kernel. I have a couple general questions, 
followed by my specific problem. I apologize for the length of this post 
in advance, this is my first foray into RTAI/fusion. Please direct this 
message as appropriate.

When a realtime RTAI native or LXRT task performs io using a vanilla 
Linux driver, does it retain its realtime scheduling priority via the 
nucleaus scheduler or is the task demoted to the non-realtime domain 
i.e. the Linux scheduler? Assume the vanilla Linux driver uses 
wake_up_interruptible() to wake Linux tasks.

Is there a standard approach to making a driver "realtime"? I would 
assume replacing the interrupt handling, synchronization and task 
scheduling calls with RTAI/fusion equivalents would be the approach to 
take. How does this affect the file operations interface in Linux? 
(open(), close(), read(), write(), ioctl() etc.) Is this driver still 
usable by non-realtime Linux tasks?

My specific problem is to make an existing Linux driver "realtime". 
(Vague requirement I know.) The driver is for an ISA CAN bus card. The 
card contains two CAN controllers using two irqs. My first step was to 
try and get the irq handling under nucleus control. I replaced 
request_irq() and related Linux irq calls with rt_intr_create() and 
such. I was then going to look at replacing the Linux 
spin_lock_irqsave()/spin_unlock_irqrestore() and wake_interruptble() 
calls if needed. I am currently having problems with the first step.

I test the driver with a loopback cable between the two channels. In the 
pure Linux driver I send and receive datagrams with no problem. I 
receive a transmit complete interrupt immediatly followed by a message 
received interrupt for each datagram sent. When I replace the interrupt 
handling with RTAI/fusion calls I seem to be missing the receive 
interrupt. I have looked at the CAN controller register contents and 
they are consistant between the vanilla driver and realtime driver. I am 
currently trying to look at the 8259 PIC controller register contents to 
see how the interrupt handling differs. I suspect that the mixing of 
nucleaus interrupt handling and Linux spin locks (irq save/restore) is 
fouling up the PIC, but I can't prove this yet. Is there any benefit to 
moving the interrupt handling to the realtime domain?

Any help is greatly appreciated.

Thanks,
Sean McGranaghan




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

end of thread, other threads:[~2005-10-13 15:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-13 14:28 [Xenomai-help] Best way to port device driver to RTAI/fusion Sean McGranaghan
2005-10-13 14:50 ` Jan Kiszka
2005-10-13 15:05 ` Philippe Gerum

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.