From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Fri, 26 Apr 2019 00:41:31 +0000 From: Jeff Webb Reply-To: Jeff Webb Subject: Re: rt_dev_send() stalls periodic task Message-ID: In-Reply-To: <965464f8-0976-364d-e07a-a5188b4bdf7b@siemens.com> References: <965464f8-0976-364d-e07a-a5188b4bdf7b@siemens.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable List-Id: Discussions about the Xenomai project List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan Kiszka Cc: "xenomai@xenomai.org" =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 Original Me= ssage =E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90=E2=80=90 On Wednesday, April 24, 2019 9:36 AM, Jan Kiszka w= rote: > On 24.04.19 15:05, Jeff Webb via Xenomai wrote: > > > > The only difference in the serial configuration between that cross-li= nk.c > > > app and my app was : > > > struct rtser_config : > > > .rx_timeout =3D RTSER_DEF_TIMEOUT // infinite , no stall for > > > many hours in cross-link.c > > > versus: > > > .rx_timeout =3D 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 =3D 5000000 // 5 ms. my app doesnt stall for several > > > hours > > > > This may not be related, but this jogged my memory about a problem I ha= d 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 =3D 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 a= nd 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 m= aybe another bug? > > That is a good catch! Copy & paste would be my theory as well... Wanna wr= ite a > patch? I can't test this easily right now, but I'll try to post a patch at least. -Jeff