bas-t / dvbloopback

Loopback in-tree kernel driver for DVB devices
GNU General Public License v3.0
6 stars 9 forks source link

dvbloopback crashing on Intel Kaby Lake #12

Closed dimerr closed 7 years ago

dimerr commented 7 years ago

Ubuntu 16.04.2 x86_64 running on

                       system         Computer
/0                     bus            Motherboard
/0/0                   memory         7856MiB System memory
/0/1                   processor      Intel(R) Pentium(R) CPU G4560 @ 3.50GHz
/0/100                 bridge         Intel Corporation
/0/100/2               display        Intel Corporation
/0/100/14              bus            Sunrise Point-H USB 3.0 xHCI Controller
/0/100/16              communication  Sunrise Point-H CSME HECI #1
/0/100/17              storage        Sunrise Point-H SATA controller [AHCI mode]
/0/100/1c              bridge         Sunrise Point-H PCI Express Root Port #5
/0/100/1c.7            bridge         Sunrise Point-H PCI Express Root Port #8
/0/100/1c.7/0  enp2s0  network        RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
/0/100/1d              bridge         Sunrise Point-H PCI Express Root Port #9
/0/100/1f              bridge         Sunrise Point-H LPC Controller
/0/100/1f.2            memory         Memory controller
/0/100/1f.3            multimedia     Sunrise Point-H HD Audio
/0/100/1f.4            bus            Sunrise Point-H SMBus

After upgrading platform to Intel Kaby Lake, dvbloopback keeps crashing.

Steps to reproduce:

  1. Freshly installed Ubuntu 16.04.2
  2. Built dvbloopback by running ./configure, which rebuilds kernel with dvbloopback in tree
  3. modprobe dvbloopback && ffdecsawrapper --join 0:1
  4. Open VLC or Kaffeine or TVHeadend and specify adapter as /dev/dvb/adapter1

I'm actually using TBS5922SE dvb card, but for a test I've connected Geniatech Mygica T230 and there is exactly the same issue with it.

[  373.339759] dvbloopback: registering 1 adapters
[  373.339833] DVB: registering new adapter (DVB-LOOPBACK)
[  395.815985] BUG: unable to handle kernel paging request at 00007f8279b39720
[  395.816014] IP: [<ffffffffc0d10330>] dvblb_ioctl+0x510/0x6d0 [dvbloopback]
[  395.816042] PGD 20e83b067 PUD 2058d0067 PMD 1fb25c067 PTE 8000000217b99867
[  395.816069] Oops: 0001 [#1] SMP
[  395.816084] Modules linked in: dvbloopback(OE) bnep pci_stub vboxpci(OE) vboxnetadp(OE) vboxnetflt(OE) vboxdrv(OE) xt_CHECKSUM iptable_mangle ipt_MASQUERADE nf_nat_masquerade_ipv4 iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack xt_tcpudp iptable_filter ip_tables x_tables bridge stp llc tbsfe(OE) tbs5922se(POE) ir_lirc_codec(OE) lirc_dev(OE) ir_mce_kbd_decoder(OE) ir_sony_decoder(OE) ir_jvc_decoder(OE) ir_rc6_decoder(OE) ir_rc5_decoder(OE) dvb_usb_tbs5923(OE) dvb_usb(OE) dvb_core(OE) ir_nec_decoder(OE) rc_core(OE) eeepc_wmi asus_wmi mxm_wmi sparse_keymap intel_rapl x86_pkg_temp_thermal intel_powerclamp snd_hda_codec_hdmi snd_hda_codec_realtek kvm snd_hda_codec_generic input_leds irqbypass joydev crct10dif_pclmul crc32_pclmul ghash_clmulni_intel snd_hda_intel snd_hda_codec
[  395.816345]  aesni_intel snd_hda_core snd_hwdep snd_pcm snd_seq_midi aes_x86_64 snd_seq_midi_event snd_rawmidi lrw glue_helper ablk_helper snd_seq cryptd snd_seq_device hci_uart acpi_als snd_timer btbcm serio_raw btqca snd btintel kfifo_buf soundcore industrialio intel_lpss_acpi bluetooth mei_me intel_lpss wmi shpchp mei mac_hid acpi_pad nfsd nct6775 hwmon_vid auth_rpcgss nfs_acl lockd coretemp grace sunrpc parport_pc ppdev lp parport autofs4 raid10 raid456 async_raid6_recov async_memcpy async_pq async_xor async_tx xor raid6_pq libcrc32c raid0 multipath linear raid1 i915 i2c_algo_bit hid_generic drm_kms_helper r8169 ahci syscopyarea sysfillrect mii sysimgblt fb_sys_fops libahci psmouse usbhid i2c_hid drm pinctrl_sunrisepoint video pinctrl_intel hid fjes
[  395.816623] CPU: 2 PID: 7128 Comm: vlc Tainted: P         C OE   4.8.0-39-generic #42~16.04.1-Ubuntu
[  395.816648] Hardware name: System manufacturer System Product Name/H110M-R, BIOS 3016 12/27/2016
[  395.816673] task: ffff9c0501d5e3c0 task.stack: ffff9c0524654000
[  395.816690] RIP: 0010:[<ffffffffc0d10330>]  [<ffffffffc0d10330>] dvblb_ioctl+0x510/0x6d0 [dvbloopback]
[  395.816720] RSP: 0018:ffff9c0524657aa0  EFLAGS: 00010246
[  395.816736] RAX: 0000000000000000 RBX: 00007f8279b39720 RCX: 0000000000000000
[  395.816756] RDX: fffffffffffffff2 RSI: 00007f8279b39730 RDI: ffff9c0524657de0
[  395.816776] RBP: ffff9c0524657e80 R08: ffff9c0524658000 R09: 00000000000000c0
[  395.816797] R10: ffff9c052ad7c238 R11: ffff9c05001ede40 R12: ffff9c0524657dd0
[  395.816817] R13: ffff9c052ad7c200 R14: 0000000000000010 R15: 0000000040106f52
[  395.816837] FS:  00007f8279b3a700(0000) GS:ffff9c0536d00000(0000) knlGS:0000000000000000
[  395.816860] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  395.816877] CR2: 00007f8279b39720 CR3: 00000002114b6000 CR4: 00000000003406e0
[  395.816897] Stack:
[  395.816904]  0000000100005e1d ffffffff98cf3e80 0000000101d5e3c0 ffffffffc0d0f450
[  395.816931]  0000000000000000 0000000000000246 0000000000000283 0000000000000283
[  395.816965]  ffff9c0524657b08 ffffffff98cc6fc5 ffff9c04fb2d0090 ffffffff99498b52
[  395.816990] Call Trace:
[  395.817002]  [<ffffffff98cf3e80>] ? del_timer_sync+0x50/0x50
[  395.817019]  [<ffffffffc0d0f450>] ? dvblb_fake_ioctl+0x450/0x450 [dvbloopback]
[  395.817041]  [<ffffffff98cc6fc5>] ? finish_wait+0x55/0x70
[  395.817059]  [<ffffffff99498b52>] ? mutex_lock_interruptible+0x12/0x40
[  395.817078]  [<ffffffffc0d0f277>] ? dvblb_fake_ioctl+0x277/0x450 [dvbloopback]
[  395.817100]  [<ffffffff98cc7470>] ? wake_atomic_t_function+0x60/0x60
[  395.817119]  [<ffffffffc0d0fa6b>] ? dvblb_open+0x2cb/0x3c0 [dvbloopback]
[  395.817141]  [<ffffffffc0ba54b7>] ? dvb_device_open+0xd7/0x110 [dvb_core]
[  395.817161]  [<ffffffff98e37d5f>] ? chrdev_open+0xbf/0x1b0
[  395.817179]  [<ffffffff98e4bfb4>] ? dput+0xc4/0x250
[  395.817194]  [<ffffffff98e55924>] ? mntput+0x24/0x40
[  395.817210]  [<ffffffff98e3d69e>] ? terminate_walk+0x8e/0xf0
[  395.817227]  [<ffffffff98e422a1>] ? path_openat+0x411/0x1440
[  395.817244]  [<ffffffff98e445a5>] ? do_filp_open+0xa5/0x100
[  395.817262]  [<ffffffff98e4bf24>] ? dput+0x34/0x250
[  395.817278]  [<ffffffff98e478c1>] do_vfs_ioctl+0xa1/0x5f0
[  395.817294]  [<ffffffff98e43444>] ? putname+0x54/0x60
[  395.818617]  [<ffffffff98e534e5>] ? set_close_on_exec+0x35/0x70
[  395.819943]  [<ffffffff98e47e89>] SyS_ioctl+0x79/0x90
[  395.821238]  [<ffffffff9949b7f6>] entry_SYSCALL_64_fastpath+0x1e/0xa8
[  395.822536] Code: e8 26 b3 32 d8 48 85 c0 48 c7 c2 f2 ff ff ff 0f 85 5e ff ff ff 41 81 ff 52 6f 10 40 74 0d 41 81 ff 53 6f 10 80 0f 85 5d fe ff ff <8b> 03 be c0 00 40 02 48 8d 14 c0 48 8d 3c 50 48 c1 e7 02 e8 38 
[  395.823975] RIP  [<ffffffffc0d10330>] dvblb_ioctl+0x510/0x6d0 [dvbloopback]
[  395.825328]  RSP <ffff9c0524657aa0>
[  395.826691] CR2: 00007f8279b39720
[  395.834804] ---[ end trace 1aff8204f1e1cacb ]---

I believe this is an issue with the new platform, but I'm out of ideas already how to determine the source. BIOS was updated, different settings were tried, but nothing helps

bas-t commented 7 years ago

Hi dimerr, thanks for your report. I don't know yet what the root case of this stack corruption is. However, a few things spring to mind:

First of all: judging from your report, recompiling the stock kernel went wrong. You are running a 4.8 kernel, should be 4.4 on Ubuntu 16.04

Furthermore, Tvheadend does not need the dvbloopback module. Even worse, any recent version of Tvheadend is absolutely incompatible with dvbloopback/ffdecsawrapper. Combining those is asking for trouble. Don't know about VLC or Kaffeine though. I only use this for Mythtv, not testing any other combinations. Well, a couple of years ago I was testing with Tvheadend too, just for fun. Untill it didn't match anymore that is...

It seems to me like a shot in the dark, but maybe you could try compiling a vanilla kernel. My advice would be:

./configure --vanilla=4.9.13 --drivers=no

Use the supplied kernel config when asked.

Please (re)compile ffdecsawrapper during the process, it's log just might shine some light on wether the platform update is to blame in any way or not.

Then reboot with this kernel and see what happens, but DON'T test with Tvheadend!

Best of luck! Tycho.

dimerr commented 7 years ago

Hi, thanks for your reply,

the reason it has built 4.8 is due to a recent 16.04.2 release, which brought linux-generic-hwe-16.04 package. In any case, I have tried this on kernel 4.2, then 4.4 in 16.04, then 4.8 in 16.04.2.

Also, I am actually using mythtv, but in order to bring my htpc back, i've had to put old mainboard there. So I took new mobo and spare hdd, installed 16.04.2 there and trying with vlc and tvheadend and kaffeine. Exactly the same issue was with mythtv...

If im just replacing mainboard to old one, everything starts to work, without recompiling anything even.

To be clear, I've ran CPU burn-in tests, RAM tests, no problems, everything runs perfect except dvbloopback

Meanwhile, I'm building 4.9.13, as you've suggested.

bas-t commented 7 years ago

I don't understand what you are saying. How can you setup a htpc, using mythtv with encrypted channels, without recompiling the kernel with dvbloopback? (or compiling the dvbloopback module out of tree)

dimerr commented 7 years ago

I've had old AMD+nVidia platform running mythv+ffdecsawrapper+dvbloppback out of tree. Then, I've bought new mainboard+cpu, replaced -- dvblopback is crashing. After series of tests, 've discovered that dvbloopback is crashing nomatter what app is using it, so I've put old mainboard back, and started to test new mainboard with clean install on another HDD.

without recompiling anything even.

means i did not recompile dvbloopback or ffdescawrapper after switching platforms back

Cant try 4.9.13, cause something is broken in it,and dvb-t2 doesnt work on it (confirmed regression)

bas-t commented 7 years ago

Sounds to me like you have a driver issue, I have seen more of them. In all of those cases it was the dvb driver that caused dvbloopback crashes. Sadly I don't remember wether your dvb driver was one of those, but I'll have a look one of these days.

dimerr commented 7 years ago

I have both , DVB-S2 TBS5922SE and DVB-T2 Geniatech T230, both using completely different drivers, both are resulting in segfault

bas-t commented 7 years ago

Hmm, I'll setup a Ubuntu 16.04 server this week. Just so I can verify if I suffer from dvbloopback crashes too. Currently, I'm running both Debian stable and Debian testing, no troubles there...

dimerr commented 7 years ago

Unless you have some recent Intel hardware and (i think) USB DVB card, you wont have that crash... Cause i simply change mainboard+cpu and keep same system installed, and there is no crash anymore. So I'm thinking about some extensive kernel debugging, but not quite sure how, maybe starting from dvblb_ioctl function in dvbloopback... Need your suggestions for that matter

bas-t commented 7 years ago

Did you try building out of tree? There are some small differences in the resulting dvbloopback module. I just compile tested using the ffdecsawrapper repo on Ubuntu 16.04.2 with the 4.8 hwe kernel+headers. Works fine. Unless of course the confirmed regression you mentioned was introduced prior to 4.9.x

dimerr commented 7 years ago

Yes, i did. All those years before, i was always building out of tree, now im just trying all the possible options to get rid of that crash...

bas-t commented 7 years ago

So you're saying that both in-tree and out-of-tree gives you the crashes? And that the 4.8 kernel is not affected with the regression?

bas-t commented 7 years ago

What kernel version worked on your old hardware?

dimerr commented 7 years ago

Any kernel version is working on old hardware. 4.2,4.4, 4.8 (works atm on an old mobo)

As for 4.9 kernel, regression is only connected with DVB-T2 card, which I'm currently using for tests

bas-t commented 7 years ago

Are you willing to test with Debian Jessie?

dimerr commented 7 years ago

Sure, I would test anything, if that helps. Installing, as we speak

bas-t commented 7 years ago

OK, when you are done, do:

mv /etc/apt/sources.list /etc/apt/sources.list.old

echo "deb http://ftp.nl.debian.org/debian/ jessie main contrib non-free deb-src http://ftp.nl.debian.org/debian/ jessie main contrib non-free

deb http://security.debian.org/ jessie/updates main contrib non-free deb-src http://security.debian.org/ jessie/updates main contrib non-free

deb http://ftp.nl.debian.org/debian/ jessie-updates main contrib non-free deb-src http://ftp.nl.debian.org/debian/ jessie-updates main contrib non-free

deb http://ftp.nl.debian.org/debian/ jessie-backports main contrib non-free

deb-src http://ftp.nl.debian.org/debian/ jessie-backports main contrib non-free

deb http://www.deb-multimedia.org jessie main non-free deb-src http://www.deb-multimedia.org jessie main non-free

" > /etc/apt/sources.list

Well, replace the 'nl' part with some countrycode near your residence.

Then:

apt-get update && apt-get --yes --quiet --allow-unauthenticated install deb-multimedia-keyring && apt-get update && apt-get dist-upgrade -y

apt-get install git-core -y

git clone https://github.com/bas-t/dvbloopback.git && cd dvbloopback

./configure --vanilla=4.4.52 --headers=yes --drivers=no

When prompted for, accept using the supplied kernel config.

Reboot with your new kernel and see what happens.

This method will enable you to test with out-of-tree dvbloopback too, should it still give you those crashes.

Best of luck!

bas-t commented 7 years ago

In the meantime, you use your TBS tuner box in production systems, right? (without the Geniatech one) What drivers do you use? The one from Luis Alves, the official TBS linux drivers or what?

dimerr commented 7 years ago

I'm using official TBS drivers and your tbs-dvbloopback repo, that fetches and builds them out of tree

bas-t commented 7 years ago

But it disables your Geniatech device of course. And you're testing with that device right now, so please proceed with what I posted.

bas-t commented 7 years ago

This reminded me to port a patch that is supposed to address this and/or similar stack corruption to my tbs-dvbloopback repo. Might just be your hit the jackpot doodledidee gamechanger. Well, I hope it is...

https://github.com/bas-t/tbs-dvbloopback/commit/12f2a3c72bee7e0e2113994708550edaf4346d0b

dimerr commented 7 years ago

Same thing on Debian, crashes...

bas-t commented 7 years ago

I've got 2 options left, have to run some tests first. I'll get back to you.

dimerr commented 7 years ago

Tested on similar AMD board - no problems. Then on i5-3470+C210 chipset - also no problems... This is a disaster...

bas-t commented 7 years ago

Yeah, support for your Kaby Lake is not yet mature, but I'm not ready to give up yet. Still running tests that hopefully will address the issue(s)

bas-t commented 7 years ago

As for the support in Windows, it seems tu run well on Windows 10, but not on previous versions, so I don't have very high hopes for Linux. The highest compatible kernel (with official TBS drivers that is) is 4.9.13. So as a last resort you can try that in your Debian Jessie installation. To do so, please go into your dvbloopback clone and run ./configure --vanilla=4.9.13 --headers=yes --drivers=no

Accept the supplied kernel config when prompted.

Having done that, reboot with your new kernel and clone tbs-dvbloopback, it has some changes that may or may not save your ass. I guess running just ./configure without any flags will do the job. Now hope and pray and keep your fingers crossed, as I don't have any alternatives. Just to make sure: this is ment to test with your TBS tuner box, not the other one.

dimerr commented 7 years ago

and I've seen this once during my tests, prolly with that kernel also...

[  962.930267] usb 1-7: new high-speed USB device number 5 using xhci_hcd
[  963.070389] usb 1-7: New USB device found, idVendor=734c, idProduct=5923
[  963.070393] usb 1-7: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[  963.070734] dvb-usb: found a 'TBS 5922SE DVBS2 USB2.0' in cold state, will try to load a firmware
[  963.070792] dvb-usb: downloading firmware from file 'dvb-usb-tbsqbox-id5923.fw'
[  963.070794] tbs5922se: start downloading TBS5922SE firmware
[  963.070799] ------------[ cut here ]------------
[  963.070831] WARNING: CPU: 0 PID: 105 at drivers/usb/core/hcd.c:1584 usb_hcd_map_urb_for_dma+0x39a/0x560 [usbcore]
[  963.070832] transfer buffer not dma capable
[  963.070834] Modules linked in: ir_lirc_codec(OE) lirc_dev(OE) ir_mce_kbd_decoder(OE) ir_sony_decoder(OE) ir_jvc_decoder(OE) ir_rc6_decoder(OE) ir_rc5_decoder(OE) dvb_usb_tbs5923(OE) ir_nec_decoder(OE) dvb_usb(OE) dvb_core(OE) rc_core(OE) cpufreq_powersave(E) cpufreq_conservative(E) cpufreq_userspace(E) cfg80211(E) nfsd(E) auth_rpcgss(E) nfs_acl(E) nfs(E) lockd(E) grace(E) fscache(E) sunrpc(E) snd_hda_codec_hdmi(E) snd_hda_codec_realtek(E) snd_hda_codec_generic(E) joydev(E) i915(E) iTCO_wdt(E) iTCO_vendor_support(E) intel_rapl(E) x86_pkg_temp_thermal(E) intel_powerclamp(E) coretemp(E) kvm_intel(E) kvm(E) irqbypass(E) crct10dif_pclmul(E) crc32_pclmul(E) ghash_clmulni_intel(E) aesni_intel(E) aes_x86_64(E) lrw(E) gf128mul(E) glue_helper(E) ablk_helper(E) hci_uart(E) cryptd(E) ppdev(E) btbcm(E) btqca(E)
[  963.070891]  eeepc_wmi(E) btintel(E) asus_wmi(E) mxm_wmi(E) sparse_keymap(E) bluetooth(E) evdev(E) drm_kms_helper(E) drm(E) i2c_i801(E) serio_raw(E) pcspkr(E) parport_pc(E) snd_hda_intel(E) wmi(E) rfkill(E) parport(E) i2c_smbus(E) snd_hda_codec(E) video(E) battery(E) snd_hda_core(E) intel_lpss_acpi(E) intel_lpss(E) mfd_core(E) i2c_algo_bit(E) mei_me(E) acpi_pad(E) tpm_tis(E) tpm_tis_core(E) button(E) acpi_als(E) kfifo_buf(E) tpm(E) snd_hwdep(E) snd_pcm(E) snd_timer(E) snd(E) soundcore(E) mei(E) industrialio(E) shpchp(E) fuse(E) autofs4(E) ext4(E) crc16(E) jbd2(E) fscrypto(E) mbcache(E) hid_generic(E) usbhid(E) sg(E) sd_mod(E) crc32c_intel(E) psmouse(E) ahci(E) libahci(E) libata(E) scsi_mod(E) xhci_pci(E) xhci_hcd(E) r8169(E) mii(E) usbcore(E) fan(E) thermal(E) i2c_hid(E) hid(E) fjes(E)
[  963.070966] CPU: 0 PID: 105 Comm: kworker/0:2 Tainted: G           OE   4.9.13 #1
[  963.070968] Hardware name: System manufacturer System Product Name/H110M-R, BIOS 3016 12/27/2016
[  963.070986] Workqueue: usb_hub_wq hub_event [usbcore]
[  963.070990]  0000000000000000 ffffffff9152a185 ffffb151010d7670 0000000000000000
[  963.070996]  ffffffff91277804 ffff9338715f0480 ffffb151010d76c8 0000000000000000
[  963.071001]  ffffb151010d7874 00000000000007d0 0000000000000001 ffffffff9127787f
[  963.071007] Call Trace:
[  963.071018]  [<ffffffff9152a185>] ? dump_stack+0x5c/0x77
[  963.071027]  [<ffffffff91277804>] ? __warn+0xc4/0xe0
[  963.071033]  [<ffffffff9127787f>] ? warn_slowpath_fmt+0x5f/0x80
[  963.071050]  [<ffffffffc00f91fa>] ? usb_hcd_map_urb_for_dma+0x39a/0x560 [usbcore]
[  963.071056]  [<ffffffff91386e10>] ? get_page_from_freelist+0x350/0xad0
[  963.071072]  [<ffffffffc00f95a0>] ? usb_hcd_submit_urb+0x1e0/0xa50 [usbcore]
[  963.071077]  [<ffffffff91388587>] ? __alloc_pages_nodemask+0xf7/0x270
[  963.071094]  [<ffffffffc00fb78d>] ? usb_start_wait_urb+0x6d/0x170 [usbcore]
[  963.071109]  [<ffffffffc00fb96c>] ? usb_control_msg+0xdc/0x130 [usbcore]
[  963.071116]  [<ffffffffc0966117>] ? tbs5922se_op_rw.constprop.4+0xd7/0x120 [dvb_usb_tbs5923]
[  963.071120]  [<ffffffffc09661ee>] ? tbs5922se_load_firmware+0x8e/0x1f0 [dvb_usb_tbs5923]
[  963.071127]  [<ffffffffc0a82388>] ? dvb_usb_download_firmware+0x88/0xd0 [dvb_usb]
[  963.071132]  [<ffffffffc0a829f6>] ? dvb_usb_device_init+0x486/0x720 [dvb_usb]
[  963.071137]  [<ffffffffc0966031>] ? tbs5922se_probe+0x21/0x30 [dvb_usb_tbs5923]
[  963.071153]  [<ffffffffc00ffe42>] ? usb_probe_interface+0x152/0x300 [usbcore]
[  963.071163]  [<ffffffff9166deae>] ? driver_probe_device+0x21e/0x430
[  963.071168]  [<ffffffff9166e1d0>] ? driver_allows_async_probing+0x30/0x30
[  963.071173]  [<ffffffff9166bbe2>] ? bus_for_each_drv+0x62/0xb0
[  963.071179]  [<ffffffff9166db59>] ? __device_attach+0xd9/0x160
[  963.071185]  [<ffffffff9166cf77>] ? bus_probe_device+0x87/0xa0
[  963.071189]  [<ffffffff9166ad48>] ? device_add+0x478/0x640
[  963.071207]  [<ffffffffc00fded9>] ? usb_set_configuration+0x549/0x8d0 [usbcore]
[  963.071225]  [<ffffffffc0108e28>] ? generic_probe+0x28/0x80 [usbcore]
[  963.071231]  [<ffffffff9166deae>] ? driver_probe_device+0x21e/0x430
[  963.071237]  [<ffffffff9166e1d0>] ? driver_allows_async_probing+0x30/0x30
[  963.071241]  [<ffffffff9166bbe2>] ? bus_for_each_drv+0x62/0xb0
[  963.071247]  [<ffffffff9166db59>] ? __device_attach+0xd9/0x160
[  963.071252]  [<ffffffff9166cf77>] ? bus_probe_device+0x87/0xa0
[  963.071257]  [<ffffffff9166ad48>] ? device_add+0x478/0x640
[  963.071272]  [<ffffffffc00f3657>] ? usb_new_device+0x267/0x4a0 [usbcore]
[  963.071287]  [<ffffffffc00f578c>] ? hub_event+0xfcc/0x1530 [usbcore]
[  963.071293]  [<ffffffff912916bb>] ? process_one_work+0x14b/0x410
[  963.071297]  [<ffffffff91292175>] ? worker_thread+0x65/0x4a0
[  963.071300]  [<ffffffff91292110>] ? rescuer_thread+0x340/0x340
[  963.071304]  [<ffffffff91292110>] ? rescuer_thread+0x340/0x340
[  963.071309]  [<ffffffff91297470>] ? kthread+0xe0/0x100
[  963.071316]  [<ffffffff9122476b>] ? __switch_to+0x2bb/0x700
[  963.071321]  [<ffffffff91297390>] ? kthread_park+0x60/0x60
[  963.071328]  [<ffffffff917fa8b5>] ? ret_from_fork+0x25/0x30
[  963.071331] ---[ end trace 01324789c1b92aa5 ]---
[  963.071338] tbs5922se: error while transferring firmware
[  963.071394] tbs5922se: could not restart the USB controller CPU.
[  963.071448] tbs5922se: could not restart the USB controller CPU.
bas-t commented 7 years ago

Ok, that's a clue. Will look into that shortly. Probably next week.

Op 8 mrt. 2017 18:06 schreef "Dmitry Ermakov" notifications@github.com:

and I've seen this once during my tests, prolly with that kernel also...

[ 962.930267] usb 1-7: new high-speed USB device number 5 using xhci_hcd [ 963.070389] usb 1-7: New USB device found, idVendor=734c, idProduct=5923 [ 963.070393] usb 1-7: New USB device strings: Mfr=0, Product=0, SerialNumber=0 [ 963.070734] dvb-usb: found a 'TBS 5922SE DVBS2 USB2.0' in cold state, will try to load a firmware [ 963.070792] dvb-usb: downloading firmware from file 'dvb-usb-tbsqbox-id5923.fw' [ 963.070794] tbs5922se: start downloading TBS5922SE firmware [ 963.070799] ------------[ cut here ]------------ [ 963.070831] WARNING: CPU: 0 PID: 105 at drivers/usb/core/hcd.c:1584 usb_hcd_map_urb_for_dma+0x39a/0x560 [usbcore] [ 963.070832] transfer buffer not dma capable [ 963.070834] Modules linked in: ir_lirc_codec(OE) lirc_dev(OE) ir_mce_kbd_decoder(OE) ir_sony_decoder(OE) ir_jvc_decoder(OE) ir_rc6_decoder(OE) ir_rc5_decoder(OE) dvb_usb_tbs5923(OE) ir_nec_decoder(OE) dvb_usb(OE) dvb_core(OE) rc_core(OE) cpufreq_powersave(E) cpufreq_conservative(E) cpufreq_userspace(E) cfg80211(E) nfsd(E) auth_rpcgss(E) nfs_acl(E) nfs(E) lockd(E) grace(E) fscache(E) sunrpc(E) snd_hda_codec_hdmi(E) snd_hda_codec_realtek(E) snd_hda_codec_generic(E) joydev(E) i915(E) iTCO_wdt(E) iTCO_vendor_support(E) intel_rapl(E) x86_pkg_temp_thermal(E) intel_powerclamp(E) coretemp(E) kvm_intel(E) kvm(E) irqbypass(E) crct10dif_pclmul(E) crc32_pclmul(E) ghash_clmulni_intel(E) aesni_intel(E) aes_x86_64(E) lrw(E) gf128mul(E) glue_helper(E) ablk_helper(E) hci_uart(E) cryptd(E) ppdev(E) btbcm(E) btqca(E) [ 963.070891] eeepc_wmi(E) btintel(E) asus_wmi(E) mxm_wmi(E) sparse_keymap(E) bluetooth(E) evdev(E) drm_kms_helper(E) drm(E) i2c_i801(E) serio_raw(E) pcspkr(E) parport_pc(E) snd_hda_intel(E) wmi(E) rfkill(E) parport(E) i2c_smbus(E) snd_hda_codec(E) video(E) battery(E) snd_hda_core(E) intel_lpss_acpi(E) intel_lpss(E) mfd_core(E) i2c_algo_bit(E) mei_me(E) acpi_pad(E) tpm_tis(E) tpm_tis_core(E) button(E) acpi_als(E) kfifo_buf(E) tpm(E) snd_hwdep(E) snd_pcm(E) snd_timer(E) snd(E) soundcore(E) mei(E) industrialio(E) shpchp(E) fuse(E) autofs4(E) ext4(E) crc16(E) jbd2(E) fscrypto(E) mbcache(E) hid_generic(E) usbhid(E) sg(E) sd_mod(E) crc32c_intel(E) psmouse(E) ahci(E) libahci(E) libata(E) scsi_mod(E) xhci_pci(E) xhci_hcd(E) r8169(E) mii(E) usbcore(E) fan(E) thermal(E) i2c_hid(E) hid(E) fjes(E) [ 963.070966] CPU: 0 PID: 105 Comm: kworker/0:2 Tainted: G OE 4.9.13 #1 [ 963.070968] Hardware name: System manufacturer System Product Name/H110M-R, BIOS 3016 12/27/2016 [ 963.070986] Workqueue: usb_hub_wq hub_event [usbcore] [ 963.070990] 0000000000000000 ffffffff9152a185 ffffb151010d7670 0000000000000000 [ 963.070996] ffffffff91277804 ffff9338715f0480 ffffb151010d76c8 0000000000000000 [ 963.071001] ffffb151010d7874 00000000000007d0 0000000000000001 ffffffff9127787f [ 963.071007] Call Trace: [ 963.071018] [] ? dump_stack+0x5c/0x77 [ 963.071027] [] ? warn+0xc4/0xe0 [ 963.071033] [] ? warn_slowpath_fmt+0x5f/0x80 [ 963.071050] [] ? usb_hcd_map_urb_for_dma+0x39a/0x560 [usbcore] [ 963.071056] [] ? get_page_from_freelist+0x350/0xad0 [ 963.071072] [] ? usb_hcd_submit_urb+0x1e0/0xa50 [usbcore] [ 963.071077] [] ? alloc_pages_nodemask+0xf7/0x270 [ 963.071094] [] ? usb_start_wait_urb+0x6d/0x170 [usbcore] [ 963.071109] [] ? usb_control_msg+0xdc/0x130 [usbcore] [ 963.071116] [] ? tbs5922se_op_rw.constprop.4+0xd7/0x120 [dvb_usb_tbs5923] [ 963.071120] [] ? tbs5922se_load_firmware+0x8e/0x1f0 [dvb_usb_tbs5923] [ 963.071127] [] ? dvb_usb_download_firmware+0x88/0xd0 [dvb_usb] [ 963.071132] [] ? dvb_usb_device_init+0x486/0x720 [dvb_usb] [ 963.071137] [] ? tbs5922se_probe+0x21/0x30 [dvb_usb_tbs5923] [ 963.071153] [] ? usb_probe_interface+0x152/0x300 [usbcore] [ 963.071163] [] ? driver_probe_device+0x21e/0x430 [ 963.071168] [] ? driver_allows_async_probing+0x30/0x30 [ 963.071173] [] ? bus_for_each_drv+0x62/0xb0 [ 963.071179] [] ? device_attach+0xd9/0x160 [ 963.071185] [] ? bus_probe_device+0x87/0xa0 [ 963.071189] [] ? device_add+0x478/0x640 [ 963.071207] [] ? usb_set_configuration+0x549/0x8d0 [usbcore] [ 963.071225] [] ? generic_probe+0x28/0x80 [usbcore] [ 963.071231] [] ? driver_probe_device+0x21e/0x430 [ 963.071237] [] ? driver_allows_async_probing+0x30/0x30 [ 963.071241] [] ? bus_for_each_drv+0x62/0xb0 [ 963.071247] [] ? device_attach+0xd9/0x160 [ 963.071252] [] ? bus_probe_device+0x87/0xa0 [ 963.071257] [] ? device_add+0x478/0x640 [ 963.071272] [] ? usb_new_device+0x267/0x4a0 [usbcore] [ 963.071287] [] ? hub_event+0xfcc/0x1530 [usbcore] [ 963.071293] [] ? process_one_work+0x14b/0x410 [ 963.071297] [] ? worker_thread+0x65/0x4a0 [ 963.071300] [] ? rescuer_thread+0x340/0x340 [ 963.071304] [] ? rescuer_thread+0x340/0x340 [ 963.071309] [] ? kthread+0xe0/0x100 [ 963.071316] [] ? __switch_to+0x2bb/0x700 [ 963.071321] [] ? kthread_park+0x60/0x60 [ 963.071328] [] ? ret_from_fork+0x25/0x30 [ 963.071331] ---[ end trace 01324789c1b92aa5 ]--- [ 963.071338] tbs5922se: error while transferring firmware [ 963.071394] tbs5922se: could not restart the USB controller CPU. [ 963.071448] tbs5922se: could not restart the USB controller CPU.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bas-t/dvbloopback/issues/12#issuecomment-285102341, or mute the thread https://github.com/notifications/unsubscribe-auth/AAvhxubrfQ84RUdeEwzVbTemHpGTr96Cks5rjuAPgaJpZM4MOr9O .

bas-t commented 7 years ago

Does the file /lib/firmware/dvb-usb-tbsqbox-id5923.fw exist on your system?

dimerr commented 7 years ago

yes, it does

I've tried this patch, but no use: https://patchwork.kernel.org/patch/9556101/

bas-t commented 7 years ago

To ensure the best possible support for your platform you need the newest kernel imo. But you can try the same procedure with 4.8.17, just to see if the firmware issue does not exist in that one.

bas-t commented 7 years ago

Found the firmware bug. It's been addressed in https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/drivers/media/usb/dvb-usb?id=43fab9793c1f44e665b4f98035a14942edf03ddc

bas-t commented 7 years ago

The line:

Cc: stable@vger.kernel.org # Kernel 4.9+

at the bottom of the patch suggests that 4.9.x and 4.10.x are affected, but probably will be patched for the issue in their next release.

Meanwhile, the official TBS driver stack does not have the patch. Looking into that shortly.

dimerr commented 7 years ago

Im building 4.10.1 at the moment, after that, im gonna build 4.9.13 with that patch

bas-t commented 7 years ago

No need to do that, the official tbs driver will replace the original media stack, so your patch will be lost in the process

bas-t commented 7 years ago

Unless of course you are sick and tired of the official tbs driver and want to go opensource.

dimerr commented 7 years ago

I'm doing so to test on DVB-T2 stick first. As for official/opensource, I'd use any, as long as it works

bas-t commented 7 years ago

I patched the official tbs drivers so it can be used with 4.9.x

Did not test it yet, I guess you can do that.

https://github.com/bas-t/tbs-dvbloopback/commit/2f7ea61cd7e2001477466ba36800c70975b09bf7

bas-t commented 7 years ago

As for the opensource version, I guess I can make that happen in-tree, so you could happily run 4.11-rc1, like I'm doing right now. It would take some time though, but not much more then already invested.

dimerr commented 7 years ago

Well, no luck with this patch, neither with my manual 4.9.13 patch + DVB-T2 stick, nor with the one you've provided + TBS5922SE (btw, this needs another conditional for 4.9.0 https://github.com/bas-t/tbs-dvbloopback/commit/2f7ea61cd7e2001477466ba36800c70975b09bf7#diff-b4d5c332dc1f1d9b417c3b0157b3261bR36 )

still same 'transfer buffer not dma capable'

bas-t commented 7 years ago

What did I screw up in the conditional?

(I'm very dyslectic, so I tend to overlook some details)

dimerr commented 7 years ago

Well. according to a proposed patch, there should be

#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,9,0)
                if (ret != hx->len) {
#else
                if (ret != hx.len) {
#endif
bas-t commented 7 years ago

I see, should I fix that or are you sure it would not help, so I better revert the patch already

dimerr commented 7 years ago

If there would be someone with similar problem... Cause i feel like nothing would ever help in my case.

That patch - seems it helped at least someone and in my case, it's like I havent patched anything... I'm already thinking to put some printk's to be sure patch is applied and I'm actually using patched ver

I think it's better to have it fixed and leave it there, cause DVB in 4.9 is broken anyway

bas-t commented 7 years ago

Ok, will do.

Op 10 mrt. 2017 18:57 schreef "Dmitry Ermakov" notifications@github.com:

If there would be someone with similar problem... Cause i feel like nothing would ever help in my case.

That patch - seems it helped at least someone and in my case, it's like I havent patched anything... I'm already thinking to put some printk's to be sure patch is applied and I'm actually using patched ver

I think it's better to have it fixed and leave it there, cause DVB in 4.9 is broken anyway

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/bas-t/dvbloopback/issues/12#issuecomment-285739100, or mute the thread https://github.com/notifications/unsubscribe-auth/AAvhxlxS3SApNzvOw-_ewg5VRQn7-Lnhks5rkY8AgaJpZM4MOr9O .

bas-t commented 7 years ago

Fixed in https://github.com/bas-t/tbs-dvbloopback/commit/e55cc1a3cf94db07ee834e346ab744e9ff6134ad

bas-t commented 7 years ago

BTW: DVB is not broken in 4.9.x, I've been running each and every 4.9.x release (and up, running 4.11-rc1 right now) with my opensource TBS6285/6281 and DVBSKY T982 cards drivers without any trouble. I agree that "some parts" of the stack are broken though.

bas-t commented 7 years ago

Do you think it's worth the effort to port the TBS5922SE opensource drivers in order to build them in-tree in linux-4.11.x? (like I did with my TBS6285/6281 driver long time ago)

dimerr commented 7 years ago

To be honest, I'm checking those opensource drivers now and they dont look very "opensource", cause they seem to travel with own media stack again, just like proprietary TBS drivers.

I could try to do that myself, if you'd show your patch.

bas-t commented 7 years ago

I'm not sure I understand what you are saying. Opensource does not mean that the source is upstreamed. In my case, I need the pcie bridge driver (saa716x) to be incorporated into the kernel. In your case, it means that the demod and tuner chips drivers have to be incorporated, but not the usb bridge, as it is already in the kernel. Anyway, I'll show you how it's done. Just wait for it, might take a few says.

dimerr commented 7 years ago

I've put opensource in braces, cause I've expected them to be as some in-tree patch, rather than whole media stack, which brings possible compatibility issues with newer kernels. But oh well, I guess its too hard to maintain it as a patch