Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TBS 6284 and Full-Featured TechnoTrend S2-6400? #24

Closed
aminto opened this issue Jun 7, 2014 · 16 comments
Closed

TBS 6284 and Full-Featured TechnoTrend S2-6400? #24

aminto opened this issue Jun 7, 2014 · 16 comments

Comments

@aminto
Copy link

aminto commented Jun 7, 2014

Hi.

I bought a TBS 6284 card few years ago, and was disappointed that included closed source driver did not have any support for Full-Featured TT S2-6400 card (which is also a saa716x card).

Few days ago I found out about this open source project, and as source included saa716x_ff related files, I thought I give it a try.

Driver compiled fine, but after trying to load it, I get NULL pointer reference and Oops before registering last frontend of last device. I did not try to use the devices so can't tell if they are in working state.

[    3.734161] i2c i2c-3: tda18212: NXP TDA18212HN successfully identified
[    3.734167] SAA716x Budget 0000:03:00.0: DVB: registering adapter 1 frontend 0 (Sony CXD2820R)...
[    3.734331] DVB: registering new adapter (SAA716x dvb adapter)
[    3.736937] i2c i2c-3: tda18212: NXP TDA18212HN successfully identified
[    3.736942] SAA716x Budget 0000:03:00.0: DVB: registering adapter 4 frontend 0 (Sony CXD2820R)...
[    3.737099] DVB: registering new adapter (SAA716x dvb adapter)
[    4.341304] i2c i2c-4: tda18212: NXP TDA18212HN successfully identified
[    4.341310] SAA716x Budget 0000:03:00.0: DVB: registering adapter 5 frontend 0 (Sony CXD2820R)...
[    4.341473] DVB: registering new adapter (SAA716x dvb adapter)
[    4.347127] i2c i2c-4: tda18212: NXP TDA18212HN successfully identified
[    4.347131] SAA716x Budget 0000:03:00.0: DVB: registering adapter 6 frontend 0 (Sony CXD2820R)...
....
[    5.086953] DVB: registering new adapter (SAA716x dvb adapter)
[    5.190433] stv6110x_attach: Attaching STV6110x
[    5.199186] SAA716x FF 0000:01:00.0: DVB: registering adapter 7 frontend 0 (STV090x Multistandard)...
[    5.200169] BUG: unable to handle kernel NULL pointer dereference at 0000000000000014
[    5.200234] IP: [<ffffffffa0344bdd>] saa716x_dmabuf_sgfree+0xd/0x80 [saa716x_core]
[    5.200292] PGD 2138e2067 PUD 21381d067 PMD 0 
[    5.200334] Oops: 0000 [#1] SMP 
[    5.200366] Modules linked in: isl6423(O) stv6110x(O) tda18212(O) rc_pinnacle_pctv_hd(O) em28xx_rc(O) lnbp21(O) stb6100(O) tda18271(O) stb0899(O) em28xx_dvb(O) snd_hda_codec_hdmi snd_hda_codec_realtek rc_tt_1500(O) em28xx(O) tveeprom(O) v4l2_common(O) tda1004x(O) videodev(O) i915 media(O) fbcon coretemp cfbfillrect bitblit hwmon cfbimgblt softcursor i2c_algo_bit font x86_pkg_temp_thermal cfbcopyarea rc_hauppauge(O) intel_agp intel_gtt saa716x_budget(O) snd_hda_intel drm_kms_helper tas2101(O) snd_hda_codec cxd2820r(O) drm budget_ci(O) mb86a16(O) snd_pcm budget_core(O) stv090x(O) saa716x_ff(O+) agpgart ttpci_eeprom(O) snd_page_alloc e1000e saa7146(O) saa716x_core(O) fb snd_timer rc_core(O) dvb_core(O) fbdev snd i2c_i801 i2c_mux soundcore i2c_core ptp video pps_core thermal backlight fan button xts
[    5.201047]  gf128mul aes_x86_64 sha256_generic e1000 fuse multipath linear raid10 raid456 async_raid6_recov async_memcpy async_pq raid6_pq async_xor xor async_tx raid1 raid0 dm_snapshot dm_crypt dm_mirror dm_region_hash dm_log dm_mod firewire_core usbhid xhci_hcd ohci_hcd uhci_hcd usb_storage ehci_pci ehci_hcd usbcore usb_common sg ata_piix ahci libahci sata_sil24 sata_sil pata_jmicron libata
[    5.201403] CPU: 2 PID: 2526 Comm: systemd-udevd Tainted: G           O 3.12.13-gentoo #1
[    5.201457] Hardware name: System manufacturer System Product Name/P8Z77-V, BIOS 1908 03/14/2013
[    5.201513] task: ffff88021eb50660 ti: ffff880213a34000 task.ti: ffff880213a34000
[    5.201561] RIP: 0010:[<ffffffffa0344bdd>]  [<ffffffffa0344bdd>] saa716x_dmabuf_sgfree+0xd/0x80 [saa716x_core]
[    5.201631] RSP: 0018:ffff880213a35b68  EFLAGS: 00010286
[    5.201666] RAX: 0000000000000000 RBX: ffff8800c7862f50 RCX: 0000000000000002
[    5.201711] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8800c7862f50
[    5.201757] RBP: ffff8800c7860000 R08: 0000000000000000 R09: 0000000000000027
[    5.201805] R10: ffff88021f9f3fc0 R11: ffffffff81857c40 R12: 000000000000001b
[    5.201851] R13: ffff8800c7860000 R14: 000000000000260a R15: 00000000001fa400
[    5.201897] FS:  00007fc9a305b7c0(0000) GS:ffff88021fb00000(0000) knlGS:0000000000000000
[    5.201948] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    5.201986] CR2: 0000000000000014 CR3: 0000000213952000 CR4: 00000000001407e0
[    5.202031] Stack:
[    5.202048]  ffff8800c7862f50 ffffffffa034553c 0000000000000001 ffffffffa0346647
[    5.202109]  ffff8800c78617f8 0000000000000001 ffff8800c7861358 ffffffffa0346f4a
[    5.202170]  0000000000000087 ffff8800c7860000 00000000ffffffed ffff88021357b000
[    5.202231] Call Trace:
[    5.202255]  [<ffffffffa034553c>] ? saa716x_dmabuf_free+0x4c/0x70 [saa716x_core]
[    5.202307]  [<ffffffffa0346647>] ? saa716x_fgpi_exit+0x47/0x60 [saa716x_core]
[    5.202357]  [<ffffffffa0346f4a>] ? saa716x_dvb_exit+0x3a/0xf0 [saa716x_core]
[    5.202408]  [<ffffffffa03fa1fa>] ? saa716x_ff_pci_probe+0xaba/0xe20 [saa716x_ff]
[    5.202462]  [<ffffffff812ebb08>] ? pci_device_probe+0x98/0xe0
[    5.202505]  [<ffffffff8135e7b8>] ? driver_probe_device+0x68/0x220
[    5.202549]  [<ffffffff8135ea03>] ? __driver_attach+0x93/0xa0
[    5.202589]  [<ffffffff8135e970>] ? driver_probe_device+0x220/0x220
[    5.202632]  [<ffffffff8135c9dd>] ? bus_for_each_dev+0x4d/0x80
[    5.202673]  [<ffffffff8135de44>] ? bus_add_driver+0xf4/0x280
[    5.202715]  [<ffffffff8135effe>] ? driver_register+0x5e/0xf0
[    5.202757]  [<ffffffffa0400000>] ? 0xffffffffa03fffff
[    5.202796]  [<ffffffff810002f2>] ? do_one_initcall+0x102/0x150
[    5.202841]  [<ffffffff81097e75>] ? load_module+0x1815/0x20a0
[    5.202882]  [<ffffffff81095260>] ? mod_kobject_put+0x50/0x50
[    5.202925]  [<ffffffff81098875>] ? SyS_finit_module+0x95/0xa0
[    5.204872]  [<ffffffff814d6c62>] ? system_call_fastpath+0x16/0x1b
[    5.206839] Code: e8 4f b6 18 e1 41 0f b6 94 24 30 0b 00 00 e9 e6 fe ff ff 0f 0b 66 0f 1f 84 00 00 00 00 00 53 48 85 ff 48 89 fb 48 8b 47 30 74 4a <83> 78 14 03 7f 46 48 8b 7b 08 48 c7 43 10 00 00 00 00 48 85 ff 
[    5.209241] RIP  [<ffffffffa0344bdd>] saa716x_dmabuf_sgfree+0xd/0x80 [saa716x_core]
[    5.211472]  RSP <ffff880213a35b68>
[    5.213703] CR2: 0000000000000014
[    5.215978] ---[ end trace 1228cfa30ff9cb35 ]---

Oops always comes before registering LAST frontend/adapter/device or whatever. So here 4 tuners of TBS are ok, and first tuner of S2-6400.

I also tried to load S2-6400 first and TBS second, and here's the result:
(S2-6400 loaded already long before).

Jun  7 19:48:37 localhost kernel: [ 2849.821645] DVB: registering new adapter (SAA716x dvb adapter)
Jun  7 19:48:38 localhost kernel: [ 2850.429622] i2c i2c-15: tda18212: NXP TDA18212HN successfully identified
Jun  7 19:48:38 localhost kernel: [ 2850.429629] SAA716x Budget 0000:03:00.0: DVB: registering adapter 5 frontend 0 (Sony CXD2820R)...
Jun  7 19:48:38 localhost kernel: [ 2850.429895] DVB: registering new adapter (SAA716x dvb adapter)
Jun  7 19:48:38 localhost kernel: [ 2850.434918] i2c i2c-15: tda18212: NXP TDA18212HN successfully identified
Jun  7 19:48:38 localhost kernel: [ 2850.434925] SAA716x Budget 0000:03:00.0: DVB: registering adapter 6 frontend 0 (Sony CXD2820R)...
Jun  7 19:48:38 localhost kernel: [ 2850.435124] DVB: registering new adapter (SAA716x dvb adapter)
Jun  7 19:48:38 localhost kernel: [ 2851.040899] i2c i2c-16: tda18212: NXP TDA18212HN successfully identified
Jun  7 19:48:38 localhost kernel: [ 2851.040906] SAA716x Budget 0000:03:00.0: DVB: registering adapter 7 frontend 0 (Sony CXD2820R)...
Jun  7 19:48:38 localhost kernel: [ 2851.042077] BUG: unable to handle kernel NULL pointer dereference at 0000000000000014
Jun  7 19:48:38 localhost kernel: [ 2851.042132] IP: [<ffffffffa0327bdd>] saa716x_dmabuf_sgfree+0xd/0x80 [saa716x_core]
Jun  7 19:48:38 localhost kernel: [ 2851.042181] PGD c25e3067 PUD c27d6067 PMD 0 
Jun  7 19:48:38 localhost kernel: [ 2851.042209] Oops: 0000 [#1] SMP 
Jun  7 19:48:38 localhost kernel: [ 2851.042230] Modules linked in: tda18212(O) saa716x_budget(O+) tas2101(O) i2c_mux cx23885(O) altera_ci(O) altera_stapl(O) videobuf_dvb(O) btcx_risc(O) videobuf_dma_sg(O) cx2341x(O) videobuf_core(O) lirc_serial(O) lirc_dev(O) nfsd bonding xt_tcpudp nf_conntrack_ipv6 nf_defrag_ipv6 xt_conntrack nf_conntrack ip6table_filter ip6_tables x_tables nvram loop_serpent(O) loop(O) isl6423(O) stv6110x(O) rc_pinnacle_pctv_hd(O) em28xx_rc(O) lnbp21(O) stb6100(O) tda18271(O) stb0899(O) em28xx_dvb(O) snd_hda_codec_hdmi snd_hda_codec_realtek rc_tt_1500(O) tda1004x(O) em28xx(O) tveeprom(O) v4l2_common(O) i915 videodev(O) media(O) coretemp fbcon cfbfillrect hwmon cfbimgblt rc_hauppauge(O) bitblit i2c_algo_bit x86_pkg_temp_thermal softcursor cfbcopyarea font intel_agp intel_gtt drm_kms_helper snd_hda_intel drm budget_ci(O) cxd2820r(O) snd_hda_codec budget_core(O) mb86a16(O) snd_pcm agpgart ttpci_eeprom(O) saa716x_ff(O) stv090x(O) e1000e saa7146(O) fb saa716x_core(O) snd_page_alloc rc_core(O) fbdev dvb_core(O) snd_timer snd i2c_i801 ptp video i2c_core soundcore pps_core backlight thermal fan button xts gf128mul aes_x86_64 sha256_generic e1000 fuse multipath linear raid10 raid456 async_raid6_recov async_memcpy async_pq raid6_pq async_xor xor async_tx raid1 raid0 dm_snapshot dm_crypt dm_mirror dm_region_hash dm_log dm_mod firewire_core usbhid xhci_hcd ohci_hcd uhci_hcd usb_storage ehci_pci ehci_hcd usbcore usb_common sg ata_piix ahci libahci sata_sil24 sata_sil pata_jmicron libata
Jun  7 19:48:38 localhost kernel: [ 2851.043146] CPU: 0 PID: 7790 Comm: modprobe Tainted: G           O 3.12.13-gentoo #1
Jun  7 19:48:38 localhost kernel: [ 2851.043187] Hardware name: System manufacturer System Product Name/P8Z77-V, BIOS 1908 03/14/2013
Jun  7 19:48:38 localhost kernel: [ 2851.043235] task: ffff8800c7f36000 ti: ffff8800c25ae000 task.ti: ffff8800c25ae000
Jun  7 19:48:38 localhost kernel: [ 2851.043275] RIP: 0010:[<ffffffffa0327bdd>]  [<ffffffffa0327bdd>] saa716x_dmabuf_sgfree+0xd/0x80 [saa716x_core]
Jun  7 19:48:38 localhost kernel: [ 2851.043339] RSP: 0018:ffff8800c25afbc8  EFLAGS: 00010286
Jun  7 19:48:38 localhost kernel: [ 2851.043368] RAX: 0000000000000000 RBX: ffff8802160ca890 RCX: 0000000000000002
Jun  7 19:48:38 localhost kernel: [ 2851.043407] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff8802160ca890
Jun  7 19:48:38 localhost kernel: [ 2851.043444] RBP: ffff8802160c8000 R08: 0000000000000000 R09: 000000000000001b
Jun  7 19:48:38 localhost kernel: [ 2851.043479] R10: ffff88021f9f3d80 R11: ffffffff818576c0 R12: 0000000000000000
Jun  7 19:48:38 localhost kernel: [ 2851.043517] R13: ffff8802160c8000 R14: ffffffffa00b86c0 R15: ffff8800c62b6dc0
Jun  7 19:48:38 localhost kernel: [ 2851.043558] FS:  00007fdc19c4d700(0000) GS:ffff88021fa00000(0000) knlGS:0000000000000000
Jun  7 19:48:38 localhost kernel: [ 2851.043603] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jun  7 19:48:38 localhost kernel: [ 2851.043637] CR2: 0000000000000014 CR3: 00000000378e8000 CR4: 00000000001407f0
Jun  7 19:48:38 localhost kernel: [ 2851.043674] Stack:
Jun  7 19:48:38 localhost kernel: [ 2851.043687]  ffff8802160ca890 ffffffffa032853c 0000000000000001 ffffffffa0329647
Jun  7 19:48:38 localhost kernel: [ 2851.043731]  ffff8802160ca258 0000000000000003 ffff8802160c9db8 ffffffffa0329f4a
Jun  7 19:48:38 localhost kernel: [ 2851.043778]  0000000000000000 ffff8802160c8000 00000000ffffffed ffffffffa00b86c0
Jun  7 19:48:38 localhost kernel: [ 2851.043826] Call Trace:
Jun  7 19:48:38 localhost kernel: [ 2851.043853]  [<ffffffffa032853c>] ? saa716x_dmabuf_free+0x4c/0x70 [saa716x_core]
Jun  7 19:48:38 localhost kernel: [ 2851.043899]  [<ffffffffa0329647>] ? saa716x_fgpi_exit+0x47/0x60 [saa716x_core]
Jun  7 19:48:38 localhost kernel: [ 2851.043941]  [<ffffffffa0329f4a>] ? saa716x_dvb_exit+0x3a/0xf0 [saa716x_core]
Jun  7 19:48:38 localhost kernel: [ 2851.043983]  [<ffffffffa00b78dc>] ? saa716x_budget_pci_probe+0x1cc/0x274 [saa716x_budget]
Jun  7 19:48:38 localhost kernel: [ 2851.044028]  [<ffffffff812ebb08>] ? pci_device_probe+0x98/0xe0
Jun  7 19:48:38 localhost kernel: [ 2851.044061]  [<ffffffff8135e7b8>] ? driver_probe_device+0x68/0x220
Jun  7 19:48:38 localhost kernel: [ 2851.044096]  [<ffffffff8135ea03>] ? __driver_attach+0x93/0xa0
Jun  7 19:48:38 localhost kernel: [ 2851.044128]  [<ffffffff8135e970>] ? driver_probe_device+0x220/0x220
Jun  7 19:48:38 localhost kernel: [ 2851.044165]  [<ffffffff8135c9dd>] ? bus_for_each_dev+0x4d/0x80
Jun  7 19:48:38 localhost kernel: [ 2851.044198]  [<ffffffff8135de44>] ? bus_add_driver+0xf4/0x280
Jun  7 19:48:38 localhost kernel: [ 2851.044233]  [<ffffffff8135effe>] ? driver_register+0x5e/0xf0
Jun  7 19:48:38 localhost kernel: [ 2851.044277]  [<ffffffffa00eb000>] ? 0xffffffffa00eafff
Jun  7 19:48:38 localhost kernel: [ 2851.044311]  [<ffffffff810002f2>] ? do_one_initcall+0x102/0x150
Jun  7 19:48:38 localhost kernel: [ 2851.044349]  [<ffffffff81097e75>] ? load_module+0x1815/0x20a0
Jun  7 19:48:38 localhost kernel: [ 2851.045912]  [<ffffffff81095260>] ? mod_kobject_put+0x50/0x50
Jun  7 19:48:38 localhost kernel: [ 2851.047491]  [<ffffffff81098875>] ? SyS_finit_module+0x95/0xa0
Jun  7 19:48:38 localhost kernel: [ 2851.048933]  [<ffffffff814d6c62>] ? system_call_fastpath+0x16/0x1b
Jun  7 19:48:38 localhost kernel: [ 2851.050126] Code: e8 4f 86 1a e1 41 0f b6 94 24 30 0b 00 00 e9 e6 fe ff ff 0f 0b 66 0f 1f 84 00 00 00 00 00 53 48 85 ff 48 89 fb 48 8b 47 30 74 4a <83> 78 14 03 7f 46 48 8b 7b 08 48 c7 43 10 00 00 00 00 48 85 ff 
Jun  7 19:48:38 localhost kernel: [ 2851.052652] RIP  [<ffffffffa0327bdd>] saa716x_dmabuf_sgfree+0xd/0x80 [saa716x_core]
Jun  7 19:48:38 localhost kernel: [ 2851.053870]  RSP <ffff8800c25afbc8>
Jun  7 19:48:38 localhost kernel: [ 2851.055043] CR2: 0000000000000014
Jun  7 19:48:38 localhost kernel: [ 2851.060047] ---[ end trace cb95511fbdfa65d5 ]---

And here only 3 tuners of TBS 6284 are registered before oopsing.

Please advice how can I give any futher assistance and/or do more debuging, in case more information is required.

@ljalves ljalves added the bug label Jun 25, 2014
@ljalves
Copy link
Owner

ljalves commented Jun 25, 2014

Unfortunately I don't have any of those cards so I can't solve this issue.
If anyone happens to fix this, pull requests are welcome.

ljalves pushed a commit that referenced this issue Jul 17, 2014
cxgb4_netdev maybe lead to dead lock, since it uses a spin lock, and be called
in both thread and softirq context, but not disable BH, the lockdep report is
below; In fact, cxgb4_netdev only reads adap_rcu_list with RCU protection, so
not need to hold spin lock again.
	=================================
	[ INFO: inconsistent lock state ]
	3.14.7+ #24 Tainted: G         C O
	---------------------------------
	inconsistent {SOFTIRQ-ON-W} -> {IN-SOFTIRQ-W} usage.
	radvd/3794 [HC0[0]:SC1[1]:HE1:SE0] takes:
	 (adap_rcu_lock){+.?...}, at: [<ffffffffa09989ea>] clip_add+0x2c/0x116 [cxgb4]
	{SOFTIRQ-ON-W} state was registered at:
	  [<ffffffff810fca81>] __lock_acquire+0x34a/0xe48
	  [<ffffffff810fd98b>] lock_acquire+0x82/0x9d
	  [<ffffffff815d6ff8>] _raw_spin_lock+0x34/0x43
	  [<ffffffffa09989ea>] clip_add+0x2c/0x116 [cxgb4]
	  [<ffffffffa0998beb>] cxgb4_inet6addr_handler+0x117/0x12c [cxgb4]
	  [<ffffffff815da98b>] notifier_call_chain+0x32/0x5c
	  [<ffffffff815da9f9>] __atomic_notifier_call_chain+0x44/0x6e
	  [<ffffffff815daa32>] atomic_notifier_call_chain+0xf/0x11
	  [<ffffffff815b1356>] inet6addr_notifier_call_chain+0x16/0x18
	  [<ffffffffa01f72e5>] ipv6_add_addr+0x404/0x46e [ipv6]
	  [<ffffffffa01f8df0>] addrconf_add_linklocal+0x5f/0x95 [ipv6]
	  [<ffffffffa01fc3e9>] addrconf_notify+0x632/0x841 [ipv6]
	  [<ffffffff815da98b>] notifier_call_chain+0x32/0x5c
	  [<ffffffff810e09a1>] __raw_notifier_call_chain+0x9/0xb
	  [<ffffffff810e09b2>] raw_notifier_call_chain+0xf/0x11
	  [<ffffffff8151b3b7>] call_netdevice_notifiers_info+0x4e/0x56
	  [<ffffffff8151b3d0>] call_netdevice_notifiers+0x11/0x13
	  [<ffffffff8151c0a6>] netdev_state_change+0x1f/0x38
	  [<ffffffff8152f004>] linkwatch_do_dev+0x3b/0x49
	  [<ffffffff8152f184>] __linkwatch_run_queue+0x10b/0x144
	  [<ffffffff8152f1dd>] linkwatch_event+0x20/0x27
	  [<ffffffff810d7bc0>] process_one_work+0x1cb/0x2ee
	  [<ffffffff810d7e3b>] worker_thread+0x12e/0x1fc
	  [<ffffffff810dd391>] kthread+0xc4/0xcc
	  [<ffffffff815dc48c>] ret_from_fork+0x7c/0xb0
	irq event stamp: 3388
	hardirqs last  enabled at (3388): [<ffffffff810c6c85>]
	__local_bh_enable_ip+0xaa/0xd9
	hardirqs last disabled at (3387): [<ffffffff810c6c2d>]
	__local_bh_enable_ip+0x52/0xd9
	softirqs last  enabled at (3288): [<ffffffffa01f1d5b>]
	rcu_read_unlock_bh+0x0/0x2f [ipv6]
	softirqs last disabled at (3289): [<ffffffff815ddafc>]
	do_softirq_own_stack+0x1c/0x30

	other info that might help us debug this:
	 Possible unsafe locking scenario:

	       CPU0
	       ----
	  lock(adap_rcu_lock);
	  <Interrupt>
	    lock(adap_rcu_lock);

	 *** DEADLOCK ***

	5 locks held by radvd/3794:
	 #0:  (sk_lock-AF_INET6){+.+.+.}, at: [<ffffffffa020b85a>]
	rawv6_sendmsg+0x74b/0xa4d [ipv6]
	 #1:  (rcu_read_lock){.+.+..}, at: [<ffffffff8151ac6b>]
	rcu_lock_acquire+0x0/0x29
	 #2:  (rcu_read_lock){.+.+..}, at: [<ffffffffa01f4cca>]
	rcu_lock_acquire.constprop.16+0x0/0x30 [ipv6]
	 #3:  (rcu_read_lock){.+.+..}, at: [<ffffffff810e09b4>]
	rcu_lock_acquire+0x0/0x29
	 #4:  (rcu_read_lock){.+.+..}, at: [<ffffffffa0998782>]
	rcu_lock_acquire.constprop.40+0x0/0x30 [cxgb4]

	stack backtrace:
	CPU: 7 PID: 3794 Comm: radvd Tainted: G         C O 3.14.7+ #24
	Hardware name: Supermicro X7DBU/X7DBU, BIOS 6.00 12/03/2007
	 ffffffff81f15990 ffff88012fdc36a8 ffffffff815d0016 0000000000000006
	 ffff8800c80dc2a0 ffff88012fdc3708 ffffffff815cc727 0000000000000001
	 0000000000000001 ffff880100000000 ffffffff81015b02 ffff8800c80dcb58
	Call Trace:
	 <IRQ>  [<ffffffff815d0016>] dump_stack+0x4e/0x71
	 [<ffffffff815cc727>] print_usage_bug+0x1ec/0x1fd
	 [<ffffffff81015b02>] ? save_stack_trace+0x27/0x44
	 [<ffffffff810fbfaa>] ? check_usage_backwards+0xa0/0xa0
	 [<ffffffff810fc640>] mark_lock+0x11b/0x212
	 [<ffffffff810fca0b>] __lock_acquire+0x2d4/0xe48
	 [<ffffffff810fbfaa>] ? check_usage_backwards+0xa0/0xa0
	 [<ffffffff810fbff6>] ? check_usage_forwards+0x4c/0xa6
	 [<ffffffff810c6c8a>] ? __local_bh_enable_ip+0xaf/0xd9
	 [<ffffffff810fd98b>] lock_acquire+0x82/0x9d
	 [<ffffffffa09989ea>] ? clip_add+0x2c/0x116 [cxgb4]
	 [<ffffffffa0998782>] ? rcu_read_unlock+0x23/0x23 [cxgb4]
	 [<ffffffff815d6ff8>] _raw_spin_lock+0x34/0x43
	 [<ffffffffa09989ea>] ? clip_add+0x2c/0x116 [cxgb4]
	 [<ffffffffa09987b0>] ? rcu_lock_acquire.constprop.40+0x2e/0x30 [cxgb4]
	 [<ffffffffa0998782>] ? rcu_read_unlock+0x23/0x23 [cxgb4]
	 [<ffffffffa09989ea>] clip_add+0x2c/0x116 [cxgb4]
	 [<ffffffffa0998beb>] cxgb4_inet6addr_handler+0x117/0x12c [cxgb4]
	 [<ffffffff810fd99d>] ? lock_acquire+0x94/0x9d
	 [<ffffffff810e09b4>] ? raw_notifier_call_chain+0x11/0x11
	 [<ffffffff815da98b>] notifier_call_chain+0x32/0x5c
	 [<ffffffff815da9f9>] __atomic_notifier_call_chain+0x44/0x6e
	 [<ffffffff815daa32>] atomic_notifier_call_chain+0xf/0x11
	 [<ffffffff815b1356>] inet6addr_notifier_call_chain+0x16/0x18
	 [<ffffffffa01f72e5>] ipv6_add_addr+0x404/0x46e [ipv6]
	 [<ffffffff810fde6a>] ? trace_hardirqs_on+0xd/0xf
	 [<ffffffffa01fb634>] addrconf_prefix_rcv+0x385/0x6ea [ipv6]
	 [<ffffffffa0207950>] ndisc_rcv+0x9d3/0xd76 [ipv6]
	 [<ffffffffa020d536>] icmpv6_rcv+0x592/0x67b [ipv6]
	 [<ffffffff810c6c85>] ? __local_bh_enable_ip+0xaa/0xd9
	 [<ffffffff810c6c85>] ? __local_bh_enable_ip+0xaa/0xd9
	 [<ffffffff810fd8dc>] ? lock_release+0x14e/0x17b
	 [<ffffffffa020df97>] ? rcu_read_unlock+0x21/0x23 [ipv6]
	 [<ffffffff8150df52>] ? rcu_read_unlock+0x23/0x23
	 [<ffffffffa01f4ede>] ip6_input_finish+0x1e4/0x2fc [ipv6]
	 [<ffffffffa01f540b>] ip6_input+0x33/0x38 [ipv6]
	 [<ffffffffa01f5557>] ip6_mc_input+0x147/0x160 [ipv6]
	 [<ffffffffa01f4ba3>] ip6_rcv_finish+0x7c/0x81 [ipv6]
	 [<ffffffffa01f5397>] ipv6_rcv+0x3a1/0x3e2 [ipv6]
	 [<ffffffff8151ef96>] __netif_receive_skb_core+0x4ab/0x511
	 [<ffffffff810fdc94>] ? mark_held_locks+0x71/0x99
	 [<ffffffff8151f0c0>] ? process_backlog+0x69/0x15e
	 [<ffffffff8151f045>] __netif_receive_skb+0x49/0x5b
	 [<ffffffff8151f0cf>] process_backlog+0x78/0x15e
	 [<ffffffff8151f571>] ? net_rx_action+0x1a2/0x1cc
	 [<ffffffff8151f47b>] net_rx_action+0xac/0x1cc
	 [<ffffffff810c69b7>] ? __do_softirq+0xad/0x218
	 [<ffffffff810c69ff>] __do_softirq+0xf5/0x218
	 [<ffffffff815ddafc>] do_softirq_own_stack+0x1c/0x30
	 <EOI>  [<ffffffff810c6bb6>] do_softirq+0x38/0x5d
	 [<ffffffffa01f1d5b>] ? ip6_copy_metadata+0x156/0x156 [ipv6]
	 [<ffffffff810c6c78>] __local_bh_enable_ip+0x9d/0xd9
	 [<ffffffffa01f1d88>] rcu_read_unlock_bh+0x2d/0x2f [ipv6]
	 [<ffffffffa01f28b4>] ip6_finish_output2+0x381/0x3d8 [ipv6]
	 [<ffffffffa01f49ef>] ip6_finish_output+0x6e/0x73 [ipv6]
	 [<ffffffffa01f4a70>] ip6_output+0x7c/0xa8 [ipv6]
	 [<ffffffff815b1bfa>] dst_output+0x18/0x1c
	 [<ffffffff815b1c9e>] ip6_local_out+0x1c/0x21
	 [<ffffffffa01f2489>] ip6_push_pending_frames+0x37d/0x427 [ipv6]
	 [<ffffffff81558af8>] ? skb_orphan+0x39/0x39
	 [<ffffffffa020b85a>] ? rawv6_sendmsg+0x74b/0xa4d [ipv6]
	 [<ffffffffa020ba51>] rawv6_sendmsg+0x942/0xa4d [ipv6]
	 [<ffffffff81584cd2>] inet_sendmsg+0x3d/0x66
	 [<ffffffff81508930>] __sock_sendmsg_nosec+0x25/0x27
	 [<ffffffff8150b0d7>] sock_sendmsg+0x5a/0x7b
	 [<ffffffff810fd8dc>] ? lock_release+0x14e/0x17b
	 [<ffffffff8116d756>] ? might_fault+0x9e/0xa5
	 [<ffffffff8116d70d>] ? might_fault+0x55/0xa5
	 [<ffffffff81508cb1>] ? copy_from_user+0x2a/0x2c
	 [<ffffffff8150b70c>] ___sys_sendmsg+0x226/0x2d9
	 [<ffffffff810fcd25>] ? __lock_acquire+0x5ee/0xe48
	 [<ffffffff810fde01>] ? trace_hardirqs_on_caller+0x145/0x1a1
	 [<ffffffff8118efcb>] ? slab_free_hook.isra.71+0x50/0x59
	 [<ffffffff8115c81f>] ? release_pages+0xbc/0x181
	 [<ffffffff810fd99d>] ? lock_acquire+0x94/0x9d
	 [<ffffffff81115e97>] ? read_seqcount_begin.constprop.25+0x73/0x90
	 [<ffffffff8150c408>] __sys_sendmsg+0x3d/0x5b
	 [<ffffffff8150c433>] SyS_sendmsg+0xd/0x19
	 [<ffffffff815dc53d>] system_call_fastpath+0x1a/0x1f

Reported-by: Ben Greear <greearb@candelatech.com>
Cc: Casey Leedom <leedom@chelsio.com>
Cc: Hariprasad Shenai <hariprasad@chelsio.com>
Signed-off-by: Li RongQing <roy.qing.li@gmail.com>
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Acked-by: Casey Leedom <leedom@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
@ljalves
Copy link
Owner

ljalves commented Jul 19, 2014

@aminto have you tested plugging only one card at time?

@aminto
Copy link
Author

aminto commented Jul 19, 2014

@ljalves Yes, when TBS card is removed S2-6400 is functioning properly. I haven't tested with TBS only without S2-6400 as it is my TV-out/MPEG-decoder card.

I could try it with TBS only somewhen, but I would not have any way to figure out how it is working without any TV-out, and it is a production system and I have no possibility for big configuration changes and downtimes. :( So only way I could do is to check if it is detected and drivers are loaded properly, and MAYBE trying to tune it with some dvb-apps utilities.

I could also try to do some debugging when both cards are attached, but I'm not a developer so I don't really know how..

@ljalves
Copy link
Owner

ljalves commented Jul 21, 2014

@aminto
I have fixed the tbs6284 driver (it wasn't working before).
You could try and see if that also fixed your crash :)

@aminto
Copy link
Author

aminto commented Aug 3, 2014

@ljalves I had chance to try it today again, with freshly compiled kernel (3.15.8 with Gentoo patches) and freshly fetched driver. Still getting Oops before loading last frontend of last saa716x card. Oops is looking similar to what was before. I Tried to tune TBS card with dvbtune and it's tuning ok. TT S2-6400 is not working, as Oops occurred while loading it. (I would guess things would be other vice-versa if S2-6400 driver is loaded before TBS, and TBS card would not work if Oops did occur while loading it).

This is fairly similar to what happened before, when I tried to combine closed source TBS driver and TT S2-6400 driver to work together, so I think it is some bug in SAA716x code.

I also tried to remove TT S2-6400 card temporarely. Without TT S2-6400 TBS is loading and working (tuning with dvbtune atleast) without Oops, and when TBS is removed TT S2-6400 is loading and working fine.

Here's current Oops:

[    5.174156] SAA716x FF 0000:01:00.0: DVB: registering adapter 6 frontend 0 (STV090x Multistandard)...
[    5.175127] BUG: unable to handle kernel NULL pointer dereference at 0000000000000014
[    5.175181] IP: [<ffffffffa0435b3d>] saa716x_dmabuf_sgfree+0xd/0x80 [saa716x_core]
[    5.175229] PGD 0 
[    5.175247] Oops: 0000 [#1] SMP 
[    5.175274] Modules linked in: rc_pinnacle_pctv_hd(O) isl6423(O) em28xx_rc(O+) stv6110x(O) tda18271(O) em28xx_dvb(O) em28xx(O) tveeprom(O) v4l2_common(O) videodev(O) media(O) tda18212(O) lnbp21(O) stb6100(O) stb0899(O) snd_hda_codec_hdmi snd_hda_codec_realtek snd_hda_codec_generic rc_tt_1500(O) coretemp hwmon x86_pkg_temp_thermal tda1004x(O) i2c_i801 i915 rc_hauppauge(O) fbcon bitblit softcursor font cfbfillrect cfbimgblt i2c_algo_bit saa716x_budget(O) cfbcopyarea drm_kms_helper tas2101(O) cxd2820r(O) drm mb86a16(O) budget_ci(O) snd_hda_intel cx24117(O) budget_core(O) snd_hda_controller fb saa716x_ff(O+) stv090x(O) ttpci_eeprom(O) fbdev snd_hda_codec saa7146(O) saa716x_core(O) intel_gtt dvb_core(O) rc_core(O) agpgart snd_pcm i2c_mux i2c_core e1000e snd_timer snd video ptp thermal soundcore fan backlight
[    5.175853]  pps_core button xts gf128mul aes_x86_64 sha256_generic e1000 fuse multipath linear raid10 raid456 async_raid6_recov async_memcpy async_pq raid6_pq async_xor xor async_tx raid1 raid0 dm_snapshot dm_bufio dm_crypt dm_mirror dm_region_hash dm_log dm_mod firewire_core usbhid xhci_hcd ohci_hcd uhci_hcd usb_storage ehci_pci ehci_hcd usbcore usb_common sg ata_piix ahci libahci sata_sil24 sata_sil pata_jmicron libata
[    5.176179] CPU: 3 PID: 2527 Comm: systemd-udevd Tainted: G           O  3.15.8-gentoo #1
[    5.176224] Hardware name: System manufacturer System Product Name/P8Z77-V, BIOS 2104 08/13/2013
[    5.176271] task: ffff88021eb29090 ti: ffff880213260000 task.ti: ffff880213260000
[    5.176311] RIP: 0010:[<ffffffffa0435b3d>]  [<ffffffffa0435b3d>] saa716x_dmabuf_sgfree+0xd/0x80 [saa716x_core]
[    5.176370] RSP: 0018:ffff880213263b58  EFLAGS: 00010286
[    5.176400] RAX: 0000000000000000 RBX: ffff880213426fa0 RCX: 0000000000000002
[    5.176438] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff880213426fa0
[    5.176476] RBP: ffff880213424000 R08: 0000000000000000 R09: 00000000000004f0
[    5.176515] R10: 0000000000000003 R11: ffffffff8185fa18 R12: 000000000000001b
[    5.176553] R13: ffff880213424000 R14: 000000000000260a R15: 00000000001fa400
[    5.177957] FS:  00007f3fb6f0c7c0(0000) GS:ffff88021fb80000(0000) knlGS:0000000000000000
[    5.179381] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    5.180816] CR2: 0000000000000014 CR3: 0000000216d8a000 CR4: 00000000001407e0
[    5.182260] Stack:
[    5.183695]  ffff880213426fa0 ffffffffa043646c 0000000000000001 ffffffffa0437665
[    5.185175]  ffff880213425818 0000000000000001 ffff880213425368 ffffffffa0437f6a
[    5.186660]  0000000000000087 ffff880213424000 00000000ffffffed ffff88021ea55000
[    5.188159] Call Trace:
[    5.189652]  [<ffffffffa043646c>] ? saa716x_dmabuf_free+0x4c/0x70 [saa716x_core]
[    5.191183]  [<ffffffffa0437665>] ? saa716x_fgpi_exit+0x45/0x60 [saa716x_core]
[    5.192725]  [<ffffffffa0437f6a>] ? saa716x_dvb_exit+0x3a/0x140 [saa716x_core]
[    5.194274]  [<ffffffffa04ab1bc>] ? saa716x_ff_pci_probe+0xacc/0xe10 [saa716x_ff]
[    5.203911]  [<ffffffff812fb808>] ? pci_device_probe+0x98/0xf0
[    5.205545]  [<ffffffff813705a7>] ? driver_probe_device+0x87/0x250
[    5.207184]  [<ffffffff81370803>] ? __driver_attach+0x93/0xa0
[    5.208820]  [<ffffffff81370770>] ? driver_probe_device+0x250/0x250
[    5.210451]  [<ffffffff8136e93d>] ? bus_for_each_dev+0x4d/0x80
[    5.212077]  [<ffffffff8136fcd4>] ? bus_add_driver+0x114/0x220
[    5.213699]  [<ffffffffa04b1000>] ? 0xffffffffa04b0fff
[    5.215292]  [<ffffffff81370dfe>] ? driver_register+0x5e/0xf0
[    5.216877]  [<ffffffffa04b1000>] ? 0xffffffffa04b0fff
[    5.218442]  [<ffffffff81000352>] ? do_one_initcall+0x102/0x150
[    5.220022]  [<ffffffff810a1add>] ? load_module+0x182d/0x2060
[    5.221565]  [<ffffffff8109ef70>] ? mod_kobject_put+0x50/0x50
[    5.223077]  [<ffffffff810a2485>] ? SyS_finit_module+0x95/0xa0
[    5.224554]  [<ffffffff814f5822>] ? system_call_fastpath+0x16/0x1b
[    5.225995] Code: e8 bd 92 0b e1 41 0f b6 94 24 30 0b 00 00 e9 e6 fe ff ff 0f 0b 66 0f 1f 84 00 00 00 00 00 53 48 85 ff 48 89 fb 48 8b 47 30 74 4a <83> 78 14 03 7f 46 48 8b 7b 08 48 c7 43 10 00 00 00 00 48 85 ff 
[    5.229142] RIP  [<ffffffffa0435b3d>] saa716x_dmabuf_sgfree+0xd/0x80 [saa716x_core]
[    5.230608]  RSP <ffff880213263b58>
[    5.232022] CR2: 0000000000000014
[    5.233409] ---[ end trace 3f36d94e74744085 ]---

@ljalves
Copy link
Owner

ljalves commented Aug 3, 2014

@aminto
Are you setting int_type=1 for both modules?
(_budget & _ff)

@aminto
Copy link
Author

aminto commented Aug 3, 2014

Only tried it on _budget, also without int_type completely. Should it be set for both?

@ljalves
Copy link
Owner

ljalves commented Aug 3, 2014

sure... try int_type=1 on both

ljalves pushed a commit that referenced this issue Nov 7, 2014
lockdep reports a potential circular dependecy deadlock when registering input device.

Unlock mutex rc_dev->lock prior to calling ir_raw_event_register to avoid the circular
dependency since that function also calls input_register_device and rc_open.

 ======================================================
 [ INFO: possible circular locking dependency detected ]
 3.17.0-rc7+ #24 Not tainted
 -------------------------------------------------------
 modprobe/647 is trying to acquire lock:
  (input_mutex){+.+.+.}, at: [<ffffffff812ed81c>] input_register_device+0x2ba/0x381

 but task is already holding lock:
  (ir_raw_handler_lock){+.+.+.}, at: [<ffffffff813186ed>] ir_raw_event_register+0x102/0x190

 which lock already depends on the new lock.

[cut text]

 other info that might help us debug this:

 Chain exists of:
   input_mutex --> &dev->lock --> ir_raw_handler_lock

  Possible unsafe locking scenario:

        CPU0                    CPU1
        ----                    ----
   lock(ir_raw_handler_lock);
                                lock(&dev->lock);
                                lock(ir_raw_handler_lock);
   lock(input_mutex);

  *** DEADLOCK ***

 4 locks held by modprobe/647:
  #0:  (&dev->mutex){......}, at: [<ffffffff812d19f3>] device_lock+0xf/0x11
  #1:  (&dev->mutex){......}, at: [<ffffffff812d19f3>] device_lock+0xf/0x11
  #2:  (&dev->lock){+.+.+.}, at: [<ffffffff81317fff>] rc_register_device+0x55d/0x58a
  #3:  (ir_raw_handler_lock){+.+.+.}, at: [<ffffffff813186ed>] ir_raw_event_register+0x102/0x190

 stack backtrace:
 CPU: 0 PID: 647 Comm: modprobe Not tainted 3.17.0-rc7+ #24

 Call Trace:
  [<ffffffff81489d6a>] dump_stack+0x46/0x58
  [<ffffffff81487699>] print_circular_bug+0x1f8/0x209
  [<ffffffff81074353>] __lock_acquire+0xb54/0xeda
  [<ffffffff81080f17>] ? console_unlock+0x34d/0x399
  [<ffffffff81074c01>] lock_acquire+0xd9/0x111
  [<ffffffff812ed81c>] ? input_register_device+0x2ba/0x381
  [<ffffffff8148e650>] mutex_lock_interruptible_nested+0x57/0x381
  [<ffffffff812ed81c>] ? input_register_device+0x2ba/0x381
  [<ffffffff81124e03>] ? kfree+0x7c/0x96
  [<ffffffff812ed81c>] ? input_register_device+0x2ba/0x381
  [<ffffffff81072531>] ? trace_hardirqs_on+0xd/0xf
  [<ffffffff812ed81c>] input_register_device+0x2ba/0x381
  [<ffffffff8131a537>] ir_mce_kbd_register+0x109/0x139
  [<ffffffff81318728>] ir_raw_event_register+0x13d/0x190
  [<ffffffff81317e40>] rc_register_device+0x39e/0x58a
  [<ffffffff81072531>] ? trace_hardirqs_on+0xd/0xf
  [<ffffffffa00cf2e3>] nvt_probe+0x5ad/0xd52 [nuvoton_cir]
  [<ffffffffa00ced36>] ? nvt_resume+0x80/0x80 [nuvoton_cir]
  [<ffffffff81296003>] pnp_device_probe+0x8c/0xa9
  [<ffffffff812d1b94>] ? driver_sysfs_add+0x6e/0x93
  [<ffffffff812d203a>] driver_probe_device+0xa1/0x1e3
  [<ffffffff812d217c>] ? driver_probe_device+0x1e3/0x1e3
  [<ffffffff812d21ca>] __driver_attach+0x4e/0x6f
  [<ffffffff812d075b>] bus_for_each_dev+0x5a/0x8c
  [<ffffffff812d1b24>] driver_attach+0x19/0x1b
  [<ffffffff812d1879>] bus_add_driver+0xf1/0x1d6
  [<ffffffff812d2817>] driver_register+0x87/0xbe
  [<ffffffffa0120000>] ? 0xffffffffa0120000
  [<ffffffff81295da4>] pnp_register_driver+0x1c/0x1e
  [<ffffffffa0120010>] nvt_init+0x10/0x1000 [nuvoton_cir]
  [<ffffffff8100030e>] do_one_initcall+0xea/0x18c
  [<ffffffff8111497f>] ? __vunmap+0x9d/0xc7
  [<ffffffff810a3ca1>] load_module+0x1c21/0x1f2c
  [<ffffffff810a0bce>] ? show_initstate+0x44/0x44
  [<ffffffff810a404e>] SyS_init_module+0xa2/0xb1
  [<ffffffff81490ed2>] system_call_fastpath+0x16/0x1b

Signed-off-by: Tomas Melin <tomas.melin@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
ljalves pushed a commit that referenced this issue Nov 11, 2014
This patch wires up the new syscall sys_bpf() on powerpc.

Passes the tests in samples/bpf:

    #0 add+sub+mul OK
    #1 unreachable OK
    #2 unreachable2 OK
    #3 out of range jump OK
    #4 out of range jump2 OK
    #5 test1 ld_imm64 OK
    #6 test2 ld_imm64 OK
    #7 test3 ld_imm64 OK
    #8 test4 ld_imm64 OK
    #9 test5 ld_imm64 OK
    #10 no bpf_exit OK
    #11 loop (back-edge) OK
    #12 loop2 (back-edge) OK
    #13 conditional loop OK
    #14 read uninitialized register OK
    #15 read invalid register OK
    #16 program doesn't init R0 before exit OK
    #17 stack out of bounds OK
    #18 invalid call insn1 OK
    #19 invalid call insn2 OK
    #20 invalid function call OK
    #21 uninitialized stack1 OK
    #22 uninitialized stack2 OK
    #23 check valid spill/fill OK
    #24 check corrupted spill/fill OK
    #25 invalid src register in STX OK
    #26 invalid dst register in STX OK
    #27 invalid dst register in ST OK
    #28 invalid src register in LDX OK
    #29 invalid dst register in LDX OK
    #30 junk insn OK
    #31 junk insn2 OK
    #32 junk insn3 OK
    #33 junk insn4 OK
    #34 junk insn5 OK
    #35 misaligned read from stack OK
    #36 invalid map_fd for function call OK
    #37 don't check return value before access OK
    #38 access memory with incorrect alignment OK
    #39 sometimes access memory with incorrect alignment OK
    #40 jump test 1 OK
    #41 jump test 2 OK
    #42 jump test 3 OK
    #43 jump test 4 OK

Signed-off-by: Pranith Kumar <bobby.prani@gmail.com>
[mpe: test using samples/bpf]
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
ljalves pushed a commit that referenced this issue Nov 11, 2014
Fixes this warning:

[  956.730136] ------------[ cut here ]------------
[  956.730143] WARNING: CPU: 1 PID: 10134 at lib/dma-debug.c:963 dma_debug_device_change+0x191/0x1f0()
[  956.730146] pci 0000:07:05.0: DMA-API: device driver has pending DMA allocations while released from device [count=8]
One of leaked entries details: [device address=0x00000000d3d57000] [size=512 bytes] [mapped with DMA_BIDIRECTIONAL] [mapped as coherent]
[  956.730147] Modules linked in: solo6x10(-) videobuf2_dma_contig videobuf2_dma_sg videobuf2_memops videobuf2_core ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_nat_ipv4 nf_nat videobuf_vmalloc videobuf_core v4l2_common videodev rt2800usb rt2800lib rt2x00usb rt2x00lib mac80211 cfg80211 crc_ccitt usbkbd hid_a4tech hid_generic usbhid snd_hda_codec_hdmi snd_hda_codec_via snd_hda_codec_generic snd_hda_intel snd_hda_controller snd_hda_codec snd_hwdep snd_pcm x86_pkg_temp_thermal snd_timer snd soundcore
[  956.730172] CPU: 1 PID: 10134 Comm: rmmod Not tainted 3.18.0-rc1-next-20141023-zver-dirty #24
[  956.730173] Hardware name: System manufacturer System Product Name/P8H77-V, BIOS 0501 02/28/2012
[  956.730175]  0000000000000009 ffff8801df9e3c58 ffffffff817ffe6b 0000000000000001
[  956.730177]  ffff8801df9e3ca8 ffff8801df9e3c98 ffffffff81091ec7 0000000000000046
[  956.730180]  ffff880215457e90 0000000000000008 ffffffff81cbb10f ffff880215570098
[  956.730183] Call Trace:
[  956.730188]  [<ffffffff817ffe6b>] dump_stack+0x4f/0x7c
[  956.730192]  [<ffffffff81091ec7>] warn_slowpath_common+0x87/0xb0
[  956.730194]  [<ffffffff81091f91>] warn_slowpath_fmt+0x41/0x50
[  956.730197]  [<ffffffff81412558>] ? dma_debug_device_change+0xb8/0x1f0
[  956.730199]  [<ffffffff81412631>] dma_debug_device_change+0x191/0x1f0
[  956.730203]  [<ffffffff810b14ad>] notifier_call_chain+0x4d/0x70
[  956.730205]  [<ffffffff810b15f9>] __blocking_notifier_call_chain+0x59/0x80
[  956.730207]  [<ffffffff810b1631>] blocking_notifier_call_chain+0x11/0x20
[  956.730211]  [<ffffffff815873af>] __device_release_driver+0xcf/0xf0
[  956.730213]  [<ffffffff81587ee8>] driver_detach+0xc8/0xd0
[  956.730215]  [<ffffffff81587147>] bus_remove_driver+0x57/0xd0
[  956.730218]  [<ffffffff815887e9>] driver_unregister+0x29/0x60
[  956.730221]  [<ffffffff81420131>] pci_unregister_driver+0x21/0x90
[  956.730225]  [<ffffffffa03219d7>] solo_pci_driver_exit+0x10/0x12 [solo6x10]
[  956.730228]  [<ffffffff81112ee0>] SyS_delete_module+0x170/0x1f0
[  956.730232]  [<ffffffff813eb76e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[  956.730234]  [<ffffffff8180abd2>] system_call_fastpath+0x12/0x17
[  956.730235] ---[ end trace e730af02713a6c53 ]---
[  956.730237] Mapped at:
[  956.730238]  [<ffffffff8141186c>] debug_dma_alloc_coherent+0x3c/0xb0
[  956.730240]  [<ffffffffa03203f6>] solo_enc_v4l2_init+0x706/0xba0 [solo6x10]
[  956.730243]  [<ffffffffa03165b3>] solo_pci_probe+0x503/0x700 [solo6x10]
[  956.730245]  [<ffffffff81420459>] local_pci_probe+0x49/0xa0
[  956.730248]  [<ffffffff814207a1>] pci_device_probe+0xd1/0x120

Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
@ljalves
Copy link
Owner

ljalves commented Nov 15, 2014

Some fixes were applied to the saa716x driver.
Please re-test and report back the result.

@ljalves
Copy link
Owner

ljalves commented Jan 15, 2015

@aminto
Is this still an issue for you? Have you tried the latest tree?

@aminto
Copy link
Author

aminto commented Jan 15, 2015

I have not had chance yet to try it again (and TBS card still sitting in some dark place gathering dust). I hope I get chance to try it again some day. I will report my findings when I do. I noticed your comment from November so maybe I'll try to hurry things a bit.

@aminto
Copy link
Author

aminto commented Feb 7, 2015

@ljalves
Hi. I today have tried TBS card with open source driver again.

No more oops, but TBS for some reason fails to attach frontend now. Both saa716x_ff and saa716x_budget are loaded with int_type=1

[ 110.840503] SAA716x Budget 0000:03:00.0: irq 35 for MSI/MSI-X
[ 110.848011] DVB: registering new adapter (SAA716x dvb adapter)
[ 111.451793] SAA716x Budget 0000:03:00.0: TurboSight TBS 6284 frontend 0 tuner attach failed
[ 111.451799] SAA716x Budget 0000:03:00.0: TurboSight TBS 6284 frontend 0 attach failed
[ 111.451874] DVB: registering new adapter (SAA716x dvb adapter)
[ 111.454352] SAA716x Budget 0000:03:00.0: TurboSight TBS 6284 frontend 1 tuner attach failed
[ 111.454355] SAA716x Budget 0000:03:00.0: TurboSight TBS 6284 frontend 1 attach failed
[ 111.454391] DVB: registering new adapter (SAA716x dvb adapter)
[ 112.059020] SAA716x Budget 0000:03:00.0: TurboSight TBS 6284 frontend 2 tuner attach failed
[ 112.059025] SAA716x Budget 0000:03:00.0: TurboSight TBS 6284 frontend 2 attach failed
[ 112.059094] DVB: registering new adapter (SAA716x dvb adapter)
[ 112.061480] SAA716x Budget 0000:03:00.0: TurboSight TBS 6284 frontend 3 tuner attach failed
[ 112.061487] SAA716x Budget 0000:03:00.0: TurboSight TBS 6284 frontend 3 attach failed

TT S2-6400 is working, and it is loaded after budget. I will later try without TT card to check if TBS is working.

Is there a way to get more info from the driver, to get more info what's going on? I see some dprintk() calls in source which could lead to some more info, but I have no idea how to activate them?

@aminto
Copy link
Author

aminto commented Feb 7, 2015

Please ignore last message.
Problem was that saa716x_budged tried to load TDA18212, which I needed to disable as my kernel did not have regmap -support and it failed to compile.

I compiled new kernel with regmap and compiled driver with tda18212.

Now both cards are loaded and detected. I will do some testing later to check if everything is working.

@aminto
Copy link
Author

aminto commented Feb 7, 2015

So, the two cards now can co-exist. But I cannot tune with TBS, no signal and no tuning to any frequency. I don't even know any good command-line utilities for tuning, dvbtune is so so so obsolete and supports only 4 tuners, and I couldn't even tune my previous tuners with it, which are working fine with VDR. I Did not try without S2-6400 as it's important for my system to run.

Could anyone recommend any simple command-line utility to test tuning the card?

So where to go from here?

@ljalves
Copy link
Owner

ljalves commented May 2, 2015

@aminto, You could try tvheadend.
The web interface setup makes things really easy.

@ljalves ljalves removed the bug label May 2, 2015
@ljalves
Copy link
Owner

ljalves commented Jun 24, 2016

Closing old issue.
Re-open if needed.

@ljalves ljalves closed this as completed Jun 24, 2016
crazycat69 pushed a commit to crazycat69/linux_media that referenced this issue Jul 1, 2023
The cited commit adds a compeletion to remove dependency on rtnl
lock. But it causes a deadlock for multiple encapsulations:

 crash> bt ffff8aece8a64000
 PID: 1514557  TASK: ffff8aece8a64000  CPU: 3    COMMAND: "tc"
  #0 [ffffa6d14183f368] __schedule at ffffffffb8ba7f45
  ljalves#1 [ffffa6d14183f3f8] schedule at ffffffffb8ba8418
  ljalves#2 [ffffa6d14183f418] schedule_preempt_disabled at ffffffffb8ba8898
  ljalves#3 [ffffa6d14183f428] __mutex_lock at ffffffffb8baa7f8
  ljalves#4 [ffffa6d14183f4d0] mutex_lock_nested at ffffffffb8baabeb
  ljalves#5 [ffffa6d14183f4e0] mlx5e_attach_encap at ffffffffc0f48c17 [mlx5_core]
  ljalves#6 [ffffa6d14183f628] mlx5e_tc_add_fdb_flow at ffffffffc0f39680 [mlx5_core]
  ljalves#7 [ffffa6d14183f688] __mlx5e_add_fdb_flow at ffffffffc0f3b636 [mlx5_core]
  ljalves#8 [ffffa6d14183f6f0] mlx5e_tc_add_flow at ffffffffc0f3bcdf [mlx5_core]
  ljalves#9 [ffffa6d14183f728] mlx5e_configure_flower at ffffffffc0f3c1d1 [mlx5_core]
 ljalves#10 [ffffa6d14183f790] mlx5e_rep_setup_tc_cls_flower at ffffffffc0f3d529 [mlx5_core]
 ljalves#11 [ffffa6d14183f7a0] mlx5e_rep_setup_tc_cb at ffffffffc0f3d714 [mlx5_core]
 ljalves#12 [ffffa6d14183f7b0] tc_setup_cb_add at ffffffffb8931bb8
 ljalves#13 [ffffa6d14183f810] fl_hw_replace_filter at ffffffffc0dae901 [cls_flower]
 ljalves#14 [ffffa6d14183f8d8] fl_change at ffffffffc0db5c57 [cls_flower]
 ljalves#15 [ffffa6d14183f970] tc_new_tfilter at ffffffffb8936047
 ljalves#16 [ffffa6d14183fac8] rtnetlink_rcv_msg at ffffffffb88c7c31
 ljalves#17 [ffffa6d14183fb50] netlink_rcv_skb at ffffffffb8942853
 ljalves#18 [ffffa6d14183fbc0] rtnetlink_rcv at ffffffffb88c1835
 ljalves#19 [ffffa6d14183fbd0] netlink_unicast at ffffffffb8941f27
 ljalves#20 [ffffa6d14183fc18] netlink_sendmsg at ffffffffb8942245
 ljalves#21 [ffffa6d14183fc98] sock_sendmsg at ffffffffb887d482
 ljalves#22 [ffffa6d14183fcb8] ____sys_sendmsg at ffffffffb887d81a
 ljalves#23 [ffffa6d14183fd38] ___sys_sendmsg at ffffffffb88806e2
 ljalves#24 [ffffa6d14183fe90] __sys_sendmsg at ffffffffb88807a2
 ljalves#25 [ffffa6d14183ff28] __x64_sys_sendmsg at ffffffffb888080f
 ljalves#26 [ffffa6d14183ff38] do_syscall_64 at ffffffffb8b9b6a8
 ljalves#27 [ffffa6d14183ff50] entry_SYSCALL_64_after_hwframe at ffffffffb8c0007c
 crash> bt 0xffff8aeb07544000
 PID: 1110766  TASK: ffff8aeb07544000  CPU: 0    COMMAND: "kworker/u20:9"
  #0 [ffffa6d14e6b7bd8] __schedule at ffffffffb8ba7f45
  ljalves#1 [ffffa6d14e6b7c68] schedule at ffffffffb8ba8418
  ljalves#2 [ffffa6d14e6b7c88] schedule_timeout at ffffffffb8baef88
  ljalves#3 [ffffa6d14e6b7d10] wait_for_completion at ffffffffb8ba968b
  ljalves#4 [ffffa6d14e6b7d60] mlx5e_take_all_encap_flows at ffffffffc0f47ec4 [mlx5_core]
  ljalves#5 [ffffa6d14e6b7da0] mlx5e_rep_update_flows at ffffffffc0f3e734 [mlx5_core]
  ljalves#6 [ffffa6d14e6b7df8] mlx5e_rep_neigh_update at ffffffffc0f400bb [mlx5_core]
  ljalves#7 [ffffa6d14e6b7e50] process_one_work at ffffffffb80acc9c
  ljalves#8 [ffffa6d14e6b7ed0] worker_thread at ffffffffb80ad012
  ljalves#9 [ffffa6d14e6b7f10] kthread at ffffffffb80b615d
 ljalves#10 [ffffa6d14e6b7f50] ret_from_fork at ffffffffb8001b2f

After the first encap is attached, flow will be added to encap
entry's flows list. If neigh update is running at this time, the
following encaps of the flow can't hold the encap_tbl_lock and
sleep. If neigh update thread is waiting for that flow's init_done,
deadlock happens.

Fix it by holding lock outside of the for loop. If neigh update is
running, prevent encap flows from offloading. Since the lock is held
outside of the for loop, concurrent creation of encap entries is not
allowed. So remove unnecessary wait_for_completion call for res_ready.

Fixes: 95435ad ("net/mlx5e: Only access fully initialized flows in neigh update")
Signed-off-by: Chris Mi <cmi@nvidia.com>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Reviewed-by: Vlad Buslov <vladbu@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants