[pvrusb2] Ability to fully reset a PVRUSB2 Device

Mike Isely isely at isely.net
Sun Sep 22 15:04:16 CDT 2019


I picked through it.  That's a crash when the driver was trying to 
untangle itself from the V4L interface.  Different problem than the 
oopses I've been seeing.  So far I have not seen this one happen here, 
but I'm running a 5.2.13 vanilla kernel checked out from git (no distro 
patches).  I think right now I'm going to concentrate on the issues I 
can produce.  Summary right now:

1. I2C access infinite loop caused by traffic from ir_kbd_i2c when the 
hardware is hot-unplugged.  Disabling that module works around this 
issue.  While not a solution that at least clears the air for the other 
issues...

2. Kernel oopses (not crashes) coming from attempts to remove sysfs 
controls during tear-down, which appears to be a case of something else 
doing the removal at the same time out from under the driver.

3. (Haven't reproduced yet) Kernel oops coming from the V4L2 side of the 
driver when tearing down.

4. (Haven't reproduced yet) Kernel panic on driver removal.

5. Process hang when trying to modprobe -r pvrusb2, under not-understood 
yet circumstances.  (By process hang, what I mean is that the process 
which is running modprobe -r pvrusb2 never finishes, can't be 
interrupted, and the rest of the system seems to continue operating ok.)

  -Mike


On Sun, 22 Sep 2019, Mike Isely wrote:

> 
> Ugh.  This is line-wrapped to hell-and-back.  Can you resend that as a 
> file attachment?
> 
>   -Mike
> 
> On Sun, 22 Sep 2019, Diego Rivera wrote:
> 
> > This is what kern.log shows when I hot-unplug/hot-poweroff one of the
> > devices:
> > 
> > Sep 22 13:36:05 tvserver kernel: [  156.265825] usb 1-4: USB disconnect,
> > device number 8
> > Sep 22 13:36:05 tvserver kernel: [  156.266059] pvrusb2: Device being
> > rendered inoperable
> > Sep 22 13:36:05 tvserver kernel: [  156.266162] BUG: unable to handle
> > kernel NULL pointer dereference at 0000000000000520
> > Sep 22 13:36:05 tvserver kernel: [  156.266299] #PF error: [normal kernel
> > read fault]
> > Sep 22 13:36:05 tvserver kernel: [  156.266376] PGD 0 P4D 0
> > Sep 22 13:36:05 tvserver kernel: [  156.266424] Oops: 0000 [#1] SMP PTI
> > Sep 22 13:36:05 tvserver kernel: [  156.266485] CPU: 0 PID: 2190 Comm:
> > pvrusb2-context Not tainted 5.0.0-29-generic #31-Ubuntu
> > Sep 22 13:36:05 tvserver kernel: [  156.266610] Hardware name: To Be Filled
> > By O.E.M. To Be Filled By O.E.M./Q1900-ITX, BIOS P1.70 03/31/2016
> > Sep 22 13:36:05 tvserver kernel: [  156.266770] RIP:
> > 0010:pvr2_v4l2_internal_check+0x47/0x70 [pvrusb2]
> > Sep 22 13:36:05 tvserver kernel: [  156.266867] Code: 2f e4 ff ff 48 8b 7b
> > 40 e8 26 e4 ff ff 48 8b 43 38 48 8b 90 20 05 00 00 48 05 20 05 00 00 48 39
> > d0 74 03 5b 5d c3 48 8b 43 40 <48> 8b 90 20 05 00 00 48 05 20 05 00 00 48
> > 39 d0 75 e7 48 89 df e8
> > Sep 22 13:36:05 tvserver kernel: [  156.267140] RSP: 0018:ffffb4f3c262fea0
> > EFLAGS: 00010246
> > Sep 22 13:36:05 tvserver kernel: [  156.267223] RAX: 0000000000000000 RBX:
> > ffff9112efad8ba0 RCX: 0000000000000000
> > Sep 22 13:36:05 tvserver kernel: [  156.267331] RDX: ffff9112ee80cd20 RSI:
> > 0000000000000000 RDI: 0000000000000000
> > Sep 22 13:36:05 tvserver kernel: [  156.267439] RBP: ffffb4f3c262fea8 R08:
> > 0000000000000000 R09: ffff9112ed60c618
> > Sep 22 13:36:05 tvserver kernel: [  156.267546] R10: 000000000000f000 R11:
> > 0000002462016bed R12: ffff9112ef474000
> > Sep 22 13:36:05 tvserver kernel: [  156.267653] R13: ffffffffc108ba90 R14:
> > 0000000000000000 R15: ffff9112f36ed700
> > Sep 22 13:36:05 tvserver kernel: [  156.267761] FS:  0000000000000000(0000)
> > GS:ffff9112f8200000(0000) knlGS:0000000000000000
> > Sep 22 13:36:05 tvserver kernel: [  156.267880] CS:  0010 DS: 0000 ES: 0000
> > CR0: 0000000080050033
> > Sep 22 13:36:05 tvserver kernel: [  156.267968] CR2: 0000000000000520 CR3:
> > 000000014820e000 CR4: 00000000001006f0
> > Sep 22 13:36:05 tvserver kernel: [  156.268074] Call Trace:
> > Sep 22 13:36:05 tvserver kernel: [  156.268136]
> >  pvr2_context_thread_func+0xc4/0x2b0 [pvrusb2]
> > Sep 22 13:36:05 tvserver kernel: [  156.268227]  ? wait_woken+0x80/0x80
> > Sep 22 13:36:05 tvserver kernel: [  156.268290]  kthread+0x120/0x140
> > Sep 22 13:36:05 tvserver kernel: [  156.268362]  ?
> > pvr2_context_destroy+0xc0/0xc0 [pvrusb2]
> > Sep 22 13:36:05 tvserver kernel: [  156.268449]  ?
> > __kthread_parkme+0x70/0x70
> > Sep 22 13:36:05 tvserver kernel: [  156.268518]  ret_from_fork+0x35/0x40
> > Sep 22 13:36:05 tvserver kernel: [  156.268578] Modules linked in: s5h1411
> > tda18271 tda8290 tuner cx25840 pvrusb2 tveeprom cx2341x dvb_core
> > v4l2_common videodev media veth xt_nat ipt_MASQUERADE xfrm_user xfrm_algo
> > br_netfilter bridge stp llc xt_recent ipt_REJECT nf_reject_ipv4 xt_limit
> > xt_comment xt_multiport xt_conntrack xt_hashlimit xt_addrtype xt_mark
> > iptable_mangle xt_tcpudp xt_CT iptable_raw nfnetlink_log xt_NFLOG
> > nf_log_ipv4 nf_log_common xt_LOG nf_conntrack_sane nf_conntrack_netlink
> > nfnetlink nf_nat_tftp nf_nat_snmp_basic nf_conntrack_snmp nf_nat_sip
> > nf_nat_pptp nf_nat_irc nf_nat_h323 nf_nat_ftp nf_nat_amanda
> > nf_conntrack_tftp nf_conntrack_sip nf_conntrack_pptp nf_conntrack_proto_gre
> > nf_conntrack_netbios_ns nf_conntrack_broadcast nf_conntrack_irc
> > nf_conntrack_h323 nf_conntrack_ftp ts_kmp nf_conntrack_amanda iptable_nat
> > nf_nat_ipv4 nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 arc4
> > iptable_filter bpfilter md4 cmac nls_utf8 cifs ccm fscache aufs overlay
> > nls_iso8859_1 xfs libcrc32c snd_hdmi_lpe_audio snd_pcm
> > Sep 22 13:36:05 tvserver kernel: [  156.268655]  snd_seq_midi
> > snd_seq_midi_event snd_rawmidi snd_seq snd_seq_device snd_timer snd
> > soundcore intel_rapl intel_soc_dts_thermal intel_soc_dts_iosf
> > intel_powerclamp coretemp kvm_intel punit_atom_debug i915 joydev kvmgt
> > crct10dif_pclmul input_leds vfio_mdev mdev crc32_pclmul vfio_iommu_type1
> > ghash_clmulni_intel cryptd vfio intel_cstate kvm irqbypass drm_kms_helper
> > drm hci_uart i2c_algo_bit fb_sys_fops btqca mei_txe syscopyarea btrtl
> > sysfillrect mei sysimgblt btbcm btintel bluetooth ecdh_generic rfkill_gpio
> > mac_hid sch_fq_codel ip_tables x_tables autofs4 hid_logitech_hidpp
> > hid_logitech_dj hid_generic usbhid r8169 ahci lpc_ich i2c_i801 libahci
> > realtek i2c_hid video hid
> > Sep 22 13:36:05 tvserver kernel: [  156.270831] CR2: 0000000000000520
> > Sep 22 13:36:05 tvserver kernel: [  156.270891] ---[ end trace
> > 5d13378174849ef9 ]---
> > Sep 22 13:36:05 tvserver kernel: [  156.270988] RIP:
> > 0010:pvr2_v4l2_internal_check+0x47/0x70 [pvrusb2]
> > Sep 22 13:36:05 tvserver kernel: [  156.271089] Code: 2f e4 ff ff 48 8b 7b
> > 40 e8 26 e4 ff ff 48 8b 43 38 48 8b 90 20 05 00 00 48 05 20 05 00 00 48 39
> > d0 74 03 5b 5d c3 48 8b 43 40 <48> 8b 90 20 05 00 00 48 05 20 05 00 00 48
> > 39 d0 75 e7 48 89 df e8
> > Sep 22 13:36:05 tvserver kernel: [  156.271363] RSP: 0018:ffffb4f3c262fea0
> > EFLAGS: 00010246
> > Sep 22 13:36:05 tvserver kernel: [  156.271447] RAX: 0000000000000000 RBX:
> > ffff9112efad8ba0 RCX: 0000000000000000
> > Sep 22 13:36:05 tvserver kernel: [  156.271556] RDX: ffff9112ee80cd20 RSI:
> > 0000000000000000 RDI: 0000000000000000
> > Sep 22 13:36:05 tvserver kernel: [  156.271665] RBP: ffffb4f3c262fea8 R08:
> > 0000000000000000 R09: ffff9112ed60c618
> > Sep 22 13:36:05 tvserver kernel: [  156.271773] R10: 000000000000f000 R11:
> > 0000002462016bed R12: ffff9112ef474000
> > Sep 22 13:36:05 tvserver kernel: [  156.271882] R13: ffffffffc108ba90 R14:
> > 0000000000000000 R15: ffff9112f36ed700
> > Sep 22 13:36:05 tvserver kernel: [  156.271990] FS:  0000000000000000(0000)
> > GS:ffff9112f8200000(0000) knlGS:0000000000000000
> > Sep 22 13:36:05 tvserver kernel: [  156.272111] CS:  0010 DS: 0000 ES: 0000
> > CR0: 0000000080050033
> > Sep 22 13:36:05 tvserver kernel: [  156.272201] CR2: 0000000000000520 CR3:
> > 000000014820e000 CR4: 00000000001006f0
> > Sep 22 13:36:10 tvserver kernel: [  161.084276] usb 1-4: new high-speed USB
> > device number 9 using xhci_hcd
> > Sep 22 13:36:10 tvserver kernel: [  161.236211] usb 1-4: New USB device
> > found, idVendor=2040, idProduct=7501, bcdDevice= 8.00
> > Sep 22 13:36:10 tvserver kernel: [  161.236349] usb 1-4: New USB device
> > strings: Mfr=1, Product=2, SerialNumber=3
> > Sep 22 13:36:10 tvserver kernel: [  161.236458] usb 1-4: Product: WinTV
> > Sep 22 13:36:10 tvserver kernel: [  161.236516] usb 1-4: Manufacturer:
> > Hauppauge
> > Sep 22 13:36:10 tvserver kernel: [  161.236584] usb 1-4: SerialNumber:
> > 7300-00-F080EDCF
> > Sep 22 13:36:10 tvserver kernel: [  161.239374] pvrusb2: Hardware
> > description: WinTV HVR-1950 Model 751xx
> > 
> > Cheers!
> > --
> > *Diego Rivera*
> > 
> > 
> > <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
> > Virus-free.
> > www.avast.com
> > <https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
> > <#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
> > 
> > On Sun, Sep 22, 2019 at 12:42 PM Mike Isely <isely at isely.net> wrote:
> > 
> > > On Sun, 22 Sep 2019, Mike Isely wrote:
> > >
> > > >
> > > > On Sun, 14 Apr 2019, Diego Rivera wrote:
> > > >
> > > > > Guinea pig #1 ready, sir! 😂
> > > > >
> > > > > --
> > > > >
> > > > > Diego Rivera
> > > > >
> > > >
> > > > Diego:
> > > >
> > > > Going back over this thread and comparing my recent notes, there's a
> > > > good experiment I'd like you to try:  Get the hardware into a state
> > > > where you get the "Attempted to execute control transfer when device not
> > > > ok" infinite log spew.  Once you've confirmed the scenario again, reboot
> > > > the host and then rename the ir-kbd-i2c.ko module to something which
> > > > disables it.  You can find this module in the following path:
> > > >
> > > > /lib/modules/`uname -r`/krtnrl/drivers/media/i2c/
> > >
> > > Typo correction:
> > >
> > > /lib/modules/`uname -r`/kernel/drivers/media/i2c/
> > >
> > > (fingers in wrong position on keyboard, apparently)
> > >
> > >
> > > >
> > > > A good thing to do would be to just add "-disabled" to the end of the
> > > > file name.  Then run "depmod -a" to rebuild the module dependencies
> > > > (should take a few seconds) and now the ir-kbd-i2c module will be
> > > > disabled.  On the off-chance that it has already been loaded, also run
> > > > "modprobe -r ir_kbd_ic2" (or just reboot again).  NOW, run that same
> > > > scenario where you get the log spew as mentioned above.  Is that still
> > > > happening?  Also, if it isn't still happening, does "modprobe -r
> > > > pvrusb2" still get stuck?
> > > >
> > > > The reason I ask is because that's what I am seeing here.  That
> > > > ir-kbd-i2c here is the source of the endless stream of failing I2C
> > > > requests into the pvrusb2 driver.  I want to make sure we're looking at
> > > > the same bug.  I've got roughly 3 misbehaviors on my plate right now.
> > > > This is one of them.
> > > >
> > > > There was an earlier mention of a kernel panic when trying to remove the
> > > > pvrusb2 driver from the system.  While I am seeing kernel oopses from
> > > > this - due to sysfs doing something unexpected - it is not panicing.
> > > > So I have not yet seen that specific problem.  I'd like to know what
> > > > exact kernel was being run (distro / uname -r output / .config would
> > > > help too).
> > > >
> > > >   -Mike
> > > >
> > > > --
> > > >
> > > > Mike Isely
> > > > isely @ isely (dot) net
> > > > PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
> > > > _______________________________________________
> > > > pvrusb2 mailing list
> > > > pvrusb2 at isely.net
> > > > http://www.isely.net/cgi-bin/mailman/listinfo/pvrusb2
> > > >
> > >
> > > --
> > >
> > > Mike Isely
> > > isely @ isely (dot) net
> > > PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
> > > _______________________________________________
> > > pvrusb2 mailing list
> > > pvrusb2 at isely.net
> > > http://www.isely.net/cgi-bin/mailman/listinfo/pvrusb2
> > >
> > _______________________________________________
> > pvrusb2 mailing list
> > pvrusb2 at isely.net
> > http://www.isely.net/cgi-bin/mailman/listinfo/pvrusb2
> > 
> 
> -- 
> 
> Mike Isely
> isely @ isely (dot) net
> PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8
> _______________________________________________
> pvrusb2 mailing list
> pvrusb2 at isely.net
> http://www.isely.net/cgi-bin/mailman/listinfo/pvrusb2
> 

-- 

Mike Isely
isely @ isely (dot) net
PGP: 03 54 43 4D 75 E5 CC 92 71 16 01 E2 B5 F5 C1 E8


More information about the pvrusb2 mailing list