All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@domain.hid>
To: Jean-Luc Pamart <jlpamart@domain.hid>
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] Execution error with rtdm heartbeat example
Date: Fri, 13 Apr 2007 23:42:40 +0200	[thread overview]
Message-ID: <461FF950.7080608@domain.hid> (raw)
In-Reply-To: <461FE560.8070100@domain.hid>

[-- Attachment #1: Type: text/plain, Size: 1830 bytes --]

Jean-Luc Pamart wrote:
> Hello
> 
> I  try to execute the heartbeat example (xenomai 2.3 with kernel 2.6.19)
> With the unmodified sources when the heartbeat module
> is being unloaded (rmmod)  I obtain :
> 
> atkbd.c: Spurious ACK on isa0060/serio0. Some program might be trying 
> access hardware directly.  
> 
> and the unloading can't be finished.
> 
> I try to slightly change the sources. It works with no bad kernel 
> message and
> complete unloaded with this modification :
> 
> void heartbeat(void *cookie)
> {
>        
>         while (!end) {
>               ...
>         }
>     set_leds(0);
>     
> }
> void cleanup_module(void)
> {
>     //  set_leds(0);
> }  
> 
> My interpretation :
> In the non modified example, We try to access directly to the keyboard
> after the end of the rt-driver(after  
> rtdm_task_join_nrt(&heartbeat_task, 100);)
> So it is a problem for the kernel.

Hmm, the problem might be that set_leds(0) gets preempted. Could you try

local_irq_disable();
set_leds(0);
local_irq_enable();

for cleanup_module()?

Yes, this demo accesses shared hardware directly, and that can confuse
Linux or cause even worse situations. Moreover, this high-prio task also
causes fairly high latencies. So it is nothing for serious use anyway.
But if we can improve obvious issues, there is no need to hesitate.

> 
> Is it a good interpretation ?
>  
> what is the difference between rtdm_task_join_nrt(&heartbeat_task, 100) and
>  rtdm_task_destroy(&heartbeat_task) ?
> What is the role of the polling argument (value 100) ?

Not being too lazy to answer, but I would like to know if the doc is
improvable: Did you read the API documentation [1]?

Jan

[1]http://www.xenomai.org/documentation/branches/v2.3.x/html/api/group__rtdmtask.html


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 250 bytes --]

  reply	other threads:[~2007-04-13 21:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-13 20:17 [Xenomai-help] Execution error with rtdm heartbeat example Jean-Luc Pamart
2007-04-13 21:42 ` Jan Kiszka [this message]
2007-04-14 13:51   ` Jean-Luc Pamart
2007-04-15 12:54     ` Jan Kiszka
2007-04-17  6:44       ` Jean-Luc Pamart
2007-04-17  9:19         ` Jan Kiszka

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=461FF950.7080608@domain.hid \
    --to=jan.kiszka@domain.hid \
    --cc=jlpamart@domain.hid \
    --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.