Andrew Tannenbaum | 24 Apr 2012 20:47

rtcan I/O hang bug with /proc/rtcan/rtcan0/registers

I'm running

	Linux 2.6.38.8
	Xenomai 2.6.0
	Atom N270 CPU

I'm talking to CAN with a PEAK PCI SJA1000 CAN adapter.

I have a control loop running at 200 Hz, and I use it to drive a motor
and read an encoder using rtcan.  My code is based on the
rtcansend/rtcanrecv examples.

I found a bug where my control loop was hanging, and I've isolated the
problem so that it may be reproduced with Xenomai supplied tools,
without using my own code.

The problem is:

When I have a loop that is sending CAN packets, if I read
/proc/rtcan/rtcan0/registers at the same time, it causes the loop to
hang.  The hang is in rt_dev_sendto.

To reproduce:

Configure the CAN controller

	$ rtcanconfig rtcan0 --baudrate=1000000 start

Send packets, in this case, SYNC messages at 1000 Hz
with tty output 1 Hz.
(Continue reading)

Gilles Chanteperdrix | 24 Apr 2012 20:57
Favicon

Re: rtcan I/O hang bug with /proc/rtcan/rtcan0/registers

On 04/24/2012 08:47 PM, Andrew Tannenbaum wrote:
> I'm running
> 
> 	Linux 2.6.38.8
> 	Xenomai 2.6.0
> 	Atom N270 CPU
> 
> I'm talking to CAN with a PEAK PCI SJA1000 CAN adapter.
> 
> I have a control loop running at 200 Hz, and I use it to drive a motor
> and read an encoder using rtcan.  My code is based on the
> rtcansend/rtcanrecv examples.
> 
> I found a bug where my control loop was hanging, and I've isolated the
> problem so that it may be reproduced with Xenomai supplied tools,
> without using my own code.
> 
> The problem is:
> 
> When I have a loop that is sending CAN packets, if I read
> /proc/rtcan/rtcan0/registers at the same time, it causes the loop to
> hang.  The hang is in rt_dev_sendto.
> 
> To reproduce:
> 
> Configure the CAN controller
> 
> 	$ rtcanconfig rtcan0 --baudrate=1000000 start
> 
> Send packets, in this case, SYNC messages at 1000 Hz
(Continue reading)

Andrew Tannenbaum | 24 Apr 2012 21:12

Re: rtcan I/O hang bug with /proc/rtcan/rtcan0/registers

On 04/24/2012 02:57 PM, Gilles Chanteperdrix wrote:
> On 04/24/2012 08:47 PM, Andrew Tannenbaum wrote:
>> I'm running
>>
>> 	Linux 2.6.38.8
>> 	Xenomai 2.6.0
>> 	Atom N270 CPU
>>
>> I'm talking to CAN with a PEAK PCI SJA1000 CAN adapter.
>>
>> I have a control loop running at 200 Hz, and I use it to drive a motor
>> and read an encoder using rtcan.  My code is based on the
>> rtcansend/rtcanrecv examples.
>>
>> I found a bug where my control loop was hanging, and I've isolated the
>> problem so that it may be reproduced with Xenomai supplied tools,
>> without using my own code.
>>
>> The problem is:
>>
>> When I have a loop that is sending CAN packets, if I read
>> /proc/rtcan/rtcan0/registers at the same time, it causes the loop to
>> hang.  The hang is in rt_dev_sendto.
>>
>> To reproduce:
>>
>> Configure the CAN controller
>>
>> 	$ rtcanconfig rtcan0 --baudrate=1000000 start
>>
(Continue reading)

Wolfgang Grandegger | 25 Apr 2012 09:31

Re: rtcan I/O hang bug with /proc/rtcan/rtcan0/registers

On 04/24/2012 08:57 PM, Gilles Chanteperdrix wrote:
> On 04/24/2012 08:47 PM, Andrew Tannenbaum wrote:
>> I'm running
>>
>> 	Linux 2.6.38.8
>> 	Xenomai 2.6.0
>> 	Atom N270 CPU
>>
>> I'm talking to CAN with a PEAK PCI SJA1000 CAN adapter.
>>
>> I have a control loop running at 200 Hz, and I use it to drive a motor
>> and read an encoder using rtcan.  My code is based on the
>> rtcansend/rtcanrecv examples.
>>
>> I found a bug where my control loop was hanging, and I've isolated the
>> problem so that it may be reproduced with Xenomai supplied tools,
>> without using my own code.
>>
>> The problem is:
>>
>> When I have a loop that is sending CAN packets, if I read
>> /proc/rtcan/rtcan0/registers at the same time, it causes the loop to
>> hang.  The hang is in rt_dev_sendto.
>>
>> To reproduce:
>>
>> Configure the CAN controller
>>
>> 	$ rtcanconfig rtcan0 --baudrate=1000000 start
>>
(Continue reading)


Gmane