All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai] rt_task_wait_period() does not return -EWOULDBLOCK
@ 2018-04-11 13:54 Mauro Salvini
  2018-04-11 14:20 ` Philippe Gerum
  0 siblings, 1 reply; 12+ messages in thread
From: Mauro Salvini @ 2018-04-11 13:54 UTC (permalink / raw)
  To: xenomai

Hi,

I'm facing an unexpected behavior of rt_task_wait_period().

xenomai: 3.0.3
ipipe: 4.1.18-arm-9 on kernel 4.1.36 from NXP
arch: ARM
SOC: iMX6sx

Running simple attached program (compiled and linked using "xeno-config 
--alchemy --cflags" and "xeno-config --alchemy --ldflags"),
rt_task_wait_period() never returns (instead return -EWOULDBLOCK) if
rt_task_set_period() not called.

Output with SET_PERIOD defined:
Main 0
WAIT PERIOD DONE!
WAIT PERIOD DONE!
Main 2
WAIT PERIOD DONE!
WAIT PERIOD DONE!
Main 4
WAIT PERIOD DONE!
WAIT PERIOD DONE!
Main 6
...

Output with SET_PERIOD not defined:
Main 0
Main 0
Main 0
Main 0
Main 0
...

Tested also with xenomai 3.0.6 from git on latest commit (on same ipipe
and kernel).

Am I wrong somewhere?

Thank you, best regards.

Mauro
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_xeno_waitperiod.c
Type: text/x-csrc
Size: 691 bytes
Desc: not available
URL: <http://xenomai.org/pipermail/xenomai/attachments/20180411/bf7b6b1c/attachment.c>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Xenomai] rt_task_wait_period() does not return -EWOULDBLOCK
  2018-04-11 13:54 [Xenomai] rt_task_wait_period() does not return -EWOULDBLOCK Mauro Salvini
@ 2018-04-11 14:20 ` Philippe Gerum
  2018-04-11 14:39   ` Mauro Salvini
  0 siblings, 1 reply; 12+ messages in thread
From: Philippe Gerum @ 2018-04-11 14:20 UTC (permalink / raw)
  To: Mauro Salvini, xenomai

On 04/11/2018 03:54 PM, Mauro Salvini wrote:
> Hi,
> 
> I'm facing an unexpected behavior of rt_task_wait_period().
> 
> xenomai: 3.0.3
> ipipe: 4.1.18-arm-9 on kernel 4.1.36 from NXP
> arch: ARM
> SOC: iMX6sx
> 
> Running simple attached program (compiled and linked using "xeno-config 
> --alchemy --cflags" and "xeno-config --alchemy --ldflags"),
> rt_task_wait_period() never returns (instead return -EWOULDBLOCK) if
> rt_task_set_period() not called.
> 
> Output with SET_PERIOD defined:
> Main 0
> WAIT PERIOD DONE!
> WAIT PERIOD DONE!
> Main 2
> WAIT PERIOD DONE!
> WAIT PERIOD DONE!
> Main 4
> WAIT PERIOD DONE!
> WAIT PERIOD DONE!
> Main 6
> ...
> 
> Output with SET_PERIOD not defined:
> Main 0
> Main 0
> Main 0
> Main 0
> Main 0
> ...
> 
> Tested also with xenomai 3.0.6 from git on latest commit (on same ipipe
> and kernel).
> 
> Am I wrong somewhere?

Please try this and let me know if the situation gets any better:

diff --git a/lib/copperplate/threadobj.c b/lib/copperplate/threadobj.c
index cde15485a..d9e9267c9 100644
--- a/lib/copperplate/threadobj.c
+++ b/lib/copperplate/threadobj.c
@@ -1625,25 +1625,28 @@ int threadobj_set_periodic(struct threadobj *thobj,
 {				/* thobj->lock held */
 	struct itimerspec its;
 	struct sigevent sev;
+	timer_t timer;
 	int ret;
 
 	__threadobj_check_locked(thobj);
 
-	if (thobj->periodic_timer == NULL) {
+	timer = thobj->periodic_timer;
+	if (timer == NULL) {
 		memset(&sev, 0, sizeof(sev));
 		sev.sigev_signo = SIGPERIOD;
 		sev.sigev_notify = SIGEV_SIGNAL|SIGEV_THREAD_ID;
 		sev.sigev_notify_thread_id = threadobj_get_pid(thobj);
-		ret = __RT(timer_create(CLOCK_COPPERPLATE, &sev,
-					&thobj->periodic_timer));
+		ret = __RT(timer_create(CLOCK_COPPERPLATE, &sev, &timer));
 		if (ret)
 			return __bt(-errno);
-	}
+		thobj->periodic_timer = timer;
+	} else if (!timespec_scalar(idate) && !timespec_scalar(period))
+		thobj->periodic_timer = NULL;
 
 	its.it_value = *idate;
 	its.it_interval = *period;
 
-	ret = __RT(timer_settime(thobj->periodic_timer, TIMER_ABSTIME, &its, NULL));
+	ret = __RT(timer_settime(timer, TIMER_ABSTIME, &its, NULL));
 	if (ret)
 		return __bt(-errno);
 
@@ -1656,6 +1659,9 @@ int threadobj_wait_period(unsigned long *overruns_r)
 	siginfo_t si;
 	int sig;
 
+	if (current->periodic_timer == NULL)
+		return -EWOULDBLOCK;
+
 	for (;;) {
 		current->run_state = __THREAD_S_DELAYED;
 		sig = __RT(sigwaitinfo(&sigperiod_set, &si));

-- 
Philippe.


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [Xenomai] rt_task_wait_period() does not return -EWOULDBLOCK
  2018-04-11 14:20 ` Philippe Gerum
@ 2018-04-11 14:39   ` Mauro Salvini
  2018-04-11 14:42     ` Philippe Gerum
  0 siblings, 1 reply; 12+ messages in thread
From: Mauro Salvini @ 2018-04-11 14:39 UTC (permalink / raw)
  To: Philippe Gerum, xenomai

On Wed, 2018-04-11 at 16:20 +0200, Philippe Gerum wrote:
> On 04/11/2018 03:54 PM, Mauro Salvini wrote:
> > Hi,
> > 
> > I'm facing an unexpected behavior of rt_task_wait_period().
> > 
> > 

...

> Please try this and let me know if the situation gets any better:

Yes, now it works as expected.

Output with SET_PERIOD not defined is:
NON PERIODIC TASK!
Main 0
NON PERIODIC TASK!
NON PERIODIC TASK!
Main 2
NON PERIODIC TASK!
NON PERIODIC TASK!
Main 4
...

Thank you Philippe.

Best regards.

Mauro



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Xenomai] rt_task_wait_period() does not return -EWOULDBLOCK
  2018-04-11 14:39   ` Mauro Salvini
@ 2018-04-11 14:42     ` Philippe Gerum
  2018-04-18  9:21       ` Mauro Salvini
  0 siblings, 1 reply; 12+ messages in thread
From: Philippe Gerum @ 2018-04-11 14:42 UTC (permalink / raw)
  To: Mauro Salvini, xenomai

On 04/11/2018 04:39 PM, Mauro Salvini wrote:
> On Wed, 2018-04-11 at 16:20 +0200, Philippe Gerum wrote:
>> On 04/11/2018 03:54 PM, Mauro Salvini wrote:
>>> Hi,
>>>
>>> I'm facing an unexpected behavior of rt_task_wait_period().
>>>
>>>
> 
> ...
> 
>> Please try this and let me know if the situation gets any better:
> 
> Yes, now it works as expected.
> 
> Output with SET_PERIOD not defined is:
> NON PERIODIC TASK!
> Main 0
> NON PERIODIC TASK!
> NON PERIODIC TASK!
> Main 2
> NON PERIODIC TASK!
> NON PERIODIC TASK!
> Main 4
> ...
> 
> Thank you Philippe.
> 
> Best regards.
> 
> Mauro
> 
> 

Ok, upstreamed. Thanks.

-- 
Philippe.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Xenomai] rt_task_wait_period() does not return -EWOULDBLOCK
  2018-04-11 14:42     ` Philippe Gerum
@ 2018-04-18  9:21       ` Mauro Salvini
  2018-04-18 13:17         ` Pintu Kumar
  0 siblings, 1 reply; 12+ messages in thread
From: Mauro Salvini @ 2018-04-18  9:21 UTC (permalink / raw)
  To: Philippe Gerum, xenomai

On Wed, 2018-04-11 at 16:42 +0200, Philippe Gerum wrote:
> On 04/11/2018 04:39 PM, Mauro Salvini wrote:
> > On Wed, 2018-04-11 at 16:20 +0200, Philippe Gerum wrote:
> > > On 04/11/2018 03:54 PM, Mauro Salvini wrote:
> > > > Hi,
> > > > 
> > > > I'm facing an unexpected behavior of rt_task_wait_period().
> > > > 
> > > > 
> > 
> > ...
> > 
> > > Please try this and let me know if the situation gets any better:
> > 
> > Yes, now it works as expected.
> > 
> > Thank you Philippe.
> > 
> > Best regards.
> > 
> > Mauro
> > 
> > 
> 
> Ok, upstreamed. Thanks.
> 

Hi Philippe,

I resume this thread because when I tried your patch I tried only the
case that didn't work, that is with SET_PERIOD undefined
(so rt_task_set_periodic() not called), and didn't re-test also the
code with rt_task_set_periodic() call. Sorry, my fault.

With this patch applied, when I call rt_task_set_periodic() (SET_PERIOD
defined), rt_task_wait_period() returns -EWOULDBLOCK as if
rt_task_set_periodic() was never called.

Thanks in advance, regards

Mauro



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Xenomai] rt_task_wait_period() does not return -EWOULDBLOCK
  2018-04-18  9:21       ` Mauro Salvini
@ 2018-04-18 13:17         ` Pintu Kumar
  2018-04-18 13:45           ` Greg Gallagher
  0 siblings, 1 reply; 12+ messages in thread
From: Pintu Kumar @ 2018-04-18 13:17 UTC (permalink / raw)
  To: Mauro Salvini; +Cc: xenomai

Oh yes.
I was about to post the similar problem with rt_task_wait_period(NULL).

I did "git pull" for my xenomai-3 repo and installed the newer version.
After that weird things started happening to my previous test program
for latency measurement.
The latency value started giving all wrong results.
In my test programs I was using: rt_task_set_period(100 us) and
measuring latency with rt_task_wait_period(NULL).
But, now rt_task_wait_period() returns immediately.

Then, I reverted back the entire xenomai-3 to my older version.
And everything works fine for me.

So, it looks like there is some change happened in latest xenomai-3
repo, which disturbed the rt_task_wait_period API.

Please check, else all my previous efforts will go in vain.


Thanks,
Pintu



On Wed, Apr 18, 2018 at 2:51 PM, Mauro Salvini
<mauro.salvini@smigroup.net> wrote:
> On Wed, 2018-04-11 at 16:42 +0200, Philippe Gerum wrote:
>> On 04/11/2018 04:39 PM, Mauro Salvini wrote:
>> > On Wed, 2018-04-11 at 16:20 +0200, Philippe Gerum wrote:
>> > > On 04/11/2018 03:54 PM, Mauro Salvini wrote:
>> > > > Hi,
>> > > >
>> > > > I'm facing an unexpected behavior of rt_task_wait_period().
>> > > >
>> > > >
>> >
>> > ...
>> >
>> > > Please try this and let me know if the situation gets any better:
>> >
>> > Yes, now it works as expected.
>> >
>> > Thank you Philippe.
>> >
>> > Best regards.
>> >
>> > Mauro
>> >
>> >
>>
>> Ok, upstreamed. Thanks.
>>
>
> Hi Philippe,
>
> I resume this thread because when I tried your patch I tried only the
> case that didn't work, that is with SET_PERIOD undefined
> (so rt_task_set_periodic() not called), and didn't re-test also the
> code with rt_task_set_periodic() call. Sorry, my fault.
>
> With this patch applied, when I call rt_task_set_periodic() (SET_PERIOD
> defined), rt_task_wait_period() returns -EWOULDBLOCK as if
> rt_task_set_periodic() was never called.
>
> Thanks in advance, regards
>
> Mauro
>
>
> _______________________________________________
> Xenomai mailing list
> Xenomai@xenomai.org
> https://xenomai.org/mailman/listinfo/xenomai


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Xenomai] rt_task_wait_period() does not return -EWOULDBLOCK
  2018-04-18 13:17         ` Pintu Kumar
@ 2018-04-18 13:45           ` Greg Gallagher
  2018-04-18 14:31             ` Pintu Kumar
  0 siblings, 1 reply; 12+ messages in thread
From: Greg Gallagher @ 2018-04-18 13:45 UTC (permalink / raw)
  To: Pintu Kumar; +Cc: xenomai

What version was this working in?  I'm assuming you are working out of
stable-3.0.x? If you reverted to an older git commit please post the
commit.

-Greg

On Wed, Apr 18, 2018 at 9:17 AM, Pintu Kumar <pintu.ping@gmail.com> wrote:
> Oh yes.
> I was about to post the similar problem with rt_task_wait_period(NULL).
>
> I did "git pull" for my xenomai-3 repo and installed the newer version.
> After that weird things started happening to my previous test program
> for latency measurement.
> The latency value started giving all wrong results.
> In my test programs I was using: rt_task_set_period(100 us) and
> measuring latency with rt_task_wait_period(NULL).
> But, now rt_task_wait_period() returns immediately.
>
> Then, I reverted back the entire xenomai-3 to my older version.
> And everything works fine for me.
>
> So, it looks like there is some change happened in latest xenomai-3
> repo, which disturbed the rt_task_wait_period API.
>
> Please check, else all my previous efforts will go in vain.
>
>
> Thanks,
> Pintu
>
>
>
> On Wed, Apr 18, 2018 at 2:51 PM, Mauro Salvini
> <mauro.salvini@smigroup.net> wrote:
>> On Wed, 2018-04-11 at 16:42 +0200, Philippe Gerum wrote:
>>> On 04/11/2018 04:39 PM, Mauro Salvini wrote:
>>> > On Wed, 2018-04-11 at 16:20 +0200, Philippe Gerum wrote:
>>> > > On 04/11/2018 03:54 PM, Mauro Salvini wrote:
>>> > > > Hi,
>>> > > >
>>> > > > I'm facing an unexpected behavior of rt_task_wait_period().
>>> > > >
>>> > > >
>>> >
>>> > ...
>>> >
>>> > > Please try this and let me know if the situation gets any better:
>>> >
>>> > Yes, now it works as expected.
>>> >
>>> > Thank you Philippe.
>>> >
>>> > Best regards.
>>> >
>>> > Mauro
>>> >
>>> >
>>>
>>> Ok, upstreamed. Thanks.
>>>
>>
>> Hi Philippe,
>>
>> I resume this thread because when I tried your patch I tried only the
>> case that didn't work, that is with SET_PERIOD undefined
>> (so rt_task_set_periodic() not called), and didn't re-test also the
>> code with rt_task_set_periodic() call. Sorry, my fault.
>>
>> With this patch applied, when I call rt_task_set_periodic() (SET_PERIOD
>> defined), rt_task_wait_period() returns -EWOULDBLOCK as if
>> rt_task_set_periodic() was never called.
>>
>> Thanks in advance, regards
>>
>> Mauro
>>
>>
>> _______________________________________________
>> Xenomai mailing list
>> Xenomai@xenomai.org
>> https://xenomai.org/mailman/listinfo/xenomai
>
> _______________________________________________
> Xenomai mailing list
> Xenomai@xenomai.org
> https://xenomai.org/mailman/listinfo/xenomai


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Xenomai] rt_task_wait_period() does not return -EWOULDBLOCK
  2018-04-18 13:45           ` Greg Gallagher
@ 2018-04-18 14:31             ` Pintu Kumar
  2018-04-18 14:59               ` Mauro Salvini
  0 siblings, 1 reply; 12+ messages in thread
From: Pintu Kumar @ 2018-04-18 14:31 UTC (permalink / raw)
  To: Greg Gallagher; +Cc: xenomai

On Wed, Apr 18, 2018 at 7:15 PM, Greg Gallagher <greg@embeddedgreg.com> wrote:
> What version was this working in?  I'm assuming you are working out of
> stable-3.0.x? If you reverted to an older git commit please post the
> commit.
>

Sorry, I don't remember the previous working versions.
My current xeno-config is:
# xeno-config --info
Xenomai version: Xenomai/cobalt v3.0.6 -- #5956064 (2018-03-20 12:13:33 +0100)
Linux 4.9.51-x86-64-mine-xeno3-rtdm #1 SMP Mon Apr 9 21:35:39 JST 2018
x86_64 x86_64 x86_64 GNU/Linux
Kernel parameters: initrd=0:\initrd.img-4.9.51-x86-64-mine-xeno3-rtdm
root=/dev/disk/by-partlabel/system ro ip=off
I-pipe release #4 detected
Cobalt core 3.0.6 detected
Compiler: gcc version 5.4.0 xxx
Build args:

With this it is working fine.

However, when I remove everything (/usr/xenomai/) and re-install the
latest xenomai-3 (pulled today), it shows problem.
I did not revert any specific commit and tried.
May be I can check that later.
Note: as of now the problem is seen only when using rt_task_wait_period(NULL).
         When I use rt_task_sleep() then it works fine.


Thanks,
Pintu



> -Greg
>
> On Wed, Apr 18, 2018 at 9:17 AM, Pintu Kumar <pintu.ping@gmail.com> wrote:
>> Oh yes.
>> I was about to post the similar problem with rt_task_wait_period(NULL).
>>
>> I did "git pull" for my xenomai-3 repo and installed the newer version.
>> After that weird things started happening to my previous test program
>> for latency measurement.
>> The latency value started giving all wrong results.
>> In my test programs I was using: rt_task_set_period(100 us) and
>> measuring latency with rt_task_wait_period(NULL).
>> But, now rt_task_wait_period() returns immediately.
>>
>> Then, I reverted back the entire xenomai-3 to my older version.
>> And everything works fine for me.
>>
>> So, it looks like there is some change happened in latest xenomai-3
>> repo, which disturbed the rt_task_wait_period API.
>>
>> Please check, else all my previous efforts will go in vain.
>>
>>
>> Thanks,
>> Pintu
>>
>>
>>
>> On Wed, Apr 18, 2018 at 2:51 PM, Mauro Salvini
>> <mauro.salvini@smigroup.net> wrote:
>>> On Wed, 2018-04-11 at 16:42 +0200, Philippe Gerum wrote:
>>>> On 04/11/2018 04:39 PM, Mauro Salvini wrote:
>>>> > On Wed, 2018-04-11 at 16:20 +0200, Philippe Gerum wrote:
>>>> > > On 04/11/2018 03:54 PM, Mauro Salvini wrote:
>>>> > > > Hi,
>>>> > > >
>>>> > > > I'm facing an unexpected behavior of rt_task_wait_period().
>>>> > > >
>>>> > > >
>>>> >
>>>> > ...
>>>> >
>>>> > > Please try this and let me know if the situation gets any better:
>>>> >
>>>> > Yes, now it works as expected.
>>>> >
>>>> > Thank you Philippe.
>>>> >
>>>> > Best regards.
>>>> >
>>>> > Mauro
>>>> >
>>>> >
>>>>
>>>> Ok, upstreamed. Thanks.
>>>>
>>>
>>> Hi Philippe,
>>>
>>> I resume this thread because when I tried your patch I tried only the
>>> case that didn't work, that is with SET_PERIOD undefined
>>> (so rt_task_set_periodic() not called), and didn't re-test also the
>>> code with rt_task_set_periodic() call. Sorry, my fault.
>>>
>>> With this patch applied, when I call rt_task_set_periodic() (SET_PERIOD
>>> defined), rt_task_wait_period() returns -EWOULDBLOCK as if
>>> rt_task_set_periodic() was never called.
>>>
>>> Thanks in advance, regards
>>>
>>> Mauro
>>>
>>>
>>> _______________________________________________
>>> Xenomai mailing list
>>> Xenomai@xenomai.org
>>> https://xenomai.org/mailman/listinfo/xenomai
>>
>> _______________________________________________
>> Xenomai mailing list
>> Xenomai@xenomai.org
>> https://xenomai.org/mailman/listinfo/xenomai


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Xenomai] rt_task_wait_period() does not return -EWOULDBLOCK
  2018-04-18 14:31             ` Pintu Kumar
@ 2018-04-18 14:59               ` Mauro Salvini
  2018-04-18 15:09                 ` Greg Gallagher
  0 siblings, 1 reply; 12+ messages in thread
From: Mauro Salvini @ 2018-04-18 14:59 UTC (permalink / raw)
  To: Pintu Kumar, Greg Gallagher; +Cc: xenomai

On Wed, 2018-04-18 at 20:01 +0530, Pintu Kumar wrote:
> On Wed, Apr 18, 2018 at 7:15 PM, Greg Gallagher <greg@embeddedgreg.co
> m> wrote:
> > What version was this working in?  I'm assuming you are working out
> > of
> > stable-3.0.x? If you reverted to an older git commit please post
> > the
> > commit.
> > 
> 
> Sorry, I don't remember the previous working versions.
> My current xeno-config is:
> # xeno-config --info
> Xenomai version: Xenomai/cobalt v3.0.6 -- #5956064 (2018-03-20
> 12:13:33 +0100)
> Linux 4.9.51-x86-64-mine-xeno3-rtdm #1 SMP Mon Apr 9 21:35:39 JST
> 2018
> x86_64 x86_64 x86_64 GNU/Linux
> Kernel parameters: initrd=0:\initrd.img-4.9.51-x86-64-mine-xeno3-rtdm
> root=/dev/disk/by-partlabel/system ro ip=off
> I-pipe release #4 detected
> Cobalt core 3.0.6 detected
> Compiler: gcc version 5.4.0 xxx
> Build args:
> 
> With this it is working fine.
> 
> However, when I remove everything (/usr/xenomai/) and re-install the
> latest xenomai-3 (pulled today), it shows problem.
> I did not revert any specific commit and tried.
> May be I can check that later.
> Note: as of now the problem is seen only when using
> rt_task_wait_period(NULL).
>          When I use rt_task_sleep() then it works fine.

Hi Greg and Pintu,

commit 73de42cc87f8831694f119359472283f8c7a21e6 on stable branch
contains patch that Philippe sent to me some days ago.
He upstreamed it because I told him that patch was working, but in fact
as I said in previous mail patch actually corrects one bug
(rt_task_wait_period() that not return -EWOULDBLOCK if
rt_task_set_periodic() was never called) but exploits another
(rt_task_wait_period() return -EWOULDBLOCK also when
rt_task_set_periodic() was called).

It is my fault because when Philippe sent me the patch I tested only
the previous non-working case and not the working, sorry for the mess.

I'm trying to find where is the bug, but it's not simple because I
don't know Xenomai internals.

Thanks, regards

Mauro



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Xenomai] rt_task_wait_period() does not return -EWOULDBLOCK
  2018-04-18 14:59               ` Mauro Salvini
@ 2018-04-18 15:09                 ` Greg Gallagher
  2018-04-18 17:21                   ` Pintu Kumar
  2018-04-18 18:33                   ` Philippe Gerum
  0 siblings, 2 replies; 12+ messages in thread
From: Greg Gallagher @ 2018-04-18 15:09 UTC (permalink / raw)
  To: Mauro Salvini; +Cc: xenomai

No problem, I won't be able to look into it till the weekend so any
help debugging is appreciated :)

On Wed, Apr 18, 2018 at 10:59 AM, Mauro Salvini
<mauro.salvini@smigroup.net> wrote:
> On Wed, 2018-04-18 at 20:01 +0530, Pintu Kumar wrote:
>> On Wed, Apr 18, 2018 at 7:15 PM, Greg Gallagher <greg@embeddedgreg.co
>> m> wrote:
>> > What version was this working in?  I'm assuming you are working out
>> > of
>> > stable-3.0.x? If you reverted to an older git commit please post
>> > the
>> > commit.
>> >
>>
>> Sorry, I don't remember the previous working versions.
>> My current xeno-config is:
>> # xeno-config --info
>> Xenomai version: Xenomai/cobalt v3.0.6 -- #5956064 (2018-03-20
>> 12:13:33 +0100)
>> Linux 4.9.51-x86-64-mine-xeno3-rtdm #1 SMP Mon Apr 9 21:35:39 JST
>> 2018
>> x86_64 x86_64 x86_64 GNU/Linux
>> Kernel parameters: initrd=0:\initrd.img-4.9.51-x86-64-mine-xeno3-rtdm
>> root=/dev/disk/by-partlabel/system ro ip=off
>> I-pipe release #4 detected
>> Cobalt core 3.0.6 detected
>> Compiler: gcc version 5.4.0 xxx
>> Build args:
>>
>> With this it is working fine.
>>
>> However, when I remove everything (/usr/xenomai/) and re-install the
>> latest xenomai-3 (pulled today), it shows problem.
>> I did not revert any specific commit and tried.
>> May be I can check that later.
>> Note: as of now the problem is seen only when using
>> rt_task_wait_period(NULL).
>>          When I use rt_task_sleep() then it works fine.
>
> Hi Greg and Pintu,
>
> commit 73de42cc87f8831694f119359472283f8c7a21e6 on stable branch
> contains patch that Philippe sent to me some days ago.
> He upstreamed it because I told him that patch was working, but in fact
> as I said in previous mail patch actually corrects one bug
> (rt_task_wait_period() that not return -EWOULDBLOCK if
> rt_task_set_periodic() was never called) but exploits another
> (rt_task_wait_period() return -EWOULDBLOCK also when
> rt_task_set_periodic() was called).
>
> It is my fault because when Philippe sent me the patch I tested only
> the previous non-working case and not the working, sorry for the mess.
>
> I'm trying to find where is the bug, but it's not simple because I
> don't know Xenomai internals.
>
> Thanks, regards
>
> Mauro
>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Xenomai] rt_task_wait_period() does not return -EWOULDBLOCK
  2018-04-18 15:09                 ` Greg Gallagher
@ 2018-04-18 17:21                   ` Pintu Kumar
  2018-04-18 18:33                   ` Philippe Gerum
  1 sibling, 0 replies; 12+ messages in thread
From: Pintu Kumar @ 2018-04-18 17:21 UTC (permalink / raw)
  To: Greg Gallagher; +Cc: xenomai

Oh thats great!
Thank you Mauro for your findings :)
So finally I assume that there is some bug introduced with the latest patch.
Never mind, until that is fixed (probably by next Monday), I will
stick to the previous branch.

Thanks,
Pintu


On Wed, Apr 18, 2018 at 8:39 PM, Greg Gallagher <greg@embeddedgreg.com> wrote:
> No problem, I won't be able to look into it till the weekend so any
> help debugging is appreciated :)
>
> On Wed, Apr 18, 2018 at 10:59 AM, Mauro Salvini
> <mauro.salvini@smigroup.net> wrote:
>> On Wed, 2018-04-18 at 20:01 +0530, Pintu Kumar wrote:
>>> On Wed, Apr 18, 2018 at 7:15 PM, Greg Gallagher <greg@embeddedgreg.co
>>> m> wrote:
>>> > What version was this working in?  I'm assuming you are working out
>>> > of
>>> > stable-3.0.x? If you reverted to an older git commit please post
>>> > the
>>> > commit.
>>> >
>>>
>>> Sorry, I don't remember the previous working versions.
>>> My current xeno-config is:
>>> # xeno-config --info
>>> Xenomai version: Xenomai/cobalt v3.0.6 -- #5956064 (2018-03-20
>>> 12:13:33 +0100)
>>> Linux 4.9.51-x86-64-mine-xeno3-rtdm #1 SMP Mon Apr 9 21:35:39 JST
>>> 2018
>>> x86_64 x86_64 x86_64 GNU/Linux
>>> Kernel parameters: initrd=0:\initrd.img-4.9.51-x86-64-mine-xeno3-rtdm
>>> root=/dev/disk/by-partlabel/system ro ip=off
>>> I-pipe release #4 detected
>>> Cobalt core 3.0.6 detected
>>> Compiler: gcc version 5.4.0 xxx
>>> Build args:
>>>
>>> With this it is working fine.
>>>
>>> However, when I remove everything (/usr/xenomai/) and re-install the
>>> latest xenomai-3 (pulled today), it shows problem.
>>> I did not revert any specific commit and tried.
>>> May be I can check that later.
>>> Note: as of now the problem is seen only when using
>>> rt_task_wait_period(NULL).
>>>          When I use rt_task_sleep() then it works fine.
>>
>> Hi Greg and Pintu,
>>
>> commit 73de42cc87f8831694f119359472283f8c7a21e6 on stable branch
>> contains patch that Philippe sent to me some days ago.
>> He upstreamed it because I told him that patch was working, but in fact
>> as I said in previous mail patch actually corrects one bug
>> (rt_task_wait_period() that not return -EWOULDBLOCK if
>> rt_task_set_periodic() was never called) but exploits another
>> (rt_task_wait_period() return -EWOULDBLOCK also when
>> rt_task_set_periodic() was called).
>>
>> It is my fault because when Philippe sent me the patch I tested only
>> the previous non-working case and not the working, sorry for the mess.
>>
>> I'm trying to find where is the bug, but it's not simple because I
>> don't know Xenomai internals.
>>
>> Thanks, regards
>>
>> Mauro
>>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [Xenomai] rt_task_wait_period() does not return -EWOULDBLOCK
  2018-04-18 15:09                 ` Greg Gallagher
  2018-04-18 17:21                   ` Pintu Kumar
@ 2018-04-18 18:33                   ` Philippe Gerum
  1 sibling, 0 replies; 12+ messages in thread
From: Philippe Gerum @ 2018-04-18 18:33 UTC (permalink / raw)
  To: Greg Gallagher, Mauro Salvini; +Cc: xenomai

On 04/18/2018 05:09 PM, Greg Gallagher wrote:
> No problem, I won't be able to look into it till the weekend so any
> help debugging is appreciated :)

Brown paper bag bug. The change was tested on Mercury only, where timer
ids cannot be zero; zero is a perfectly valid timer id with Cobalt. Oh,
well. I'll send a fix tested on both ends.

> 
> On Wed, Apr 18, 2018 at 10:59 AM, Mauro Salvini
> <mauro.salvini@smigroup.net> wrote:
>> On Wed, 2018-04-18 at 20:01 +0530, Pintu Kumar wrote:
>>> On Wed, Apr 18, 2018 at 7:15 PM, Greg Gallagher <greg@embeddedgreg.co
>>> m> wrote:
>>>> What version was this working in?  I'm assuming you are working out
>>>> of
>>>> stable-3.0.x? If you reverted to an older git commit please post
>>>> the
>>>> commit.
>>>>
>>>
>>> Sorry, I don't remember the previous working versions.
>>> My current xeno-config is:
>>> # xeno-config --info
>>> Xenomai version: Xenomai/cobalt v3.0.6 -- #5956064 (2018-03-20
>>> 12:13:33 +0100)
>>> Linux 4.9.51-x86-64-mine-xeno3-rtdm #1 SMP Mon Apr 9 21:35:39 JST
>>> 2018
>>> x86_64 x86_64 x86_64 GNU/Linux
>>> Kernel parameters: initrd=0:\initrd.img-4.9.51-x86-64-mine-xeno3-rtdm
>>> root=/dev/disk/by-partlabel/system ro ip=off
>>> I-pipe release #4 detected
>>> Cobalt core 3.0.6 detected
>>> Compiler: gcc version 5.4.0 xxx
>>> Build args:
>>>
>>> With this it is working fine.
>>>
>>> However, when I remove everything (/usr/xenomai/) and re-install the
>>> latest xenomai-3 (pulled today), it shows problem.
>>> I did not revert any specific commit and tried.
>>> May be I can check that later.
>>> Note: as of now the problem is seen only when using
>>> rt_task_wait_period(NULL).
>>>          When I use rt_task_sleep() then it works fine.
>>
>> Hi Greg and Pintu,
>>
>> commit 73de42cc87f8831694f119359472283f8c7a21e6 on stable branch
>> contains patch that Philippe sent to me some days ago.
>> He upstreamed it because I told him that patch was working, but in fact
>> as I said in previous mail patch actually corrects one bug
>> (rt_task_wait_period() that not return -EWOULDBLOCK if
>> rt_task_set_periodic() was never called) but exploits another
>> (rt_task_wait_period() return -EWOULDBLOCK also when
>> rt_task_set_periodic() was called).
>>
>> It is my fault because when Philippe sent me the patch I tested only
>> the previous non-working case and not the working, sorry for the mess.
>>
>> I'm trying to find where is the bug, but it's not simple because I
>> don't know Xenomai internals.
>>
>> Thanks, regards
>>
>> Mauro
>>
> 
> _______________________________________________
> Xenomai mailing list
> Xenomai@xenomai.org
> https://xenomai.org/mailman/listinfo/xenomai
> 


-- 
Philippe.


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-04-18 18:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-11 13:54 [Xenomai] rt_task_wait_period() does not return -EWOULDBLOCK Mauro Salvini
2018-04-11 14:20 ` Philippe Gerum
2018-04-11 14:39   ` Mauro Salvini
2018-04-11 14:42     ` Philippe Gerum
2018-04-18  9:21       ` Mauro Salvini
2018-04-18 13:17         ` Pintu Kumar
2018-04-18 13:45           ` Greg Gallagher
2018-04-18 14:31             ` Pintu Kumar
2018-04-18 14:59               ` Mauro Salvini
2018-04-18 15:09                 ` Greg Gallagher
2018-04-18 17:21                   ` Pintu Kumar
2018-04-18 18:33                   ` Philippe Gerum

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.