All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@domain.hid>
To: Minh GIANG <giang.hminh@domain.hid>
Cc: xenomai-help <xenomai@xenomai.org>
Subject: Re: [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT
Date: Mon, 02 Apr 2012 18:38:02 +0200	[thread overview]
Message-ID: <4F79D5EA.3010501@domain.hid> (raw)
In-Reply-To: <CAGq8jPhqv16jgPQh631x8S2MmDhm1F4HtnrQA0xsGPe4bTo6eA@mail.gmail.com>

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

On 04/02/2012 10:25 AM, Minh GIANG wrote:
> hello,
> 
> i don't know how call the function rt_dev_ioctl() after the timeout
> happened, this function is called in the begining of "while" loop
> (cross-link program).
> I get the value of struct  rtser_status,
> line status = 96
> modem status = 176
> to be honest, i don't know why cross-line program works without the
> function  rt_dev_ioctl() with  RTSER_RTIOC_WAIT_EVENT in  option.
> 
> main : write-file opened
> main : write-config written
> main : read-file opened
> main : read-config written
> main : write-task created
> main : read-task created
> main : starting write-task
> main : starting read-task
>  Nr |   write->irq    |    irq->read    |   write->read   |
> -----------------------------------------------------------
>   0 |17113389816533987823 |1333354257183912191 |         8348398
>   1 |17113389815533997483 |1333354258183885264 |         8331131
>   2 |17113389814533998100 |1333354259183882033 |         8328517
>   3 |17113389813534000420 |1333354260183884535 |         8333339
>   4 |17113389812533998430 |1333354261183888665 |         8335479
> ......
> 
> i tried to send a character table, and it also worked.

Hm, maybe you receive something, but the numbers are bogous. To
understand better what's going on, coud you please apply the attached
patch to your Xenomai tree, rebuild the kernel and send the dmesg output
while running cross-link.

BTW: what Xenomai version are you using?

Wolfgang.

> On Fri, Mar 30, 2012 at 4:48 PM, Wolfgang Grandegger <wg@domain.hid>wrote:
> 
>> On 03/30/2012 04:34 PM, Minh GIANG wrote:
>>> hi,
>>>
>>> with option RTSER_RTIOC_WAIT_EVENT in rt_dev_ioctl(), this function
>> returns
>>> un number -110 (Connection timed out)
>>> with option RTSER_RTIOC_GET_STATUS in rt_dev_ioctl(), this function
>> returns
>>> un number 0 (not message)
>>
>> You should call this function *after* the timeout happened. What does
>> the "struct rtser_status"  contain? Especially the "line_status" is of
>> interest.
>>
>>>
>>> Anyway, currently it works without  rt_dev_ioctl(), i can see
>> rt_dev_read()
>>> wait data event (with debug mode) while giving the period of write
>>> task,  for exemple  = two seconds.
>>>
>>> so can i remove the funtion rt_dev_ioctl?
>>
>> The rt_dev_ioctl should work. You can remove it, but the problem will
>> remain. To debug the problem you could also add some printk's here:
>>
>>
>> http://www.rts.uni-hannover.de/xenomai/lxr/source/ksrc/drivers/serial/16550A.c#223
>>
>> Especially the value of "iir" might be interesting.
>>
>> Wolfgang.
>>
> 


[-- Attachment #2: 16550A-irq-debug.patch --]
[-- Type: text/x-diff, Size: 617 bytes --]

diff --git a/ksrc/drivers/serial/16550A.c b/ksrc/drivers/serial/16550A.c
index 3672539..392c4f7 100644
--- a/ksrc/drivers/serial/16550A.c
+++ b/ksrc/drivers/serial/16550A.c
@@ -240,6 +240,7 @@ static int rt_16550_interrupt(rtdm_irq_t * irq_context)
 
 	while (1) {
 		iir = rt_16550_reg_in(mode, base, IIR) & IIR_MASK;
+		printk("base=%#lx iir=%#x\n", base, iir);
 		if (testbits(iir, IIR_PIRQ))
 			break;
 
@@ -258,6 +259,7 @@ static int rt_16550_interrupt(rtdm_irq_t * irq_context)
 				events |= RTSER_EVENT_MODEMLO;
 		}
 
+		printk("base=%#lx status=%#x\n", base, ctx->status);
 		ret = RTDM_IRQ_HANDLED;
 	}
 

  reply	other threads:[~2012-04-02 16:38 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-29 15:26 [Xenomai-help] Cross-link.c ---RTSER_RTIOC_WAIT_EVENT Minh GIANG
2012-03-30  6:43 ` Wolfgang Grandegger
     [not found]   ` <CAGq8jPioLnu+ehj+LA5dL6OWUpxQnUH+Nh01kB088FtsLsSrGA@mail.gmail.com>
     [not found]     ` <CAGq8jPi4S4TTBy9dLYYnWuWQdX_awhXxu0C93okgFO5vWv_20A@mail.gmail.com>
2012-03-30 13:31       ` Wolfgang Grandegger
2012-03-30 14:34         ` Minh GIANG
2012-03-30 14:48           ` Wolfgang Grandegger
2012-04-02  8:25             ` Minh GIANG
2012-04-02 16:38               ` Wolfgang Grandegger [this message]
2012-04-04  9:18                 ` Minh GIANG
2012-04-05 10:56                   ` Wolfgang Grandegger
2012-04-05 12:36                     ` Minh GIANG
     [not found]                       ` <CAGq8jPgON96yy7_wOCSs83QwxVrfSsTn-fe1P+EBZ8-KLMfj0A@mail.gmail.com>
2012-04-11 14:19                         ` Wolfgang Grandegger
     [not found]                           ` <CAGq8jPhmG-Zad1EpcVitzW9aY0rvA-4asb2f9Ncfs8FZ6D2CyQ@mail.gmail.com>
2012-04-11 16:10                             ` Wolfgang Grandegger
2012-04-11 16:56                           ` Gilles Chanteperdrix
2012-04-11 16:59                             ` Gilles Chanteperdrix
2012-04-11 19:01                               ` Wolfgang Grandegger
2012-04-11 20:51                                 ` Minh GIANG
2012-04-12  7:52                                   ` Wolfgang Grandegger
2012-04-12  8:51                                     ` Minh GIANG
2012-04-12 16:31                                       ` Wolfgang Grandegger
2012-04-25  9:11                                         ` Minh GIANG
2012-04-25  9:27                                           ` Wolfgang Grandegger

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=4F79D5EA.3010501@domain.hid \
    --to=wg@domain.hid \
    --cc=giang.hminh@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.