All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jan Kiszka <jan.kiszka@siemens.com>
To: Jeff Webb <w1@codecraftsmen.org>,
	"xenomai@xenomai.org" <xenomai@xenomai.org>
Subject: Re: rt_dev_send() stalls periodic task
Date: Wed, 24 Apr 2019 16:36:05 +0200	[thread overview]
Message-ID: <965464f8-0976-364d-e07a-a5188b4bdf7b@siemens.com> (raw)
In-Reply-To: <teAgyZ99MOeKTG05UuBn4VijhPdYtJNRN66uQyusOJmxjDgqW9fDkKNoil4CPJDiUnKWYQ9P5uk2c652s7XbmYDurUmjOzlZaYqPaVfjfK0=@codecraftsmen.org>

On 24.04.19 15:05, Jeff Webb via Xenomai wrote:
>> The only difference in the serial configuration between that cross-link.c
>> app and my app was :
>> struct rtser_config :
>>           .rx_timeout        = RTSER_DEF_TIMEOUT  // infinite ,  no stall for
>> many hours in cross-link.c
>> versus:
>>           .rx_timeout        = 500000   // 500us, stalls within an hour in my
>> app
>> I don't know why an RX setting affects TX behavior. I also can't use
>> RTSER_DEF_TIMEOUT in my application or it dies when it starts up - no clue
>> why.  But I did try setting
>>     .rx_timeout        = 5000000   // 5 ms. my app doesnt stall for several
>> hours
> 
> This may not be related, but this jogged my memory about a problem I had years ago regarding rx/tx timeouts affecting the other operation.  I just took a look at rt_16550_write(), and I see:
> 
>    rtdm_toseq_init(&timeout_seq, ctx->config.rx_timeout);
> 
>    /* Make write operation atomic. */
>    ret = rtdm_mutex_timedlock(&ctx->out_lock, ctx->config.rx_timeout,
>       &timeout_seq);
> 
> This is the same code as in *_read().  I am wondering if this is a cut and paste error.  It seems like these two lines should use tx_timeout instead, but I haven't looked into the code in detail.  Maybe this is related, or maybe another bug?

That is a good catch! Copy & paste would be my theory as well... Wanna write a 
patch?

I don't think it will change the picture for the stalled tx issue, though.

Jan

-- 
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux


  reply	other threads:[~2019-04-24 14:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-24 13:05 rt_dev_send() stalls periodic task Jeff Webb
2019-04-24 14:36 ` Jan Kiszka [this message]
2019-04-26  0:41   ` Jeff Webb
  -- strict thread matches above, loose matches on Subject: below --
2019-04-15 17:28 C Smith
2019-04-16  8:03 ` Jan Kiszka
2019-04-18  6:42   ` C Smith
2019-04-18  8:36     ` Jan Kiszka
2019-04-21  4:33       ` C Smith
2019-04-21 20:10         ` Steve Freyder
2019-04-22  6:40           ` C Smith
2019-04-22  6:45             ` Jan Kiszka
2019-04-22 19:51               ` Steve Freyder
2019-04-22 20:58                 ` Steve Freyder
2019-04-22 22:56                   ` C Smith
2019-04-22 23:44                     ` Steve Freyder
2019-04-23 12:15               ` Jan Kiszka
2019-04-24  6:53                 ` C Smith
2019-04-25  7:15                 ` C Smith
2019-04-25  8:23                   ` Jan Kiszka
2019-04-26  0:59                     ` C Smith
2019-04-26 16:38                       ` 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=965464f8-0976-364d-e07a-a5188b4bdf7b@siemens.com \
    --to=jan.kiszka@siemens.com \
    --cc=w1@codecraftsmen.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.