Bug 73361
Summary: | device or resource busy errors with linux kernel 3.14 | ||
---|---|---|---|
Product: | v4l-dvb | Reporter: | Hussam Al-Tayeb (ht990332) |
Component: | saa7134 | Assignee: | Hans Verkuil (hverkuil) |
Status: | RESOLVED CODE_FIX | ||
Severity: | normal | CC: | btanastasov, ht990332, hverkuil, jaculor, mchehab, valerio.vanni |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 3.14 | Subsystem: | |
Regression: | Yes | Bisected commit-id: | |
Attachments: | Fix for saa7134 |
Description
Hussam Al-Tayeb
2014-04-02 06:03:25 UTC
cat /etc/modprobe.d/saa7134.conf options saa7134 card=3 tuner=5 I have the same problem. My card is: subsystem: 5168:0138, board: LifeView FlyVIDEO3000 [card=2,insmod option] Git bisect shows that the problem is in commit: 9db0fb182ea8a42c5bfd322b169d65728721fd71 is the first bad commit commit 9db0fb182ea8a42c5bfd322b169d65728721fd71 Author: Hans Verkuil <hans.verkuil@cisco.com> Date: Sat Dec 14 08:28:23 2013 -0300 [media] saa7134: move the queue data from saa7134_fh to saa7134_dev These fields are global, not per-filehandle. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> git bisect start 'drivers/media/pci/saa7134/' # good: [d8ec26d7f8287f5788a494f56e8814210f0e64be] Linux 3.13 git bisect good d8ec26d7f8287f5788a494f56e8814210f0e64be # bad: [455c6fdbd219161bd09b1165f11699d6d73de11c] Linux 3.14 git bisect bad 455c6fdbd219161bd09b1165f11699d6d73de11c # bad: [95075dd01e715dbc03936e3045e95068f0126416] [media] saa7134: use V4L2_IN_ST_NO_SIGNAL instead of NO_SYNC git bisect bad 95075dd01e715dbc03936e3045e95068f0126416 # bad: [b93a18d56057a6f8ccb79c5cd085dd31395331ff] [media] saa7134: cleanup radio/video/empress ioctl handling git bisect bad b93a18d56057a6f8ccb79c5cd085dd31395331ff # bad: [9db0fb182ea8a42c5bfd322b169d65728721fd71] [media] saa7134: move the queue data from saa7134_fh to saa7134_dev git bisect bad 9db0fb182ea8a42c5bfd322b169d65728721fd71 # good: [258d2fbf874c87830664cb7ef41f9741c1abffac] Merge tag 'v3.13-rc1' into patchwork git bisect good 258d2fbf874c87830664cb7ef41f9741c1abffac # first bad commit: [9db0fb182ea8a42c5bfd322b169d65728721fd71] [media] saa7134: move the queue data from saa7134_fh to saa7134_dev I'll have to make full bisect, because 3.14 with whole saa7134 directory doesn't work too. Please ignore comment 3. I thought that compiling kernel 3.14 with whole saa7134 directory would work, but it didn't finished successfully. I'm confirming that this is the first bad commit after full bisect between 3.13 and 3.14: 9db0fb182ea8a42c5bfd322b169d65728721fd71 is the first bad commit commit 9db0fb182ea8a42c5bfd322b169d65728721fd71 Author: Hans Verkuil <hans.verkuil@cisco.com> Date: Sat Dec 14 08:28:23 2013 -0300 [media] saa7134: move the queue data from saa7134_fh to saa7134_dev These fields are global, not per-filehandle. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com> Created attachment 132471 [details]
Fix for saa7134
This patch should fix the saa7134 driver.
The problem is caused by unusual tvtime behavior: when you stop it it called STREAMOFF, but then proceeds to queue new buffers for no good reason before it finally closed the file descriptor. The changes I made broke support for that behavior, causing the driver to think that streaming was still in progress since it still had buffers queued up.
*** Bug 73031 has been marked as a duplicate of this bug. *** Sadly tvtime is no longer in development. (In reply to Hans Verkuil from comment #5) > Created attachment 132471 [details] > Fix for saa7134 > > This patch should fix the saa7134 driver. > > The problem is caused by unusual tvtime behavior: when you stop it it called > STREAMOFF, but then proceeds to queue new buffers for no good reason before > it finally closed the file descriptor. The changes I made broke support for > that behavior, causing the driver to think that streaming was still in > progress since it still had buffers queued up. I rebuilt my kernel with that patch. it fixed the problem. thank you. with this patch on kernel 3.14.2, i see this in systemd's journal when closing tvtime. May 06 14:02:28 hades kernel: ------------[ cut here ]------------ May 06 14:02:28 hades kernel: WARNING: CPU: 1 PID: 3142 at kernel/power/qos.c:426 pm_qos_remove_request+0xea/0x May 06 14:02:28 hades kernel: pm_qos_remove_request() called for unknown object May 06 14:02:28 hades kernel: Modules linked in: nvidia(PO) w83627ehf hwmon_vid coretemp hwmon act_police sch_i May 06 14:02:28 hades kernel: button video processor vboxdrv(O) sg ext4 crc16 mbcache jbd2 sha256_ssse3 sha256 May 06 14:02:28 hades kernel: CPU: 1 PID: 3142 Comm: tvtime Tainted: P W O 3.14.2-1-ARCH #1 May 06 14:02:28 hades kernel: Hardware name: /DG31PR, BIOS PRG3110H.86A.0052.2008.0612.1910 06 May 06 14:02:28 hades kernel: 0000000000000000 000000003f568ede ffff8800b3a11d50 ffffffff8150984e May 06 14:02:28 hades kernel: ffff8800b3a11d98 ffff8800b3a11d88 ffffffff8106ab2d ffff8800aa45cf88 May 06 14:02:28 hades kernel: ffff8800aa45cb78 ffff8800da5d6000 ffff8800ab663a00 ffff880119bf88e0 May 06 14:02:28 hades kernel: Call Trace: May 06 14:02:28 hades kernel: [<ffffffff8150984e>] dump_stack+0x4d/0x6f May 06 14:02:28 hades kernel: [<ffffffff8106ab2d>] warn_slowpath_common+0x7d/0xa0 May 06 14:02:28 hades kernel: [<ffffffff8106abac>] warn_slowpath_fmt+0x5c/0x80 May 06 14:02:28 hades kernel: [<ffffffff810bc28a>] pm_qos_remove_request+0xea/0x100 May 06 14:02:28 hades kernel: [<ffffffffa06923fb>] video_release+0x2eb/0x380 [saa7134] May 06 14:02:28 hades kernel: [<ffffffffa065bb03>] ? videobuf_dma_free+0x73/0xc0 [videobuf_dma_sg] May 06 14:02:28 hades kernel: [<ffffffffa05df5d8>] v4l2_release+0x38/0x80 [videodev] May 06 14:02:28 hades kernel: [<ffffffff811bc4cc>] __fput+0x9c/0x240 May 06 14:02:28 hades kernel: [<ffffffff811bc6be>] ____fput+0xe/0x10 May 06 14:02:28 hades kernel: [<ffffffff8108c24f>] task_work_run+0xaf/0xe0 May 06 14:02:28 hades kernel: [<ffffffff81016c55>] do_notify_resume+0x95/0xa0 May 06 14:02:28 hades kernel: [<ffffffff81517860>] int_signal+0x12/0x17 May 06 14:02:28 hades kernel: ---[ end trace d20b9146dff8a269 ]--- I can still open tvtime again (without reloading the driver) and everything continues to work fine regardless of this error. But it happens exactly after each time i close tvtime. This patch worked for 3.14, but for 3.15 it doesn't help and is still not included in mainline. Still the same problem - Device or resource busy error when trying to open tvtime second time. It works in 3.15 for me. I can open and close tvtime as many times as I want without unloading/reloading the driver. But there is the error I see in dmesg everytime I close tvtime. Hopefully the developers can have time to take another look by 3.16 :) For me only kdetv doesn't break thing. With tvtime only the first time is working. I can see it pesent in 3.15rc1 from git, but I've successfully applied it in 3.15 - so it is not included, maybe reverted in final. It is not present in the patch-3.15.xz from kernel.org: # unxz -c patch-3.15.xz |diffstat |grep saa7134 b/drivers/media/pci/saa7134/saa7134- alsa.c | 6 b/drivers/media/pci/saa7134/saa7134-cards.c | 4 The patch should change saa7134-video.c I see an oops when removing saa7134-alsa in vanilla 3.15: [ 1741.594635] BUG: unable to handle kernel NULL pointer dereference at 000001c8 [ 1741.594789] IP: [<f8110ce0>] snd_card_free+0x20/0x50 [snd] [ 1741.594895] *pde = 00000000 [ 1741.594936] Oops: 0002 [#1] PREEMPT SMP [ 1741.595006] Modules linked in: ipt_MASQUERADE iptable_nat nf_conntrack_ipv4 nf_defrag_ipv4 nf_nat_ipv4 nf_nat nf_conntrack ip_tables w83627ehf hwmon_vid saa7134_alsa(-) tuner_simple tuner_types tuner radeon saa7134 drm_kms_helper ttm tveeprom videobuf_dma_sg videobuf_core drm v4l2_common snd_hda_codec_realtek snd_hda_codec_generic snd_hda_intel videodev snd_hda_controller i2c_piix4 snd_hda_codec i2c_algo_bit i2c_core snd_seq ohci_pci ehci_pci snd_seq_device ehci_hcd snd_pcm ohci_hcd snd_timer snd k10temp soundcore [ 1741.596110] CPU: 0 PID: 2269 Comm: rmmod Not tainted 3.15.0 #1 [ 1741.596206] Hardware name: To Be Filled By O.E.M. To Be Filled By O.E.M./M3A785GXH/128M, BIOS P1.80 04/20/2010 [ 1741.596386] task: f54e0d90 ti: ef1f6000 task.ti: ef1f6000 [ 1741.596474] EIP: 0060:[<f8110ce0>] EFLAGS: 00010282 CPU: 0 [ 1741.596571] EIP is at snd_card_free+0x20/0x50 [snd] [ 1741.596647] EAX: ef1f7f38 EBX: 00000000 ECX: f8117e94 EDX: ef1f7f3c [ 1741.596754] ESI: 00000800 EDI: 00000000 EBP: ef1f6000 ESP: ef1f7f34 [ 1741.596861] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 [ 1741.596950] CR0: 8005003b CR2: 000001c8 CR3: 2f1f0000 CR4: 000007d0 [ 1741.597056] Stack: [ 1741.597072] 00000000 f89f0000 ef1f7f3c ef1f7f3c 00000002 f89f1573 ef1f7f5c f89f1ba0 [ 1741.597242] c1085ddf 00000000 f89f1ba0 00000800 ef1f7f58 37616173 5f343331 61736c61 [ 1741.597410] 00000000 00000020 00000000 00000000 f534de00 f4125708 00000000 c15dbe70 [ 1741.597578] Call Trace: [ 1741.597612] [<f89f0000>] ? 0xf89effff [ 1741.597670] [<f89f1573>] ? saa7134_alsa_exit+0x13/0x40 [saa7134_alsa] [ 1741.597786] [<c1085ddf>] ? SyS_delete_module+0x10f/0x170 [ 1741.597879] [<c10e4248>] ? mntput_no_expire+0x8/0x120 [ 1741.597965] [<c1051526>] ? task_work_run+0x76/0xa0 [ 1741.598045] [<c13f8386>] ? syscall_call+0x7/0xb [ 1741.598115] Code: c4 10 5b 5e 5f 5d c3 8d 74 26 00 53 89 c3 b9 94 7e 11 f8 ba c1 6c 11 f8 83 ec 10 8d 44 24 04 c7 04 24 00 00 00 00 e8 10 7b f5 c8 <89> a3 c8 01 00 00 89 d8 e8 e3 fe ff ff 85 c0 89 c3 75 07 89 e0 [ 1741.598773] EIP: [<f8110ce0>] snd_card_free+0x20/0x50 [snd] SS:ESP 0068:ef1f7f34 [ 1741.598916] CR2: 00000000000001c8 [ 1741.633147] ---[ end trace 6b42b2854095019b ]--- The only changes in 3.15 for saa7134-alsa.c are in alsa_card_saa7134_create(). It's not yet in 3.15. Hopefully it will be part of a stable release of 3.15. While 3.16 contains the fix, it also converts saa7134 to the videobuf2 framework which didn't have this particular problem. I just updated to linux kernel 3.16 and the problem is not there. the error message is gone too. |