linux_dsm_epyc7002/drivers/media/dvb/dvb-usb
Daniel J Blueman 8268c8f545 V4L/DVB (9492): unplug oops from dvb_frontend_init...
When inadvertently hot-unplugging a WT-220U USB DVB-T receiver with
2.6.24, I was met with an oops [1]. The problem is relevant to
2.6.25/26-rc also.

dvb_frontend_init() was called either from re-creation of the kdvb-fe0
thread - seems unlikely, or someone called
dvb_frontend_reinitialise(), causing this path in the thread - really
unlikely, as I can't find any call-site for it.

Either way, quite a number of drivers call dvb_usb_generic_rw() [2]
without checking the validity of the relevant member in the
dvb_usb_device struct - which had changed. Having dvb_usb_generic_rw()
sanity-check and fail (rather than loading from 0x120) seems
reasonable defensive programming [3], in light of it being called in
this way.

The problem with this, is that drivers don't check the return code of
the init call [4]. Does it make sense to cook a patch which allows the
failure to be propagated back up, or am I missing something else?

Thanks,
  Daniel

<whoops, hot unplug>

[83711.538485] dvb-usb: bulk message failed: -71 (1/0)
[83711.538875] dvb-usb: bulk message failed: -71 (1/0)
[83711.538899] usb 7-5: USB disconnect, address 3
[83711.538905] dvb-usb: bulk message failed: -22 (1/0)
[83711.538924] dvb-usb: bulk message failed: -22 (1/0)
[83711.538943] dvb-usb: bulk message failed: -22 (1/0)
[83711.588979] dvb-usb: bulk message failed: -22 (1/0)
[83711.589031] dvb-usb: bulk message failed: -22 (1/0)
[83711.589078] dvb-usb: bulk message failed: -22 (1/0)
[83711.589122] dvb-usb: bulk message failed: -22 (1/0)
[83711.589167] dvb-usb: bulk message failed: -22 (1/0)
[83711.639233] dvb-usb: bulk message failed: -22 (1/0)
[83711.639282] dvb-usb: bulk message failed: -22 (1/0)
[83711.639330] dvb-usb: bulk message failed: -22 (1/0)
[83711.639374] dvb-usb: bulk message failed: -22 (1/0)
[83711.639421] dvb-usb: bulk message failed: -22 (1/0)
[83711.658391] dvb-usb: bulk message failed: -22 (1/0)
[83768.174281] dvb-usb: bulk message failed: -22 (2/-32512)
[83768.174350] Unable to handle kernel NULL pointer
dereference<6>dvb-usb: WideView WT-220U PenType Receiver
(Typhoon/Freecom) successfully deinitialized and disconnected.
[83768.174459]  at 0000000000000120 RIP:
[83768.174459]  [<ffffffff88339b4f>] :dvb_usb:dvb_usb_generic_rw+0x2f/0x1a0
[83768.174580] PGD 0
[83768.174643] Oops: 0000 [1] SMP
[83768.174723] CPU 0
[83768.174782] Modules linked in: nfsd auth_rpcgss exportfs nfs lockd
nfs_acl sunrpc af_packet xt_length ipt_tos ipt_TOS xt_CLASSIFY sch_sfq
sch_htb ipt_MASQUERADE ipt_REDIRECT xt_limit xt_state xt_tcpudp
iptable_nat nf_nat nf_conntrack_ipv4 nf_conntrack iptable_mangle
iptable_filter ip_tables x_tables xfs sbp2 parport_pc lp parport loop
ftdi_sio usbserial evdev dvb_usb_dtt200u dvb_usb dvb_core i2c_core
sky2 iTCO_wdt iTCO_vendor_support snd_hda_intel shpchp snd_pcm
snd_timer snd_page_alloc snd_hwdep snd pci_hotplug soundcore ipv6
button intel_agp ext3 jbd mbcache sg sd_mod ata_generic pata_acpi ahci
ata_piix libata scsi_mod ohci1394 ieee1394 ehci_hcd uhci_hcd usbcore
e1000 thermal processor fan fbcon tileblit font bitblit softcursor
fuse
[83768.176968] Pid: 5732, comm: kdvb-fe-0 Not tainted 2.6.24-16-server #1
[83768.177009] RIP: 0010:[<ffffffff88339b4f>]  [<ffffffff88339b4f>]
:dvb_usb:dvb_usb_generic_rw+0x2f/0x1a0
[83768.177096] RSP: 0018:ffff810021939df0  EFLAGS: 00010286
[83768.177138] RAX: ffff81003bc7cc00 RBX: 0000000000000001 RCX: 0000000000000000
[83768.177181] RDX: 0000000000000001 RSI: ffff810021939e67 RDI: 0000000000000000
[83768.177223] RBP: 0000000000000000 R08: 0000000000000000 R09: 0000000000000000
[83768.177267] R10: ffff810001009880 R11: 0000000000000001 R12: ffff81003c10b400
[83768.177311] R13: ffff81003c10b5b0 R14: ffff810021939ec0 R15: 0000000000000000
[83768.177354] FS:  0000000000000000(0000) GS:ffffffff805c3000(0000)
knlGS:0000000000000000
[83768.177409] CS:  0010 DS: 0018 ES: 0018 CR0: 000000008005003b
[83768.177449] CR2: 0000000000000120 CR3: 0000000000201000 CR4: 00000000000006e0
[83768.177491] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
[83768.177534] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
[83768.177576] Process kdvb-fe-0 (pid: 5732, threadinfo
ffff810021938000, task ffff81003bd1b7a0)
[83768.177629] Stack:  ffff81003e9b6828 0000000000000000
ffff8100378369f8 0000000000000000
[83768.177800]  ffff81003bd1b7a0 ffff810037836d48 ffff81003bc7cc30
ffff81003c10b400
[83768.177943]  ffff81003c10b5b0 ffff810021939ec0 ffff81003c10b5e0
ffffffff88342452
[83768.178054] Call Trace:
[83768.178130]  [<ffffffff88342452>] :dvb_usb_dtt200u:dtt200u_fe_init+0x22/0x30
[83768.178178]  [<ffffffff88339f6a>] :dvb_usb:dvb_usb_fe_wakeup+0x3a/0x50
[83768.178229]  [<ffffffff88325c41>] :dvb_core:dvb_frontend_init+0x21/0x70
[83768.178278]  [<ffffffff8832746b>] :dvb_core:dvb_frontend_thread+0x8b/0x370
[83768.178329]  [<ffffffff883273e0>] :dvb_core:dvb_frontend_thread+0x0/0x370
[83768.178382]  [<ffffffff80253e3b>] kthread+0x4b/0x80
[83768.178427]  [<ffffffff8020d198>] child_rip+0xa/0x12
[83768.178473]  [<ffffffff80253df0>] kthread+0x0/0x80
[83768.178514]  [<ffffffff8020d18e>] child_rip+0x0/0x12
[83768.178557]
[83768.178594]
[83768.178594] Code: 44 8b 87 20 01 00 00 49 89 f4 45 89 ce 45 85 c0
0f 84 ad 00
[83768.179167] RIP  [<ffffffff88339b4f>] :dvb_usb:dvb_usb_generic_rw+0x2f/0x1a0
[83768.179234]  RSP <ffff810021939df0>
[83768.179271] CR2: 0000000000000120
[83768.179419] ---[ end trace dba8483163cb1700 ]---

Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
2008-11-11 08:11:26 -02:00
..
a800.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
af9005-fe.c V4L/DVB (5933): Dvb-usb/af9005-fe.c: error check fixes 2007-07-30 16:26:37 -03:00
af9005-remote.c V4L/DVB (8906): v4l-dvb: fix assorted sparse warnings 2008-10-12 09:36:58 -02:00
af9005-script.h V4L/DVB (8906): v4l-dvb: fix assorted sparse warnings 2008-10-12 09:36:58 -02:00
af9005.c V4L/DVB (8906): v4l-dvb: fix assorted sparse warnings 2008-10-12 09:36:58 -02:00
af9005.h V4L/DVB (5625): Add support for the AF9005 demodulator from Afatech 2007-07-18 14:23:26 -03:00
af9015.c V4L/DVB (9147): af9015: Add USB ID for MSI DIGIVOX mini III 2008-10-13 07:15:52 -02:00
af9015.h V4L/DVB (8972): initial driver for af9015 chipset 2008-10-12 09:37:03 -02:00
anysee.c V4L/DVB (9141): anysee: support for Anysee E30 Combo Plus 2008-10-13 07:15:34 -02:00
anysee.h V4L/DVB (8032): Anysee: fix Kconfig 2008-07-20 07:09:33 -03:00
au6610.c V4L/DVB (7952): AU6610: various cosmetic changes 2008-07-20 07:07:56 -03:00
au6610.h V4L/DVB (7952): AU6610: various cosmetic changes 2008-07-20 07:07:56 -03:00
cinergyT2-core.c V4L/DVB (9108): cinergyT2: add remote key repeat feature 2008-10-12 09:37:14 -02:00
cinergyT2-fe.c V4L/DVB (9107): Alternative version of Terratec Cinergy T2 driver 2008-10-12 09:37:14 -02:00
cinergyT2.h V4L/DVB (9107): Alternative version of Terratec Cinergy T2 driver 2008-10-12 09:37:14 -02:00
cxusb.c V4L/DVB (9049): convert tuner drivers to use dvb_frontend->callback 2008-10-12 09:37:09 -02:00
cxusb.h V4L/DVB (8147): cxusb: add initial support for AVerTVHD Volar 2008-07-20 07:14:14 -03:00
dib07x0.h
dib0700_core.c V4L/DVB (9044): Add support for Pinnacle PCTV HD Pro 801e (ATSC only) 2008-10-12 09:37:09 -02:00
dib0700_devices.c V4L/DVB (9114): dib0700: fix bad assignment of dib0700_xc5000_tuner_callback after return call 2008-10-12 09:37:14 -02:00
dib0700.h V4L/DVB (9044): Add support for Pinnacle PCTV HD Pro 801e (ATSC only) 2008-10-12 09:37:09 -02:00
dibusb-common.c V4L/DVB (6794): Fix compilation when dib3000mc is compiled as a module 2007-12-11 18:13:28 -02:00
dibusb-mb.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
dibusb-mc.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
dibusb.h V4L/DVB (5779): Dibusb-mb: fix broken 'tuner_pass_ctrl' functionality 2007-07-18 14:24:16 -03:00
digitv.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
digitv.h V4L/DVB (6578): dvb-usb: make some debug vars static 2008-01-25 19:02:06 -02:00
dtt200u-fe.c
dtt200u.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
dtt200u.h
dtv5100.c V4L/DVB (8739): dtv5100: remove prohibited space... 2008-10-12 09:36:52 -02:00
dtv5100.h V4L/DVB (8738): dtv5100: remove old definition from header 2008-10-12 09:36:51 -02:00
dvb-usb-common.h V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
dvb-usb-dvb.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
dvb-usb-firmware.c V4L/DVB (7971): usb: unaligned 2008-06-05 06:35:53 -03:00
dvb-usb-i2c.c v4l-dvb: remove legacy checks to allow support for kernels < 2.6.10 2008-07-20 07:17:52 -03:00
dvb-usb-ids.h V4L/DVB (9147): af9015: Add USB ID for MSI DIGIVOX mini III 2008-10-13 07:15:52 -02:00
dvb-usb-init.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
dvb-usb-remote.c get rid of input BIT* duplicate defines 2007-10-19 11:53:42 -07:00
dvb-usb-urb.c V4L/DVB (9492): unplug oops from dvb_frontend_init... 2008-11-11 08:11:26 -02:00
dvb-usb.h V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
dw2102.c V4L/DVB (9296): Patch to remove warning message during cx88-dvb compilation 2008-10-17 17:41:30 -03:00
dw2102.h V4L/DVB (8991): Added support for DVBWorld 2104 and TeVii S650 USB DVB-S2 cards 2008-10-12 09:37:04 -02:00
gl861.c V4L/DVB (8014): gl861: coding style fixes 2008-07-20 07:08:55 -03:00
gl861.h V4L/DVB (8014): gl861: coding style fixes 2008-07-20 07:08:55 -03:00
gp8psk-fe.c V4L/DVB (7513): media/dvb/dvb-usb replace remaining __FUNCTION__ occurrences 2008-04-24 14:07:58 -03:00
gp8psk.c gp8psk: treat firmware data as const 2008-07-10 14:26:34 +01:00
gp8psk.h V4L/DVB (6571): dvb-usb/gp8psk.c: #if 0 gp8psk_bcm4500_reload() 2008-01-25 19:02:03 -02:00
Kconfig V4L/DVB (9358): CinergyT2: fix Kconfig typo 2008-11-11 08:11:22 -02:00
m920x.c V4L/DVB (7969): m920x: unaligned access 2008-06-05 06:35:52 -03:00
m920x.h V4L/DVB (5692): M920x: attempt to fix hw pid filters on second endpoint 2007-07-18 14:23:38 -03:00
Makefile V4L/DVB (9107): Alternative version of Terratec Cinergy T2 driver 2008-10-12 09:37:14 -02:00
nova-t-usb2.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
opera1.c V4L/DVB (7662): stv0299: Fixed some typos 2008-04-24 14:09:45 -03:00
ttusb2.c V4L/DVB (7654): tda10086: make the xtal frequency a configuration option 2008-04-24 14:09:44 -03:00
ttusb2.h
umt-010.c V4L/DVB (8042): DVB-USB UMT-010 channel scan oops 2008-06-26 15:58:51 -03:00
usb-urb.c
vp702x-fe.c V4L/DVB (7513): media/dvb/dvb-usb replace remaining __FUNCTION__ occurrences 2008-04-24 14:07:58 -03:00
vp702x.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
vp702x.h V4L/DVB (6572): dvb-usb/vp702x.c: cleanups 2008-01-25 19:02:04 -02:00
vp7045-fe.c
vp7045.c V4L/DVB (7538): Adds selectable adapter numbers as per module option 2008-04-24 14:08:00 -03:00
vp7045.h V4L/DVB (6578): dvb-usb: make some debug vars static 2008-01-25 19:02:06 -02:00