Bug 73031

Summary: crash [saa7134] and [videodev] opening tvtime and xawtv
Product: v4l-dvb Reporter: Valerio Vanni (valerio.vanni)
Component: saa7134Assignee: Hans Verkuil (hverkuil)
Status: RESOLVED DUPLICATE    
Severity: normal CC: alan, daniel, hverkuil, kraxel, linux, mchehab, pavel
Priority: P1    
Hardware: i386   
OS: Linux   
See Also: https://bugzilla.kernel.org/show_bug.cgi?id=69581
https://bugzilla.kernel.org/show_bug.cgi?id=16298
Kernel Version: 3.13.6 Subsystem:
Regression: No Bisected commit-id:
Attachments: Full syslog from the boot
Full syslog from the boot Kernel 3.13.6 Debian Squeeze
Full syslog from the boot - Kernel media-tree

Description Valerio Vanni 2014-03-27 12:50:59 UTC
The testing machine is the same of
https://bugzilla.kernel.org/show_bug.cgi?id=69581
(I now have applied the patch, and suspend/resume works fine)

Now I'm on Debian Squeeze.

I discovered by chance that opening at the same time xawtv and tvtime triggers this crash (it's repeated for other CPUs).


------------[ cut here ]------------
WARNING: CPU: 3 PID: 5178 at kernel/power/qos.c:426 pm_qos_remove_request+0x27/0x85()
pm_qos_remove_request() called for unknown object
Modules linked in: vmnet(O) vsock(O) vmci(O) vmmon(O) i915 fbcon font bitblit softcursor drm_kms_helper fb fbdev cfbcopyarea video backlight cfbimgblt cfbfillrect lp bnep nfsd lockd sunrpc fuse snd_seq_dummy snd_seq_oss snd_seq_midi snd_rawmidi snd_seq_midi_event snd_seq snd_seq_device cifs rfcomm bluetooth rfkill it87 hwmon_vid isofs zlib_inflate nls_utf8 nls_iso8859_1 nls_cp850 nls_cp437 nls_ascii cpuid vfat ntfs msdos fat udf nls_iso8859_15 softdog loop saa7134_alsa tda1004x saa7134_dvb videobuf_dvb dvb_core tda827x mousedev snd_hda_codec_realtek tda8290 snd_hda_intel tuner snd_hda_codec saa7134 snd_hwdep snd_pcm_oss firewire_ohci v4l2_common snd_mixer_oss snd_pcm firewire_core videodev r8169 videobuf_dma_sg videobuf_core intel_agp snd_timer ehci_pci parport_pc uhci_hcd crc_itu_t parport intel_gtt tveeprom snd_page_alloc pcspkr evdev ehci_hcd mii rtc_cmos
CPU: 3 PID: 5178 Comm: tvtime Tainted: G        W  O 3.13.6 #1
Hardware name: Gigabyte Technology Co., Ltd. G33M-S2/G33M-S2, BIOS F7f 04/02/2008
 00000000 00000000 c1353f4a c141b4a3 c102e0e9 00000009 00000002 f32c2c80
 f51496d8 d3074400 c102e162 00000009 d3331dbc c141b4a3 d3331dd4 c105bc5f
 c141b490 000001aa c141b4a3 efc6e980 00000002 f32c2c80 f5149000 f822e38d
Call Trace:
 [<c1353f4a>] ? dump_stack+0x3e/0x54
 [<c102e0e9>] ? warn_slowpath_common+0x66/0x7a
 [<c102e162>] ? warn_slowpath_fmt+0x28/0x2c
 [<c105bc5f>] ? pm_qos_remove_request+0x27/0x85
 [<f822e38d>] ? saa7134_streamoff+0x36/0x58 [saa7134]
 [<f8127365>] ? v4l_streamoff+0x16/0x19 [videodev]
 [<f8128d30>] ? __video_do_ioctl+0x167/0x23f [videodev]
 [<c10a3cb5>] ? generic_file_buffered_write+0x18b/0x1ee
 [<f8129a86>] ? video_usercopy+0x1f0/0x27c [videodev]
 [<c10a547c>] ? __generic_file_aio_write+0x37a/0x3c5
 [<c10a553a>] ? generic_file_aio_write+0x73/0x84
 [<f8129b1c>] ? video_ioctl2+0xa/0xc [videodev]
 [<f8128bc9>] ? v4l2_ioctl_get_lock+0x44/0x44 [videodev]
 [<f81264ea>] ? v4l2_ioctl+0xb7/0xd8 [videodev]
 [<f8126433>] ? v4l2_open+0xa9/0xa9 [videodev]
 [<c10e07fc>] ? do_vfs_ioctl+0x421/0x461
 [<c11001b1>] ? fsnotify+0x1cc/0x1e7
 [<c10d547c>] ? __sb_end_write+0x1d/0x4b
 [<c10d48d4>] ? vfs_write+0x154/0x15c
 [<c10e087e>] ? SyS_ioctl+0x42/0x5a
 [<c135c47e>] ? sysenter_do_call+0x12/0x26
---[ end trace b13a4ed75b839377 ]---
------------[ cut here ]------------
Comment 1 Valerio Vanni 2014-03-27 13:01:25 UTC
Created attachment 130781 [details]
Full syslog from the boot

This is complete syslog.

The message I pasted at the start of bug report repeates many times, and at a certain point one different comes out
(this part)
------------
27/3/2014 13:29:01	newton	kernel	Workqueue: events console_callback
27/3/2014 13:29:01	newton	kernel	task: f5a6b260 ti: f4c44000 task.ti: f4c44000
27/3/2014 13:29:01	newton	kernel	EIP: 0060:[<c123e0b4>] EFLAGS: 00000002 CPU: 1
27/3/2014 13:29:01	newton	kernel	EIP is at io_serial_in+0xa/0xe
--------------

plus other ones (that I'm not able to understand)
and in the end also messages about hard disk:

--------------
27/3/2014 13:29:01	newton	kernel	ata7: lost interrupt (Status 0x58)
27/3/2014 13:29:01	newton	kernel	ata7: drained 65536 bytes to clear DRQ
27/3/2014 13:29:01	newton	kernel	ata7.01: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x6 frozen
27/3/2014 13:29:01	newton	kernel	sr 6:0:1:0: CDB: 
27/3/2014 13:29:01	newton	kernel	cdb[0]=0x4a: 4a 01 00 00 10 00 00 00 08 00
27/3/2014 13:29:01	newton	kernel	ata7.01: cmd a0/00:00:00:08:00/00:00:00:00:00/b0 tag 0 pio 16392 in
27/3/2014 13:29:01	newton	kernel	        res 40/00:02:00:08:00/00:00:00:00:00/b0 Emask 0x4 (timeout)
27/3/2014 13:29:01	newton	kernel	ata7.01: status: { DRDY }
27/3/2014 13:29:01	newton	kernel	ata7: soft resetting link
27/3/2014 13:29:01	newton	kernel	ata7.01: configured for UDMA/66
27/3/2014 13:29:01	newton	kernel	ata7: EH complete
-------------
Comment 2 Hans Verkuil 2014-03-27 13:04:29 UTC
Try this tree:

http://git.linuxtv.org/hverkuil/media_tree.git/shortlog/refs/heads/saa7134

It's just the last three patches that you need, although I am not 100% certain if they will apply cleanly to a 3.14 kernel. You might have to use this whole tree instead if they don't apply.

It's a complete rework of saa7134 that is planned to be merged for 3.16. It's likely that this will fix this crash.
Comment 3 Valerio Vanni 2014-03-27 13:09:38 UTC
Created attachment 130791 [details]
Full syslog from the boot Kernel 3.13.6 Debian Squeeze

I put it again, there was a problem of text format.
Comment 4 Valerio Vanni 2014-03-27 19:09:58 UTC
Created attachment 130861 [details]
Full syslog from the boot - Kernel media-tree

I tried with the entire tree. I made a make oldconfig with my 3.13.6 file, but it asked many questions (it seems to be rather different... in Makefile I saw it's labeled 3.1.0). I answered all the questions with default.

A good thing is that it doesn't suffer from the suspend-resume issue.
But the crash of this report happens the same. It's better than 3.13.6, because it remains in "media" (3.13.6 went beyond).

Note: xawtv is unkillable, even with "kill -9".
Comment 5 Hans Verkuil 2014-03-28 08:43:03 UTC
Now check out the saa7134 branch and try again :-)

You're using the master branch which is indeed 3.1 and two years old...
Comment 6 Valerio Vanni 2014-03-28 12:19:39 UTC
I'm not familiar with trees and branches, developement sites seem a jungle to me ;-)

I'm not able to find a "saa7134 branch". Is it an entire tree that I can git at a time? Or is something I have to mix with some other?

Have I to git this? It says "latest drivers for V4L/DVB/Remote Controller"
http://git.linuxtv.org/media_tree.git

Thank you.
Comment 7 Hans Verkuil 2014-03-28 12:25:01 UTC
Go to the git tree you checked out earlier (with the 3.1 kernel), then do:

git co -b saa7134 origin/saa7134

If you do 'git log' you should see 'saa7134: convert to vb2' as the last commit.
Comment 8 Valerio Vanni 2014-03-28 13:50:52 UTC
It stops, saying that "co" is not a git command. If it's simpler, I can try to clone the entire updated tree... but I'm not able to find it.
My best find is this page, http://git.linuxtv.org/hverkuil/media_tree.git/tree/saa7134, but I don't find any link I can give to git.
Comment 9 Hans Verkuil 2014-03-28 13:53:21 UTC
Argh, sorry. 'co' is my git alias. Use 'git checkout' instead.

I'm so used to typing 'co' that I forget that it is not a standard git command.
Comment 10 Valerio Vanni 2014-03-31 00:38:44 UTC
I've tried, this branch works :-)

The stuck window (xawtv) remains stuck, but
1) It's killable with a simple kill
2) Does not generate kernel events
3) When xawtv is stuck, other applications (i.e. kaffeine) can access the driver and see TV channels.

So it seems that what remains is something related to the xawtv application and not to the kernel module.

I've also found this report that I find very similar to mine.
https://bugzilla.kernel.org/show_bug.cgi?id=16298
This made me understand that it was not xawtv + tvtime, it's in general "xawtv + something other opèened at the same time".

And even for this report (double xawtv) the new saa7134 solves the problem, while the old crashes.
Comment 11 Hans Verkuil 2014-04-16 13:54:55 UTC
This is a duplicate bug report.

*** This bug has been marked as a duplicate of bug 73361 ***