I am attaching a tar ball of the TSCAN1 driver I sent to the xenomai list for 
rtcan earlier this year.

--John

________________________________
From: [email protected] 
[mailto:[email protected]] On Behalf Of Alexandre Vézina
Sent: Sunday, October 25, 2009 10:36 PM
To: [email protected]
Subject: [Socketcan-users] TSCAN1 driver

Hi,

Frist, I attached my code if it can help.

A couple of month ago we started developing a driver for the ts-can1 board. 
(http://www.embeddedarm.com/products/board-detail.php?product=TS-CAN1).

I just restarted the development of the driver and I have a problem that I hope 
you guys will understand.

Everything started when I got a segfault calling "rmmod tscan1"

I started debugging and found that the segfault occurred when calling 
"release_mem_region(res->start, (res->end - res->start + 1));" (line 352)

Debugging further showed me that res == NULL. I looked at the resources. There 
were still 2 resources, but the flags were not as I set them (IORESOURCE_IO or 
IORESOURCE_IRQ). Their values were like 0 and -97575452... This explains why 
platform_get_resource() was returning NULL.

I started debugging were this struct was getting messed up and I figured it was 
right after calling register_sja1000dev() (line 317); I traced until 
register_netdev(). I stopped there because I didn't want to recompile my kernel 
:D.

I also got this when probing the module:

...
WARNING: at net/core/rtnetlink.c:1232 rtmsg_ifinfo()
[<c0024134>] (dump_stack+0x0/0x14) from [<c018e480>] (rtmsg_ifinfo+0xe4/0xf4)
[<c018e39c>] (rtmsg_ifinfo+0x0/0xf4) from [<c018e75c>] 
(rtnetlink_event+0x84/0xb0)
[<c018e6d8>] (rtnetlink_event+0x0/0xb0) from [<c0058d84>] 
(notifier_call_chain+0x48/0x88)
[<c0058d3c>] (notifier_call_chain+0x0/0x88) from [<c005908c>] 
(__raw_notifier_call_chain+0x1c/0x20)
 r8:bf0582e8 r7:c5087800 r6:c02bb860 r5:c5087800 r4:00000000
[<c0059070>] (__raw_notifier_call_chain+0x0/0x20) from [<c00590b0>] 
(raw_notifier_call_chain+0x20/0x24)
[<c0059090>] (raw_notifier_call_chain+0x0/0x24) from [<c018076c>] 
(call_netdevice_notifiers+0x20/0x28)
[<c018074c>] (call_netdevice_notifiers+0x0/0x28) from [<c01846e0>] 
(register_netdevice+0x1d8/0x350)
[<c0184508>] (register_netdevice+0x0/0x350) from [<c01848a4>] 
(register_netdev+0x4c/0x5c)
 r6:c5079f30 r5:c5087800 r4:00000000
[<c0184858>] (register_netdev+0x0/0x5c) from [<bf04df18>] 
(register_candev+0x18/0x20 [can_dev])
 r5:c5087800 r4:c5087b60
[<bf04df00>] (register_candev+0x0/0x20 [can_dev]) from [<bf051ea8>] 
(register_sja1000dev+0x140/0x17c [sja1000])
[<bf051d68>] (register_sja1000dev+0x0/0x17c [sja1000]) from [<bf05a118>] 
(tscan1_probe+0x118/0x224 [tscan1])
 r5:bf0582f0 r4:c5087b60
[<bf05a000>] (tscan1_probe+0x0/0x224 [tscan1]) from [<c0128e84>] 
(platform_drv_probe+0x20/0x24)
[<c0128e64>] (platform_drv_probe+0x0/0x24) from [<c0126e70>] 
(driver_probe_device+0xe8/0x1a4)
[<c0126d88>] (driver_probe_device+0x0/0x1a4) from [<c0126f3c>] 
(__device_attach+0x10/0x14)
 r8:00000021 r7:c0126f2c r6:bf0582f0 r5:c5079e5c r4:00000000
[<c0126f2c>] (__device_attach+0x0/0x14) from [<c012601c>] 
(bus_for_each_drv+0x60/0x8c)
[<c0125fbc>] (bus_for_each_drv+0x0/0x8c) from [<c0126fe0>] 
(device_attach+0xa0/0xac)
 r7:bf058378 r6:00000000 r5:bf058394 r4:bf0582f0
[<c0126f40>] (device_attach+0x0/0xac) from [<c01263a8>] 
(bus_attach_device+0x7c/0x9c)
 r5:c029a178 r4:bf0582f0
[<c012632c>] (bus_attach_device+0x0/0x9c) from [<c01244e4>] 
(device_add+0x1e4/0x634)
 r6:00000000 r5:00000000 r4:bf0582f0
[<c0124300>] (device_add+0x0/0x634) from [<c0128c38>] 
(platform_device_add+0x100/0x188)
[<c0128b38>] (platform_device_add+0x0/0x188) from [<c0128ce0>] 
(platform_device_register+0x20/0x24)
 r7:bf057370 r6:bf0582e0 r5:bf0582e8 r4:c60101b3
[<c0128cc0>] (platform_device_register+0x0/0x24) from [<bf05a360>] 
(tscan1_init+0x13c/0x214 [tscan1])
 r5:c5079f30
[<bf05a224>] (tscan1_init+0x0/0x214 [tscan1]) from [<c0062538>] 
(sys_init_module+0xfc/0x144)
 r8:c0020124 r7:00000080 r6:2aac9000 r5:00000000 r4:bf058180
[<c006243c>] (sys_init_module+0x0/0x144) from [<c001ff80>] 
(ret_fast_syscall+0x0/0x2c)
 r6:00000000 r5:0000d0bc r4:0000a8c8
tscan1 tscan1: device registered (reg_base=c6012100, irq=33)

I can tell you that I also use  rt73usb driver for my ASUS wifi dongle. Don't 
know if it can conflict or whatever...

I don't know where to debug now... Hope you guys can help me.

Thanks

-------
Alexandre Vézina
[email protected]<mailto:[email protected]>
Pensez à l'environnement, avez-vous vraiment besoin d'imprimer ce courriel?

Attachment: rtcan_tscan1.tgz
Description: rtcan_tscan1.tgz

_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to