Analogy/mite
Hi, just found that
echo 0000:06:01.0 > /sys/bus/pci/drivers/analogy_mite/unbind
does not do the same thing as
analogy_config -r analogyN
in fact it leaves the system in a state where using the driver results in a kernel OOPS.
Will try to look into it further tomorrow...
/Anders
Signature · 5 lines
Anders Blomdell Email: [email protected] Department of Automatic Control Lund University Phone: +46 46 222 4625 P.O. Box 118 Fax: +46 46 138118 SE-221 00 Lund, Sweden
Quoted 4 lines · Anders Blomdell
Hi, just found that
echo 0000:06:01.0 >
/sys/bus/pci/drivers/analogy_mite/unbind
Quoted 8 lines
does not do the same thing as
analogy_config-r analogyNin fact it leaves the system in a state where using the driver results in a kernel OOPS.
Will try to look into it further tomorrow...
OK seems like we have some interrupt cleanup problem, the following command sequence:
modprobe xeno_native
modprobe analogy_ni_pcimio
sleep 1/usr/local/sbin/analogy_config analogy0 analogy_ni_pcimio 6,1 /usr/local/sbin/analogy_config -r analogy0
rmmod analogy_ni_pcimio
rmmod analogy_ni_mio
rmmod analogy_ni_tio
rmmod analogy_8255
rmmod analogy_ni_mite
rmmod xeno_analogy
sleep 2
modprobe xeno_native
modprobe analogy_ni_pcimio
sleep 1/usr/local/sbin/analogy_config analogy0 analogy_ni_pcimio 6,1
Gives:
[ 412.623639] Analogy: MITE: Available NI device IDs: 0x70af [ 413.648335] Analogy: analogy_ni_pcimio: pcimio_attach: found pci-6221 board [ 413.676105] Analogy: analogy_ni_pcimio: pcimio_attach: found irq 22 [ 413.682385] BUG: unable to handle kernel paging request at f8bc4bf4 [ 413.683367] IP: [<f8846efe>] xnintr_attach+0x6e/0xfe [xeno_nucleus] [ 413.683367] *pdpt = 0000000000aca001 *pde = 0000000031ca5067 *pte = 0000000000000000 [ 413.683367] Oops: 0000 [#1] SMP [ 413.683367] last sysfs file: /sys/bus/pci/drivers/analogy_mite/uevent [ 413.683367] Modules linked in: analogy_ni_pcimio analogy_ni_mio analogy_ni_tio analogy_8255 analogy_ni_mite xeno_analogy xeno_native nfs fscache snd_hda_codec_idt snd_hda_intel snd_hda_codec snd_hwdep snd_seq snd_seq_device snd_pcm snd_timer snd soundcore rt_e1000 rt_e1000_new rtnet xeno_rtdm nfsd lockd nfs_acl auth_rpcgss xeno_nucleus snd_page_alloc ppdev iTCO_wdt iTCO_vendor_support microcode sunrpc exportfs i2c_i801 pcspkr serio_raw e1000e parport_pc parport uinput ipv6 firewire_ohci firewire_core ata_generic pata_acpi crc_itu_t pata_marvell i915 drm_kms_helper drm i2c_algo_bit i2c_core video [last unloaded: xeno_analogy] [ 413.683367] [ 413.683367] Pid: 1579, comm: analogy_config Not tainted 2.6.38.8.xenomai.2.6.0.rtnet.26db745.20111130.1211 #1 /DG965SS [ 413.683367] EIP: 0060:[<f8846efe>] EFLAGS: 00010286 CPU: 1 [ 413.683367] EIP is at xnintr_attach+0x6e/0xfe [xeno_nucleus] [ 413.683367] EAX: f8bc4be4 EBX: f87d2be4 ECX: 00000001 EDX: 00000003 [ 413.683367] ESI: f885b840 EDI: fffffff0 EBP: f169ddf4 ESP: f169dde0 [ 413.683367] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 [ 413.683367] Process analogy_config (pid: 1579, ti=f169c000 task=f40925e0 task.ti=f169c000) [ 413.683367] I-pipe domain Linux [ 413.683367] Stack: [ 413.683367] 205bde08 00000001 f87d2be4 00000000 00000001 f169de10 f89a0c91 f87cea28 [ 413.683367] 00000000 00000001 f87d2bd8 00000000 f169de28 f87ceb64 00000001 f87d134f [ 413.683367] f87d2bd8 f87d2bb8 f169de44 f87cf727 00000001 f87d2bb8 00000016 f87d2bb8 [ 413.683367] Call Trace: [ 413.683367] [<f89a0c91>] rtdm_irq_request+0x37/0x5a [xeno_rtdm] [ 413.683367] [<f87cea28>] ? a4l_handle_irq+0x0/0x1f [xeno_analogy] [ 413.683367] [<f87ceb64>] __a4l_request_irq+0x38/0x3e [xeno_analogy] [ 413.683367] [<f87cf727>] a4l_request_irq+0x67/0xad [xeno_analogy] [ 413.683367] [<f86b1593>] pcimio_attach+0x4e0/0x53e [analogy_ni_pcimio] [ 413.683367] [<f87cde93>] a4l_assign_driver+0x73/0x100 [xeno_analogy] [ 413.683367] [<f87cdfd9>] a4l_device_attach+0x59/0x6e [xeno_analogy] [ 413.683367] [<f87ce0d7>] a4l_ioctl_devcfg+0xbd/0xf6 [xeno_analogy] [ 413.683367] [<f87cf943>] a4l_ioctl+0x1e/0x20 [xeno_analogy] [ 413.683367] [<f899fa5a>] __rt_dev_ioctl+0x4d/0x104 [xeno_rtdm] [ 413.683367] [<c07c35b6>] ? do_page_fault+0x2f7/0x322 [ 413.683367] [<f89a1a85>] sys_rtdm_ioctl+0x2e/0x30 [xeno_rtdm] [ 413.683367] [<f8851414>] losyscall_event+0xb1/0x174 [xeno_nucleus] [ 413.683367] [<c04887ab>] __ipipe_dispatch_event+0xcb/0x17a [ 413.683367] [<f8851363>] ? losyscall_event+0x0/0x174 [xeno_nucleus] [ 413.683367] [<c0415b32>] __ipipe_syscall_root+0x50/0xc9 [ 413.683367] [<c07c0a21>] system_call+0x2d/0x53 [ 413.683367] Code: 00 e8 73 ff ff ff 8b 4b 10 f7 c1 00 00 01 00 89 45 f0 0f 85 92 00 00 00 8b 73 14 c1 e6 06 81 c6 c0 b2 85 f8 8b 46 24 85 c0 74 25 <8b> 50 10 89 ce 21 d6 83 e6 01 74 73 8b 73 18 39 70 18 75 6b 31 [ 413.683367] EIP: [<f8846efe>] xnintr_attach+0x6e/0xfe [xeno_nucleus] SS:ESP 0068:f169dde0 [ 413.683367] CR2: 00000000f8bc4bf4
Quoted 2 lines
/Anders
Signature · 5 lines
Anders Blomdell Email: [email protected] Department of Automatic Control Lund University Phone: +46 46 222 4625 P.O. Box 118 Fax: +46 46 138118 SE-221 00 Lund, Sweden
Hi
Quoted 10 lines · Anders Blomdell
Quoted 9 lines · Anders Blomdell
Hi, just found that
echo 0000:06:01.0 >
/sys/bus/pci/drivers/analogy_mite/unbinddoes not do the same thing as
analogy_config-r analogyN
Quoted 8 lines
Quoted 4 lines
in fact it leaves the system in a state where using the driver results in a kernel OOPS.
Will try to look into it further tomorrow...
OK seems like we have some interrupt cleanup problem, the following command sequence:
OK thank you for the report. I did not have time to look at it yet but that will be done soon.
Is it blocking for you?
Alexis.
Quoted 103 lines
modprobe
xeno_native
modprobeanalogy_ni_pcimio
sleep 1/usr/local/sbin/analogy_configanalogy0analogy_ni_pcimio6,1/usr/local/sbin/analogy_config-r analogy0
rmmodanalogy_ni_pcimio
rmmodanalogy_ni_mio
rmmodanalogy_ni_tio
rmmodanalogy_8255
rmmodanalogy_ni_mite
rmmodxeno_analogysleep 2
modprobe
xeno_native
modprobeanalogy_ni_pcimio
sleep 1/usr/local/sbin/analogy_configanalogy0analogy_ni_pcimio6,1Gives:
[ 412.623639] Analogy: MITE: Available NI device IDs:
0x70af
[ 413.648335] Analogy:analogy_ni_pcimio:pcimio_attach: found pci-6221 board
[ 413.676105] Analogy:analogy_ni_pcimio:pcimio_attach: found irq 22 [ 413.682385] BUG: unable to handle kernel paging request atf8bc4bf4[ 413.683367] IP: [<f8846efe>]xnintr_attach+0x6e/0xfe[xeno_nucleus] [ 413.683367] *pdpt =0000000000aca001*pde =0000000031ca5067*pte = 0000000000000000
[ 413.683367] Oops: 0000 [#1] SMP
[ 413.683367] last sysfs file:/sys/bus/pci/drivers/analogy_mite/uevent[ 413.683367] Modules linked in:analogy_ni_pcimioanalogy_ni_mioanalogy_ni_tioanalogy_8255analogy_ni_mitexeno_analogyxeno_nativenfs fscachesnd_hda_codec_idtsnd_hda_intelsnd_hda_codecsnd_hwdepsnd_seqsnd_seq_devicesnd_pcmsnd_timersnd soundcorert_e1000rt_e1000_newrtnetxeno_rtdmnfsd lockdnfs_aclauth_rpcgssxeno_nucleussnd_page_allocppdeviTCO_wdtiTCO_vendor_supportmicrocode sunrpc exportfsi2c_i801pcspkrserio_rawe1000eparport_pcparport uinput ipv6firewire_ohcifirewire_coreata_genericpata_acpicrc_itu_tpata_marvelli915drm_kms_helperdrmi2c_algo_biti2c_corevideo [last unloaded:xeno_analogy]
[ 413.683367]
[ 413.683367] Pid: 1579, comm:analogy_configNot tainted 2.6.38.8.xenomai.2.6.0.rtnet.26db745.20111130.1211 #1 /DG965SS [ 413.683367] EIP: 0060:[<f8846efe>] EFLAGS: 00010286 CPU: 1
[ 413.683367] EIP is atxnintr_attach+0x6e/0xfe[xeno_nucleus] [ 413.683367] EAX:f8bc4be4EBX:f87d2be4ECX: 00000001 EDX: 00000003 [ 413.683367] ESI:f885b840EDI:fffffff0EBP:f169ddf4ESP:f169dde0[ 413.683367] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
[ 413.683367] Processanalogy_config(pid: 1579, ti=f169c000 task=f40925e0 task.ti=f169c000)
[ 413.683367] I-pipe domain Linux
[ 413.683367] Stack:
[ 413.683367] 205bde08 00000001f87d2be400000000 00000001f169de10f89a0c91f87cea28
[ 413.683367] 00000000 00000001f87d2bd800000000f169de28f87ceb6400000001f87d134f
[ 413.683367] f87d2bd8f87d2bb8f169de44f87cf72700000001f87d2bb800000016f87d2bb8
[ 413.683367] Call Trace:
[ 413.683367] [<f89a0c91>]rtdm_irq_request+0x37/0x5a[xeno_rtdm] [ 413.683367] [<f87cea28>] ?a4l_handle_irq+0x0/0x1f[xeno_analogy] [ 413.683367] [<f87ceb64>]__a4l_request_irq+0x38/0x3e[xeno_analogy] [ 413.683367] [<f87cf727>]a4l_request_irq+0x67/0xad[xeno_analogy] [ 413.683367] [<f86b1593>]pcimio_attach+0x4e0/0x53e[analogy_ni_pcimio] [ 413.683367] [<f87cde93>]a4l_assign_driver+0x73/0x100[xeno_analogy] [ 413.683367] [<f87cdfd9>]a4l_device_attach+0x59/0x6e[xeno_analogy] [ 413.683367] [<f87ce0d7>]a4l_ioctl_devcfg+0xbd/0xf6[xeno_analogy] [ 413.683367] [<f87cf943>]a4l_ioctl+0x1e/0x20[xeno_analogy] [ 413.683367] [<f899fa5a>]__rt_dev_ioctl+0x4d/0x104[xeno_rtdm] [ 413.683367] [<c07c35b6>] ?do_page_fault+0x2f7/0x322
[ 413.683367] [<f89a1a85>]sys_rtdm_ioctl+0x2e/0x30[xeno_rtdm] [ 413.683367] [<f8851414>]losyscall_event+0xb1/0x174[xeno_nucleus] [ 413.683367] [<c04887ab>]__ipipe_dispatch_event+0xcb/0x17a[ 413.683367] [<f8851363>] ?losyscall_event+0x0/0x174[xeno_nucleus] [ 413.683367] [<c0415b32>]__ipipe_syscall_root+0x50/0xc9
[ 413.683367] [<c07c0a21>]system_call+0x2d/0x53
[ 413.683367] Code: 00 e8 73 ff ff ff 8b 4b 10 f7 c1 00 00 01 00 89 45 f0 0f 85 92 00 00 00 8b 73 14 c1 e6 06 81 c6 c0 b2 85 f8 8b 46 24 85 c0 74 25 <8b> 50 10 89 ce 21 d6 83 e6 01 74 73 8b 73 18 39 70 18 75 6b 31 [ 413.683367] EIP: [<f8846efe>]xnintr_attach+0x6e/0xfe[xeno_nucleus] SS:ESP 0068:f169dde0
[ 413.683367] CR2:00000000f8bc4bf4Quoted 2 lines
/Anders
--
Anders Blomdell Email: [email protected] Department of Automatic Control
Lund University Phone: +46 46 222 4625 P.O. Box 118 Fax: +46 46 138118 SE-221 00 Lund, Sweden_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Quoted 19 lines · Alexis Berlemont
Hi
Quoted 15 lines · Anders Blomdell
Quoted 13 lines · Anders Blomdell
Hi, just found that
echo 0000:06:01.0>
/sys/bus/pci/drivers/analogy_mite/unbinddoes not do the same thing as
analogy_config-r analogyNin fact it leaves the system in a state where using the driver results in a kernel OOPS.
Will try to look into it further tomorrow...
Quoted 8 lines
Quoted 3 lines
OK seems like we have some interrupt cleanup problem, the following command sequence:
OK thank you for the report. I did not have time to look at it yet but that will be done soon.
Is it blocking for you?
Yes, and even worse is this problem:
# /usr/local/sbin/analogy_config analogy0 analogy_ni_pcimio 6,1 # /usr/local/sbin/analogy_config -r analogy0 # cat /proc/xenomai/irq Killed
I was looking into it last week, but is a workshop since monday, will get back at this tomorrow.
Quoted 106 lines
Alexis.
Quoted 103 lines
modprobe
xeno_native
modprobeanalogy_ni_pcimio
sleep 1/usr/local/sbin/analogy_configanalogy0analogy_ni_pcimio6,1/usr/local/sbin/analogy_config-r analogy0
rmmodanalogy_ni_pcimio
rmmodanalogy_ni_mio
rmmodanalogy_ni_tio
rmmodanalogy_8255
rmmodanalogy_ni_mite
rmmodxeno_analogysleep 2
modprobe
xeno_native
modprobeanalogy_ni_pcimio
sleep 1/usr/local/sbin/analogy_configanalogy0analogy_ni_pcimio6,1Gives:
[ 412.623639] Analogy: MITE: Available NI device IDs: 0x70af [ 413.648335] Analogy: analogy_ni_pcimio: pcimio_attach: found pci-6221 board [ 413.676105] Analogy: analogy_ni_pcimio: pcimio_attach: found irq 22 [ 413.682385] BUG: unable to handle kernel paging request at f8bc4bf4 [ 413.683367] IP: [<f8846efe>] xnintr_attach+0x6e/0xfe [xeno_nucleus] [ 413.683367] *pdpt = 0000000000aca001 *pde = 0000000031ca5067 *pte = 0000000000000000 [ 413.683367] Oops: 0000 [#1] SMP [ 413.683367] last sysfs file: /sys/bus/pci/drivers/analogy_mite/uevent [ 413.683367] Modules linked in: analogy_ni_pcimio analogy_ni_mio
analogy_ni_tioanalogy_8255analogy_ni_mitexeno_analogyxeno_nativenfs fscachesnd_hda_codec_idtsnd_hda_intelsnd_hda_codecsnd_hwdepsnd_seqsnd_seq_devicesnd_pcmsnd_timersnd soundcorert_e1000rt_e1000_newrtnetxeno_rtdmnfsd lockdnfs_aclauth_rpcgssxeno_nucleussnd_page_allocppdeviTCO_wdtiTCO_vendor_supportmicrocode sunrpc exportfsi2c_i801pcspkrserio_rawe1000eparport_pcparport uinput ipv6firewire_ohcifirewire_coreata_genericpata_acpicrc_itu_tpata_marvelli915drm_kms_helperdrmi2c_algo_biti2c_corevideo [last unloaded:xeno_analogy][ 413.683367] [ 413.683367] Pid: 1579, comm: analogy_config Not tainted 2.6.38.8.xenomai.2.6.0.rtnet.26db745.20111130.1211 #1 /DG965SS [ 413.683367] EIP: 0060:[<f8846efe>] EFLAGS: 00010286 CPU: 1 [ 413.683367] EIP is at xnintr_attach+0x6e/0xfe [xeno_nucleus] [ 413.683367] EAX: f8bc4be4 EBX: f87d2be4 ECX: 00000001 EDX: 00000003 [ 413.683367] ESI: f885b840 EDI: fffffff0 EBP: f169ddf4 ESP: f169dde0 [ 413.683367] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 [ 413.683367] Process analogy_config (pid: 1579, ti=f169c000 task=f40925e0 task.ti=f169c000) [ 413.683367] I-pipe domain Linux [ 413.683367] Stack: [ 413.683367] 205bde08 00000001 f87d2be4 00000000 00000001 f169de10 f89a0c91 f87cea28 [ 413.683367] 00000000 00000001 f87d2bd8 00000000 f169de28 f87ceb64 00000001 f87d134f [ 413.683367] f87d2bd8 f87d2bb8 f169de44 f87cf727 00000001 f87d2bb8 00000016 f87d2bb8 [ 413.683367] Call Trace: [ 413.683367] [<f89a0c91>] rtdm_irq_request+0x37/0x5a [xeno_rtdm] [ 413.683367] [<f87cea28>] ? a4l_handle_irq+0x0/0x1f [xeno_analogy] [ 413.683367] [<f87ceb64>] __a4l_request_irq+0x38/0x3e [xeno_analogy] [ 413.683367] [<f87cf727>] a4l_request_irq+0x67/0xad [xeno_analogy] [ 413.683367] [<f86b1593>] pcimio_attach+0x4e0/0x53e [analogy_ni_pcimio] [ 413.683367] [<f87cde93>] a4l_assign_driver+0x73/0x100 [xeno_analogy] [ 413.683367] [<f87cdfd9>] a4l_device_attach+0x59/0x6e [xeno_analogy] [ 413.683367] [<f87ce0d7>] a4l_ioctl_devcfg+0xbd/0xf6 [xeno_analogy] [ 413.683367] [<f87cf943>] a4l_ioctl+0x1e/0x20 [xeno_analogy] [ 413.683367] [<f899fa5a>] __rt_dev_ioctl+0x4d/0x104 [xeno_rtdm] [ 413.683367] [<c07c35b6>] ? do_page_fault+0x2f7/0x322 [ 413.683367] [<f89a1a85>] sys_rtdm_ioctl+0x2e/0x30 [xeno_rtdm] [ 413.683367] [<f8851414>] losyscall_event+0xb1/0x174 [xeno_nucleus] [ 413.683367] [<c04887ab>] __ipipe_dispatch_event+0xcb/0x17a [ 413.683367] [<f8851363>] ? losyscall_event+0x0/0x174 [xeno_nucleus] [ 413.683367] [<c0415b32>] __ipipe_syscall_root+0x50/0xc9 [ 413.683367] [<c07c0a21>] system_call+0x2d/0x53 [ 413.683367] Code: 00 e8 73 ff ff ff 8b 4b 10 f7 c1 00 00 01 00 89 45 f0 0f 85 92 00 00 00 8b 73 14 c1 e6 06 81 c6 c0 b2 85 f8 8b 46 24 85 c0 74 25 <8b> 50 10 89 ce 21 d6 83 e6 01 74 73 8b 73 18 39 70 18 75 6b 31 [ 413.683367] EIP: [<f8846efe>] xnintr_attach+0x6e/0xfe [xeno_nucleus] SS:ESP 0068:f169dde0 [ 413.683367] CR2: 00000000f8bc4bf4Quoted 2 lines
/Anders
--
Anders Blomdell Email: [email protected]
Department of Automatic ControlLund University Phone: +46 46 222 4625 P.O. Box 118 Fax: +46 46 138118SE-221 00 Lund, Sweden
_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Signature · 5 lines
Anders Blomdell Email: [email protected] Department of Automatic Control Lund University Phone: +46 46 222 4625 P.O. Box 118 Fax: +46 46 138118 SE-221 00 Lund, Sweden
Quoted 31 lines · Anders Blomdell
Quoted 24 lines · Alexis Berlemont
Hi
Quoted 10 lines · Anders Blomdell
Quoted 9 lines · Anders Blomdell
Hi, just found that
echo 0000:06:01.0>
/sys/bus/pci/drivers/analogy_mite/unbinddoes not do the same thing as
analogy_config-r analogyNQuoted 9 lines
Quoted 4 lines
in fact it leaves the system in a state where using the driver results in a kernel OOPS.
Will try to look into it further tomorrow...
OK seems like we have some interrupt cleanup problem, the following command
sequence:Quoted 4 lines
OK thank you for the report. I did not have time to look at it yet but that will be done soon.
Is it blocking for you?
Yes, and even worse is this problem:
Quoted 7 lines
# /usr/local/sbin/analogy_config analogy0 analogy_ni_pcimio 6,1 # /usr/local/sbin/analogy_config -r analogy0 # cat /proc/xenomai/irq KilledI was looking into it last week, but is a workshop since monday, will get back at this tomorrow.
Seems like somebody is stomping out dev->transfer.irq_desc.rtdm_desc.flags between attach and detach (flags and all fields in its vicinity is zeroed out), hence the interrupt is never removed from the interrupt handler tables wreaking havoc with the entire kernel.
Quoted 115 lines
Quoted 113 lines
Alexis.
Quoted 109 lines
modprobe
xeno_native
modprobeanalogy_ni_pcimio
sleep 1/usr/local/sbin/analogy_configanalogy0analogy_ni_pcimio6,1/usr/local/sbin/analogy_config-r analogy0
rmmodanalogy_ni_pcimio
rmmodanalogy_ni_mio
rmmodanalogy_ni_tio
rmmodanalogy_8255
rmmodanalogy_ni_mite
rmmodxeno_analogysleep 2
modprobe
xeno_native
modprobeanalogy_ni_pcimio
sleep 1/usr/local/sbin/analogy_configanalogy0analogy_ni_pcimio6,1Gives:
[ 412.623639] Analogy: MITE: Available NI device IDs: 0x70af [ 413.648335] Analogy: analogy_ni_pcimio: pcimio_attach: found pci-6221 board [ 413.676105] Analogy: analogy_ni_pcimio: pcimio_attach: found irq 22 [ 413.682385] BUG: unable to handle kernel paging request at f8bc4bf4 [ 413.683367] IP: [<f8846efe>] xnintr_attach+0x6e/0xfe [xeno_nucleus] [ 413.683367] *pdpt = 0000000000aca001 *pde = 0000000031ca5067 *pte = 0000000000000000 [ 413.683367] Oops: 0000 [#1] SMP [ 413.683367] last sysfs file: /sys/bus/pci/drivers/analogy_mite/uevent [ 413.683367] Modules linked in: analogy_ni_pcimio analogy_ni_mio
analogy_ni_tioanalogy_8255analogy_ni_mitexeno_analogyxeno_nativenfs fscachesnd_hda_codec_idtsnd_hda_intelsnd_hda_codecsnd_hwdepsnd_seqsnd_seq_devicesnd_pcmsnd_timersnd soundcorert_e1000rt_e1000_newrtnetxeno_rtdmnfsd lockdnfs_aclauth_rpcgssxeno_nucleussnd_page_allocppdeviTCO_wdtiTCO_vendor_supportmicrocode sunrpc exportfsi2c_i801pcspkrserio_rawe1000eparport_pcparport uinput ipv6firewire_ohcifirewire_coreata_genericpata_acpicrc_itu_tpata_marvelli915drm_kms_helperdrmi2c_algo_biti2c_corevideo [last unloaded:xeno_analogy][ 413.683367] [ 413.683367] Pid: 1579, comm: analogy_config Not tainted 2.6.38.8.xenomai.2.6.0.rtnet.26db745.20111130.1211 #1 /DG965SS [ 413.683367] EIP: 0060:[<f8846efe>] EFLAGS: 00010286 CPU: 1 [ 413.683367] EIP is at xnintr_attach+0x6e/0xfe [xeno_nucleus] [ 413.683367] EAX: f8bc4be4 EBX: f87d2be4 ECX: 00000001 EDX: 00000003 [ 413.683367] ESI: f885b840 EDI: fffffff0 EBP: f169ddf4 ESP: f169dde0 [ 413.683367] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 [ 413.683367] Process analogy_config (pid: 1579, ti=f169c000 task=f40925e0 task.ti=f169c000) [ 413.683367] I-pipe domain Linux [ 413.683367] Stack: [ 413.683367] 205bde08 00000001 f87d2be4 00000000 00000001 f169de10 f89a0c91 f87cea28 [ 413.683367] 00000000 00000001 f87d2bd8 00000000 f169de28 f87ceb64 00000001 f87d134f [ 413.683367] f87d2bd8 f87d2bb8 f169de44 f87cf727 00000001 f87d2bb8 00000016 f87d2bb8 [ 413.683367] Call Trace: [ 413.683367] [<f89a0c91>] rtdm_irq_request+0x37/0x5a [xeno_rtdm] [ 413.683367] [<f87cea28>] ? a4l_handle_irq+0x0/0x1f [xeno_analogy] [ 413.683367] [<f87ceb64>] __a4l_request_irq+0x38/0x3e [xeno_analogy] [ 413.683367] [<f87cf727>] a4l_request_irq+0x67/0xad [xeno_analogy] [ 413.683367] [<f86b1593>] pcimio_attach+0x4e0/0x53e [analogy_ni_pcimio] [ 413.683367] [<f87cde93>] a4l_assign_driver+0x73/0x100 [xeno_analogy] [ 413.683367] [<f87cdfd9>] a4l_device_attach+0x59/0x6e [xeno_analogy] [ 413.683367] [<f87ce0d7>] a4l_ioctl_devcfg+0xbd/0xf6 [xeno_analogy] [ 413.683367] [<f87cf943>] a4l_ioctl+0x1e/0x20 [xeno_analogy] [ 413.683367] [<f899fa5a>] __rt_dev_ioctl+0x4d/0x104 [xeno_rtdm] [ 413.683367] [<c07c35b6>] ? do_page_fault+0x2f7/0x322 [ 413.683367] [<f89a1a85>] sys_rtdm_ioctl+0x2e/0x30 [xeno_rtdm] [ 413.683367] [<f8851414>] losyscall_event+0xb1/0x174 [xeno_nucleus] [ 413.683367] [<c04887ab>] __ipipe_dispatch_event+0xcb/0x17a [ 413.683367] [<f8851363>] ? losyscall_event+0x0/0x174 [xeno_nucleus] [ 413.683367] [<c0415b32>] __ipipe_syscall_root+0x50/0xc9 [ 413.683367] [<c07c0a21>] system_call+0x2d/0x53 [ 413.683367] Code: 00 e8 73 ff ff ff 8b 4b 10 f7 c1 00 00 01 00 8945 f0
0f 85 92 00 00 00 8b 73 14 c1 e6 06 81 c6 c0 b2 85 f8 8b 46 24 85 c0 74 25
<8b> 50 10 89 ce 21 d6 83 e6 01 74 73 8b 73 18 39 70 18 75 6b 31[ 413.683367] EIP: [<f8846efe>] xnintr_attach+0x6e/0xfe [xeno_nucleus] SS:ESP 0068:f169dde0 [ 413.683367] CR2: 00000000f8bc4bf4Quoted 2 lines
/Anders
--
Anders Blomdell Email: [email protected]
Department of Automatic Control
Lund University Phone: +46 46 222 4625
P.O. Box 118 Fax: +46 46 138118
SE-221 00 Lund, Sweden_______________________________________________
Xenomai-core mailing list
[email protected]
https://mail.gna.org/listinfo/xenomai-core
Signature · 5 lines
Anders Blomdell Email: [email protected] Department of Automatic Control Lund University Phone: +46 46 222 4625 P.O. Box 118 Fax: +46 46 138118 SE-221 00 Lund, Sweden
Quoted 37 lines · Anders Blomdell
Quoted 36 lines · Anders Blomdell
Quoted 24 lines · Alexis Berlemont
Hi
Quoted 10 lines · Anders Blomdell
Quoted 9 lines · Anders Blomdell
Hi, just found that
echo 0000:06:01.0>
/sys/bus/pci/drivers/analogy_mite/unbinddoes not do the same thing as
analogy_config-r analogyNQuoted 9 lines
Quoted 4 lines
in fact it leaves the system in a state where using the driver results in a kernel OOPS.
Will try to look into it further tomorrow...
OK seems like we have some interrupt cleanup problem, the following command
sequence:Quoted 4 lines
OK thank you for the report. I did not have time to look at it yet but that will be done soon.
Is it blocking for you?
Yes, and even worse is this problem:
# /usr/local/sbin/analogy_config analogy0 analogy_ni_pcimio 6,1 # /usr/local/sbin/analogy_config -r analogy0 # cat /proc/xenomai/irq Killed
Quoted 7 lines
Quoted 2 lines
I was looking into it last week, but is a workshop since monday, will get back at this tomorrow.
Seems like somebody is stomping out
dev->transfer.irq_desc.rtdm_desc.flagsbetween attach and detach (flags and all fields in its vicinity is zeroed out), hence the interrupt is never removed from the interrupt handler tables wreaking havoc with the entire kernel.
Found the guilty party: a4l_cleanup_transfer, which zeroes out all the interrupt data, just before the interrupt should be detached. Somebody is being overzealous about keeping memory shiningly clean. We need to keep the useful dirt.
ksrc/drivers/analogy/transfer.c renamed from ksrc/drivers/analogy/transfer.c.orig +0 -2
@@ -92,8 +92,6 @@rtdm_free (tsf->subds); } -memset (tsf,0 ,sizeof (a4l_trf_t)); -return 0 ; }
/Anders
Signature · 5 lines
Anders Blomdell Email: [email protected] Department of Automatic Control Lund University Phone: +46 46 222 4625 P.O. Box 118 Fax: +46 46 138118 SE-221 00 Lund, Sweden
Quoted 4 lines · Anders Blomdell
Hi, just found that
echo 0000:06:01.0 >
/sys/bus/pci/drivers/analogy_mite/unbind
Quoted 8 lines
does not do the same thing as
analogy_config-r analogyNin fact it leaves the system in a state where using the driver results in a kernel OOPS.
Will try to look into it further tomorrow...
Well, took quite some time to track down the 'analogy_config -r' bug (which was responsible for the kernel OOPS [i.e. after fixing it I have not got any OOPSes]).
So back to the original problem, does anybody foresee that a call to a4l_ioctl_devcfg(cxt, NULL) from the mite driver would give any problems (apart from getting the context pointer from the data structures the mite driver has handy)? It is probably not kosher to do ioctl on a driver that is not open, but...
/Anders
Signature · 5 lines
Anders Blomdell Email: [email protected] Department of Automatic Control Lund University Phone: +46 46 222 4625 P.O. Box 118 Fax: +46 46 138118 SE-221 00 Lund, Sweden
Quoted 17 lines · Anders Blomdell
Quoted 4 lines · Anders Blomdell
Hi, just found that
echo 0000:06:01.0 >
/sys/bus/pci/drivers/analogy_mite/unbindQuoted 8 lines
does not do the same thing as
analogy_config-r analogyNin fact it leaves the system in a state where using the driver results in a kernel OOPS.
Will try to look into it further tomorrow...
Well, took quite some time to track down the '
analogy_config-r' bug (which was responsible for the kernel OOPS [i.e. after fixing it I have not got any OOPSes]).
Quoted 5 lines
So back to the original problem, does anybody foresee that a call to
a4l_ioctl_devcfg(cxt, NULL)from the mite driver would give any problems (apart from getting the context pointer from the data structures the mite driver has handy)? It is probably not kosher to do ioctl on a driver that is not open, but...
Attached is a hack (as can be gleaned from the EXPORT_SYMBOL_GPL), if the basic assumption that it's ok to do a a4l_ioctl_devcfg(...) during unbind, I could rewrite the logic to pass down a pointer to a4l_ioctl_devcfg to avoid this.
/Anders
Signature · 5 lines
Anders Blomdell Email: [email protected] Department of Automatic Control Lund University Phone: +46 46 222 4625 P.O. Box 118 Fax: +46 46 138118 SE-221 00 Lund, Sweden
include/analogy/device.h +2 -2
@@ -43,9 +43,9 @@/* Device specific flags */ unsigned long flags; -/* Driver assigned to this device thanks to attaching -procedure */ +/* Fields assigned to this device in attaching procedure */ a4l_drv_t *driver; +a4l_cxt_t *cxt;/* Hidden description stuff */ struct list_head subdvsq;
ksrc/drivers/analogy/device.c +4 -0
@@ -291,6 +291,7 @@a4l_dev_t *dev =a4l_get_dev (cxt); dev->driver = drv; + dev->cxt = cxt;if (drv->privdata_size ==0 ) __a4l_dbg(1, core_dbg,
@@ -331,6 +332,7 @@if (ret !=0 && dev->priv !=NULL ) {rtdm_free (dev->priv); dev->driver =NULL ; + dev->cxt =NULL ; }return ret;
@@ -360,6 +362,7 @@/* Free the private field */ rtdm_free (dev->priv); dev->driver =NULL ; + dev->cxt =NULL ; out_release_driver:return ret;
@@ -455,6 +458,7 @@return ret; } +EXPORT_SYMBOL_GPL (a4l_ioctl_devcfg);int a4l_ioctl_devinfo (a4l_cxt_t * cxt,void *arg) {
ksrc/drivers/analogy/national_instruments/mite.c +7 -1
@@ -103,6 +103,9 @@ list_entry(this, struct mite_struct, list);if (mite->pcidev == dev) { +if (mite->a4ldev) { +a4l_ioctl_devcfg (mite->a4ldev->cxt,NULL ); + }list_del (this);kfree (mite);break ;
@@ -117,7 +120,8 @@ .remove = mite_remove, }; -int a4l_mite_setup (struct mite_struct *mite,int use_iodwbsr_1) +int a4l_mite_setup (struct mite_struct *mite,int use_iodwbsr_1, +struct a4l_device *a4ldev) {unsigned long length;resource_size_t addr;
@@ -232,6 +236,7 @@ } mite->used =1 ; + mite->a4ldev = a4ldev;return 0 ; }
@@ -255,6 +260,7 @@pci_release_regions ( mite->pcidev ); mite->used =0 ; + mite->a4ldev =NULL ; }void a4l_mite_list_devices (void )
ksrc/drivers/analogy/national_instruments/mite.h +3 -1
@@ -70,6 +70,7 @@void *mite_io_addr;resource_size_t daq_phys_addr;void *daq_io_addr; +struct a4l_device *a4ldev; }; static inline
@@ -115,7 +116,8 @@return mite->pcidev->device; }; -int a4l_mite_setup (struct mite_struct *mite,int use_iodwbsr_1); +int a4l_mite_setup (struct mite_struct *mite,int use_iodwbsr_1, +struct a4l_device *a4ldev);void a4l_mite_unsetup (struct mite_struct *mite);void a4l_mite_list_devices (void ); struct mite_struct * a4l_mite_find_device(int bus,
ksrc/drivers/analogy/national_instruments/ni_660x.c +1 -1
@@ -1102,7 +1102,7 @@private (dev)->pfi_output_selects[i] = pfi_output_select_counter; } - ret =a4l_mite_setup (private (dev)->mite,1 ); + ret =a4l_mite_setup (private (dev)->mite,1 , dev);if (ret <0 ) {a4l_err (dev,"%s: error setting up mite\n" , __FUNCTION__);return ret;
ksrc/drivers/analogy/national_instruments/ni_670x.c +1 -1
@@ -297,7 +297,7 @@ devpriv->mite = mite; devpriv->board_ptr = board; - ret =a4l_mite_setup (devpriv->mite,0 ); + ret =a4l_mite_setup (devpriv->mite,0 , dev);if (ret <0 ) {a4l_err (dev,"%s: error setting up mite\n" , __FUNCTION__);return ret;
ksrc/drivers/analogy/national_instruments/pcimio.c +1 -1
@@ -1524,7 +1524,7 @@ devpriv->stc_readl = &win_in2; } - ret =a4l_mite_setup (devpriv->mite,0 ); + ret =a4l_mite_setup (devpriv->mite,0 , dev);if (ret <0 ) {a4l_err (dev,"pcmio_attach: error setting up mite\n" );
Quoted 23 lines · Anders Blomdell
Quoted 17 lines · Anders Blomdell
Quoted 4 lines · Anders Blomdell
Hi, just found that
echo 0000:06:01.0 >
/sys/bus/pci/drivers/analogy_mite/unbindQuoted 8 lines
does not do the same thing as
analogy_config-r analogyNin fact it leaves the system in a state where using the driver results in a kernel OOPS.
Will try to look into it further tomorrow...
Well, took quite some time to track down the '
analogy_config-r' bug (which was responsible for the kernel OOPS [i.e. after fixing it I have not got any OOPSes]).Quoted 5 lines
So back to the original problem, does anybody foresee that a call to
a4l_ioctl_devcfg(cxt, NULL)from the mite driver would give any problems (apart from getting the context pointer from the data structures the mite driver has handy)? It is probably not kosher to do ioctl on a driver that is not open, but...
Quoted 4 lines
Attached is a hack (as can be gleaned from the
EXPORT_SYMBOL_GPL), if the basic assumption that it's ok to do aa4l_ioctl_devcfg(...)during unbind, I could rewrite the logic to pass down a pointer toa4l_ioctl_devcfgto avoid this.
Sloppy me, should of course be:
ksrc/drivers/analogy/national_instruments/mite.c line 106
Quoted 1 line
ksrc/drivers/analogy/national_instruments/mite.c +1
-0+if (mite->a4ldev) {
if (mite->a4ldev && mite->a4ldev->cxt) {Quoted 2 lines
ksrc/drivers/analogy/national_instruments/mite.c +2
-0+a4l_ioctl_devcfg (mite->a4ldev->cxt,NULL ); + }