Skip to contentSkip to conversation

problem with RT-Socket-CAN xeno_can_isa module

Xenomai-help Alessio Margan @ IIT 3 participants 4 messages Nov 19, 2009 – Nov 20, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

I've got a problem using RT-Socket-CAN with module xeno_can_isa.
The system has a pcan-pc/104 board with a sja1000
The first tme I load to module with
sudo modprobe xeno_can_isa io=0x300,0x320 irq=10,11
everything work fine, then if I try to unload the module seems that the ioport region remain allocated from xeno_can_isa but the module is unloaded and if I try to load it again the command fail with "Device or resource busy" and I have to reboot. I miss something ?
Thanks
Alessio

Signature · 15 lines
ISTITUTO ITALIANO
DI TECNOLOGIA

Alessio Margan
/Senior Technician/
mail me <mailto:[email protected]>

Via Morego, 30 16163 Genova <http://maps.google.com/maps?f=q&hl=en&geocode=&q=via+morego,+30+genova&sll=37.0625,-95.677068&sspn=85.420533,191.601563&ie=UTF8&ll=44.474913,8.907037&spn=0.004685,0.011652&t=h&z=17&iwloc=addr>

www.iit.it <http://www.iit.it>

*Legal Disclaimer*
This electronic message contains information that is confidential. The information is intended for the use of the addressee only. If you are not the addressee we would appreciate your notification in this respect. Please note that any disclosure, copy, distribution or use of the contents of this message is prohibited and may be unlawful. We have taken every reasonable precaution to ensure that any kind of attachment to this e-mail has been swept for viruses. However, we cannot accept liability for any damage sustained as a result of software viruses and would advise you to carry out your own virus checks before opening any attachment.
*Avvertenza legale*
Questo messaggio Email contiene informazioni confidenziali riservate ai soli destinatari. Qualora veniate in possesso di tali informazioni senza essere definito come destinatario vi reghiamo di leggere le seguenti note. Ogni apertura, copia, distribuzione del contenuto del messaggio e dei suoi allegati è proibito e potrebbe violare le presenti leggi. Abbiamo attivato ogni possibile e ragionevole precauzione per assicurare che gli allegati non contengano virus. Comunque non assumeremo alcuna responsabilità per ogni eventuale danno causato da virus software e simili in quanto è onere del destinatario verificarne l’assenza in ogni allegato attuando propri indipendenti controlli.
#1 lore raw
Quoted 11 lines · Alessio Margan @ IIT wrote:

Hi,

I've got a problem using RT-Socket-CAN with module xeno_can_isa. The system has a pcan-pc/104 board with a sja1000
The first tme I load to module with
sudo modprobe xeno_can_isa io=0x300,0x320 irq=10,11 everything work fine, then if I try to unload the module seems that the ioport region remain allocated from xeno_can_isa
but the module is unloaded and if I try to load it again the command fail with "Device or resource busy" and I have to reboot.
I miss something ?

You are right, the IO regions are not released properly at module unload time. I will prepare a patch tomorrow (if Wolfgang does not do it before).

Signature · 1 line
Sebastian
#2 lore raw
In reply to Alessio Margan @ IIT
Quoted 8 lines · Alessio Margan @ IIT wrote:

I've got a problem using RT-Socket-CAN with module xeno_can_isa. The system has a pcan-pc/104 board with a sja1000
The first tme I load to module with
sudo modprobe xeno_can_isa io=0x300,0x320 irq=10,11 everything work fine, then if I try to unload the module seems that the ioport region remain allocated from xeno_can_isa
but the module is unloaded and if I try to load it again the command fail with "Device or resource busy" and I have to reboot.

Does this patch work for you?

Signature · 1 line
Sebastian
rtcan_isa.c renamed from rtcan_isa.c~ +1 -0
@@ -189,6 +189,7 @@ static void rtcan_isa_exit(void)
 		if (!dev)
 			continue;
 		rtcan_sja1000_unregister(dev);
+                release_region(io[i], RTCAN_ISA_PORT_SIZE);
 		rtcan_dev_free(dev);
 	}
 }
#3 lore raw
Quoted 12 lines · Sebastian Smolorz
Quoted 9 lines · Alessio Margan @ IIT wrote:

I've got a problem using RT-Socket-CAN with module xeno_can_isa. The system has a pcan-pc/104 board with a sja1000
The first tme I load to module with
sudo modprobe xeno_can_isa io=0x300,0x320 irq=10,11 everything work fine, then if I try to unload the module seems that the ioport region remain allocated from xeno_can_isa
but the module is unloaded and if I try to load it again the command fail with "Device or resource busy" and I have to reboot.

Quoted 3 lines

Does this patch work for you?

Perfect !
Alessio

Signature · 34 lines
ISTITUTO ITALIANO
DI TECNOLOGIA

Alessio Margan
/Senior Technician/
mail me <mailto:[email protected]>

Via Morego, 30 16163 Genova
<http://maps.google.com/maps?f=q&hl=en&geocode=&q=via+morego,+30+genova&sll=37.0625,-95.677068&sspn=85.420533,191.601563&ie=UTF8&ll=44.474913,8.907037&spn=0.004685,0.011652&t=h&z=17&iwloc=addr>

www.iit.it <http://www.iit.it>

*Legal Disclaimer*
This electronic message contains information that is confidential. The
information is intended for the use of the addressee only. If you are
not the addressee we would appreciate your notification in this respect.
Please note that any disclosure, copy, distribution or use of the
contents of this message is prohibited and may be unlawful. We have
taken every reasonable precaution to ensure that any kind of attachment
to this e-mail has been swept for viruses. However, we cannot accept
liability for any damage sustained as a result of software viruses and
would advise you to carry out your own virus checks before opening any
attachment.
*Avvertenza legale*
Questo messaggio Email contiene informazioni confidenziali riservate ai
soli destinatari. Qualora  veniate in possesso di tali informazioni
senza essere definito come destinatario vi reghiamo di leggere le
seguenti note. Ogni apertura, copia, distribuzione del contenuto del
messaggio e dei suoi allegati è proibito e potrebbe violare le presenti
leggi. Abbiamo attivato ogni possibile e ragionevole precauzione per
assicurare che gli allegati non contengano virus. Comunque non
assumeremo alcuna responsabilità per ogni eventuale danno causato da
virus software e simili in quanto è onere del destinatario verificarne
l’assenza in ogni allegato attuando propri indipendenti controlli.