Skip to contentSkip to conversation

Linux RT driver migrating to 3.0...

Xenomai Stephane Grosjean 2 participants 3 messages Jun 13, 2016

lore
Share & tools
lore
#0 lore raw

Hi!

Successfully running for years a Xenomai 2.6.x RT driver under some dual-kernel Linux versions, we'd like to migrate it to Xenomai 3.x.

First step consisting in compiling the driver is over, time has come to test it.

Everything looks like the rtm_mutex_lock() locks the entire system when running a Xenomai 3.x cobalt Linux, while it doesn't with 2.6.x: in fact, in some particular cases, this rtdm_mutex_lock() might be called from the "init_module()", so I'm afraid that the calling task isn't a RT one, but a Linux regular one, isn't it? So maybe it's actually the reason why...

But, in that case, why such a call was not a problem with Xenomai 2.6.x?

Thanks for your help and regards,

Stéphane

--
PEAK-System Technik GmbH
Sitz der Gesellschaft Darmstadt - HRB 9183 Geschaeftsfuehrung: A.Gach, U.Wilhelm --

#1 lore raw
Quoted 8 lines · Stephane Grosjean

Hi!

Successfully running for years a Xenomai 2.6.x RT driver under some dual-kernel Linux versions, we'd like to migrate it to Xenomai 3.x.

First step consisting in compiling the driver is over, time has come to test it.

Quoted 7 lines

Everything looks like the rtm_mutex_lock() locks the entire system when running a Xenomai 3.x cobalt Linux, while it doesn't with 2.6.x: in fact, in some particular cases, this rtdm_mutex_lock() might be called from the "init_module()", so I'm afraid that the calling task isn't a RT one, but a Linux regular one, isn't it? So maybe it's actually the reason why...

It is.

Quoted 1 line

But, in that case, why such a call was not a problem with Xenomai 2.6.x?

Because that mutex was not contended at the time of the call. You should also check for a lack of initialization of that mutex, causing the code to fail gracefully instead of panicking. Did you check the return code of rtdm_mutex_lock() in 2.6.x ?

Signature · 1 line
Philippe.
#2 lore raw
Quoted 17 lines · Philippe Gerum
Quoted 8 lines · Stephane Grosjean

Hi!

Successfully running for years a Xenomai 2.6.x RT driver under some dual-kernel Linux versions, we'd like to migrate it to Xenomai 3.x.

First step consisting in compiling the driver is over, time has come to test it.

Quoted 7 lines

Everything looks like the rtm_mutex_lock() locks the entire system when running a Xenomai 3.x cobalt Linux, while it doesn't with 2.6.x: in fact, in some particular cases, this rtdm_mutex_lock() might be called from the "init_module()", so I'm afraid that the calling task isn't a RT one, but a Linux regular one, isn't it? So maybe it's actually the reason why...

Quoted 9 lines

It is.

Quoted 1 line

But, in that case, why such a call was not a problem with Xenomai 2.6.x?

Because that mutex was not contended at the time of the call. You should also check for a lack of initialization of that mutex, causing the code to fail gracefully instead of panicking. Did you check the return code of rtdm_mutex_lock() in 2.6.x ?

Enabling CONFIG_XENO_OPT_DEBUG_COBALT in Xenomai 3.x should help detecting such issue too.

Signature · 1 line
Philippe.