* While(1) in kernel space
@ 2008-07-08 7:55 Paolo Doz
2008-07-08 14:19 ` Grant Likely
2008-07-08 14:44 ` Chris Friesen
0 siblings, 2 replies; 6+ messages in thread
From: Paolo Doz @ 2008-07-08 7:55 UTC (permalink / raw)
To: linuxppc-dev
[-- Attachment #1: Type: text/plain, Size: 491 bytes --]
Hi folks,
I'm developing a custom SPI driver (char device) on a MPC5200b, the
microcontroller linked as slave implements a protocol that must follow
strict timing constraints. I need to receive and send messages every 6msec.
Actually there is a user space program that synchronizes the two units, but
I would prefer to eliminate it and move the relative code into the kernel
space. Is it possible to have a non returning function, with a sort of
while(1) inside?
Thanks for the help
Paolo
[-- Attachment #2: Type: text/html, Size: 515 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: While(1) in kernel space
2008-07-08 7:55 While(1) in kernel space Paolo Doz
@ 2008-07-08 14:19 ` Grant Likely
2008-07-08 14:45 ` Arnd Bergmann
2008-07-08 14:44 ` Chris Friesen
1 sibling, 1 reply; 6+ messages in thread
From: Grant Likely @ 2008-07-08 14:19 UTC (permalink / raw)
To: Paolo Doz; +Cc: linuxppc-dev
On Tue, Jul 8, 2008 at 1:55 AM, Paolo Doz <paolo.doz@gmail.com> wrote:
> Hi folks,
> I'm developing a custom SPI driver (char device) on a MPC5200b, the
> microcontroller linked as slave implements a protocol that must follow
> strict timing constraints. I need to receive and send messages every 6msec.
> Actually there is a user space program that synchronizes the two units, but
> I would prefer to eliminate it and move the relative code into the kernel
> space. Is it possible to have a non returning function, with a sort of
> while(1) inside?
>
> Thanks for the help
You can use a kernel thread.
I'm not sure how accurate this is, but here is some information about them:
http://www.linuxquestions.org/linux/articles/Technical/Linux_Kernel_Thread
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: While(1) in kernel space
2008-07-08 7:55 While(1) in kernel space Paolo Doz
2008-07-08 14:19 ` Grant Likely
@ 2008-07-08 14:44 ` Chris Friesen
1 sibling, 0 replies; 6+ messages in thread
From: Chris Friesen @ 2008-07-08 14:44 UTC (permalink / raw)
To: Paolo Doz; +Cc: linuxppc-dev
Paolo Doz wrote:
> Hi folks,
> I'm developing a custom SPI driver (char device) on a MPC5200b, the
> microcontroller linked as slave implements a protocol that must follow
> strict timing constraints. I need to receive and send messages every
> 6msec.
What are your timing requirements? How much over/under 6ms can the
protocol handle?
Kernel threads might work, but then you're at the mercy of the
scheduler. You'd probably be better off using a timer or softirq.
If the latency requirements are really strict, your best bet would
probably be to use the -rt patches for the kernel. That requires
building a custom kernel though.
Chris
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: While(1) in kernel space
2008-07-08 14:19 ` Grant Likely
@ 2008-07-08 14:45 ` Arnd Bergmann
2008-07-08 14:47 ` Grant Likely
0 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2008-07-08 14:45 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Paolo Doz
On Tuesday 08 July 2008, Grant Likely wrote:
>
> You can use a kernel thread.
>
> I'm not sure how accurate this is, but here is some information about them:
>
> http://www.linuxquestions.org/linux/articles/Technical/Linux_Kernel_Thread
Not accurate at all. New code should use kthread_create, as documented in
http://lwn.net/Articles/65178/
Arnd <><
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: While(1) in kernel space
2008-07-08 14:45 ` Arnd Bergmann
@ 2008-07-08 14:47 ` Grant Likely
2008-07-08 20:53 ` Paolo Doz
0 siblings, 1 reply; 6+ messages in thread
From: Grant Likely @ 2008-07-08 14:47 UTC (permalink / raw)
To: Arnd Bergmann; +Cc: linuxppc-dev, Paolo Doz
On Tue, Jul 8, 2008 at 8:45 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> On Tuesday 08 July 2008, Grant Likely wrote:
>
>>
>> You can use a kernel thread.
>>
>> I'm not sure how accurate this is, but here is some information about them:
>>
>> http://www.linuxquestions.org/linux/articles/Technical/Linux_Kernel_Thread
>
> Not accurate at all. New code should use kthread_create, as documented in
>
> http://lwn.net/Articles/65178/
Teach me to blindly use google. Thanks Arnd.
g.
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: While(1) in kernel space
2008-07-08 14:47 ` Grant Likely
@ 2008-07-08 20:53 ` Paolo Doz
0 siblings, 0 replies; 6+ messages in thread
From: Paolo Doz @ 2008-07-08 20:53 UTC (permalink / raw)
To: Grant Likely; +Cc: linuxppc-dev, Arnd Bergmann
[-- Attachment #1: Type: text/plain, Size: 888 bytes --]
Thanks for the infos, I'll try kernel thread or timer/softirq in the next
days.
I'll let you know which of them fit my problems.
I actually have about +/- 1msec of freedom (but still require more
investigation).
Paolo
On Tue, Jul 8, 2008 at 4:47 PM, Grant Likely <grant.likely@secretlab.ca>
wrote:
> On Tue, Jul 8, 2008 at 8:45 AM, Arnd Bergmann <arnd@arndb.de> wrote:
> > On Tuesday 08 July 2008, Grant Likely wrote:
> >
> >>
> >> You can use a kernel thread.
> >>
> >> I'm not sure how accurate this is, but here is some information about
> them:
> >>
> >>
> http://www.linuxquestions.org/linux/articles/Technical/Linux_Kernel_Thread
> >
> > Not accurate at all. New code should use kthread_create, as documented in
> >
> > http://lwn.net/Articles/65178/
>
> Teach me to blindly use google. Thanks Arnd.
>
> g.
>
> --
> Grant Likely, B.Sc., P.Eng.
> Secret Lab Technologies Ltd.
>
[-- Attachment #2: Type: text/html, Size: 1539 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-07-08 20:53 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-08 7:55 While(1) in kernel space Paolo Doz
2008-07-08 14:19 ` Grant Likely
2008-07-08 14:45 ` Arnd Bergmann
2008-07-08 14:47 ` Grant Likely
2008-07-08 20:53 ` Paolo Doz
2008-07-08 14:44 ` Chris Friesen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).