Message ID | 20160916100028.8856-1-andrey_utkin@fastmail.com (mailing list archive) |
---|---|
State | Superseded, archived |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from <linux-media-owner@vger.kernel.org>) id 1bkpxj-0000Xo-7E; Fri, 16 Sep 2016 10:01:39 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.84_2/mailfrontend-8) with esmtp id 1bkpxh-00040b-jy; Fri, 16 Sep 2016 12:01:39 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753002AbcIPKBW (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Fri, 16 Sep 2016 06:01:22 -0400 Received: from out2-smtp.messagingengine.com ([66.111.4.26]:49551 "EHLO out2-smtp.messagingengine.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757933AbcIPKBP (ORCPT <rfc822;linux-media@vger.kernel.org>); Fri, 16 Sep 2016 06:01:15 -0400 Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 6E8002069A; Fri, 16 Sep 2016 06:01:13 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute7.internal (MEProxy); Fri, 16 Sep 2016 06:01:13 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.com; h=cc :date:from:in-reply-to:message-id:references:subject:to :x-sasl-enc:x-sasl-enc; s=mesmtp; bh=svT/7llN9HblchkaqBcwBXHnK/I =; b=zyLeIOyRMwT0bUEvn3t9yGEwQPlIVmJJSO58dbv3u+MxJAThRqDZz3JN1/5 PB/GE1P5A2HCfduk50LZAL3HBeVAdm5F4AxlQBdZeHzFcgMSgumooiPzL9lWizvh HN8PGJg5XFnKHG9aJz3w730tT/sgyggzD0qTg3pSHNbdRkyI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-sasl-enc:x-sasl-enc; s=smtpout; bh=svT/ 7llN9HblchkaqBcwBXHnK/I=; b=Zs3ggL3GCdPis4pAvvhWM8qHvCLPOSvNimKW YhaI0mLmq0xz2Pe9WKj1gkx90scfHUbJRTE61zhP+QG9ga5iQtHFOY7Ot4/cObDw B1+EYM5h69A9VfHIGzmSd65CewF9h8OQlAkTV+wc+ME6tI4Msncp7QeZVLFqHefg vH0jp78= X-Sasl-enc: wD3KfVuf5IKp+AKHF/wnSaQ9OLhYMuOH3XAx1gAG01Ct 1474020072 Received: from localhost.localdomain (unknown [91.198.4.228]) by mail.messagingengine.com (Postfix) with ESMTPA id 71A17CCE9F; Fri, 16 Sep 2016 06:01:12 -0400 (EDT) From: Andrey Utkin <andrey_utkin@fastmail.com> To: linux-media@vger.kernel.org, pmhahn+video@pmhahn.de Cc: hverkuil@xs4all.nl, Andrey Utkin <andrey_utkin@fastmail.com> Subject: [PATCH] Potential fix for "[BUG] process stuck when closing saa7146 [dvb_ttpci]" Date: Fri, 16 Sep 2016 13:00:28 +0300 Message-Id: <20160916100028.8856-1-andrey_utkin@fastmail.com> X-Mailer: git-send-email 2.9.2 In-Reply-To: <20160911133317.whw3j2pok4sktkeo@pmhahn.de> References: <20160911133317.whw3j2pok4sktkeo@pmhahn.de> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2016.9.16.95417 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1200_1299 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, DKIM_SIGNATURE 0, IN_REP_TO 0, LEGITIMATE_NEGATE 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, NO_URI_HTTPS 0, REFERENCES 0, SINGLE_URI_IN_BODY 0, URI_ENDS_IN_HTML 0, __ANY_URI 0, __CC_NAME 0, __CC_NAME_DIFF_FROM_ACC 0, __CC_REAL_NAMES 0, __CP_MEDIA_BODY 0, __CP_URI_IN_BODY 0, __DATE_TZ_RU 0, __FRAUD_WEBMAIL 0, __FRAUD_WEBMAIL_FROM 0, __FROM_DOMAIN_IN_ANY_CC2 0, __FROM_DOMAIN_IN_RCPT 0, __HAS_CC_HDR 0, __HAS_FROM 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __PHISH_SPEAR_STRUCTURE_1 0, __REFERENCES 0, __SANE_MSGID 0, __SINGLE_URI_TEXT 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_IN_BODY 0, __URI_NO_WWW 0, __URI_NS , __URI_WITH_PATH 0' |
Commit Message
Andrey Utkin
Sept. 16, 2016, 10 a.m. UTC
Hi Philipp, Please try this patch. It is purely speculative as I don't have the hardware, but I hope my approach is right. --- drivers/media/common/saa7146/saa7146_video.c | 4 ++++ 1 file changed, 4 insertions(+)
Comments
Hello Andrey, Am 16.09.2016 um 12:00 schrieb Andrey Utkin: > Please try this patch. It is purely speculative as I don't have the hardware, > but I hope my approach is right. Thanks you for the patch; I've built a new kernel but didn't have the time to test it yet; I'll mail you again as soon as I have tested it. Thanks you for looking into that issues. Philipp -- To unsubscribe from this list: send the line "unsubscribe linux-media" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Hello Andrey, On Mon, Sep 19, 2016 at 07:08:52AM +0200, Philipp Hahn wrote: > Am 16.09.2016 um 12:00 schrieb Andrey Utkin: > > Please try this patch. It is purely speculative as I don't have the hardware, > > but I hope my approach is right. > > Thanks you for the patch; I've built a new kernel but didn't have the > time to test it yet; I'll mail you again as soon as I have tested it. I tested your patch and during my limites testing I wan't able to reproduce the previous problem. Seems you fixed it. Tested-by: Philipp Matthias Hahn <pmhahn@pmhahn.de> Thanks you again for looking into that issues. Philipp
Hello Andrey, On Sun, Oct 16, 2016 at 11:52:19PM +0200, Philipp Matthias Hahn wrote: > On Mon, Sep 19, 2016 at 07:08:52AM +0200, Philipp Hahn wrote: > > Am 16.09.2016 um 12:00 schrieb Andrey Utkin: > > > Please try this patch. It is purely speculative as I don't have the hardware, > > > but I hope my approach is right. > > > > Thanks you for the patch; I've built a new kernel but didn't have the > > time to test it yet; I'll mail you again as soon as I have tested it. > > I tested your patch and during my limites testing I wan't able to > reproduce the previous problem. Seems you fixed it. > > Tested-by: Philipp Matthias Hahn <pmhahn@pmhahn.de> > > Thanks you again for looking into that issues. Bad news: I'm running linux-4.15.2 by now and again got a stuck ffmpeg process after accessing /dev/video0: | INFO: task read_thread:20579 blocked for more than 120 seconds. | Tainted: P O 4.15.2 #1 | "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. | read_thread D 0 20579 2949 0x80000000 | Call Trace: | ? __schedule+0x646/0x697 | schedule+0x79/0x94 | videobuf_waiton+0x11c/0x148 [videobuf_core] | ? wait_woken+0x68/0x68 | saa7146_dma_free+0x34/0x55 [saa7146_vv] | buffer_release+0x25/0x33 [saa7146_vv] | videobuf_vm_close+0xd6/0x103 [videobuf_dma_sg] | remove_vma+0x23/0x49 | exit_mmap+0xea/0x114 | mmput+0x45/0xdb | do_exit+0x3a0/0x8c1 | do_group_exit+0x95/0x95 | get_signal+0x41c/0x447 | do_signal+0x1e/0x4c2 | ? __schedule+0x646/0x697 | ? do_task_dead+0x38/0x3a | ? SyS_futex+0x127/0x137 | exit_to_usermode_loop+0x1f/0x69 | do_syscall_64+0xe3/0xea | entry_SYSCALL_64_after_hwframe+0x21/0x86 | RIP: 0033:0x7f56429927fd | RSP: 002b:00007f56217b3550 EFLAGS: 00000246 ORIG_RAX: 00000000000000ca | RAX: fffffffffffffe00 RBX: 00007f5608002320 RCX: 00007f56429927fd | RDX: 0000000000000000 RSI: 0000000000000080 RDI: 00007f560800234c | RBP: 0000000000000000 R08: 0000000000000000 R09: 00007f5608002320 | R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000003 | R13: 00007f56080022f8 R14: 0000000000000000 R15: 00007f560800234c Your previous patch is applied since v4.10-rc1~71^2^2~34 , so the issue seems to be not fixed. The tainting is from the NVidia driver. Philipp
diff --git a/drivers/media/common/saa7146/saa7146_video.c b/drivers/media/common/saa7146/saa7146_video.c index ea2f3bf..93c64f0 100644 --- a/drivers/media/common/saa7146/saa7146_video.c +++ b/drivers/media/common/saa7146/saa7146_video.c @@ -390,6 +390,7 @@ static int video_end(struct saa7146_fh *fh, struct file *file) { struct saa7146_dev *dev = fh->dev; struct saa7146_vv *vv = dev->vv_data; + struct saa7146_dmaqueue *q = &vv->video_dmaq; struct saa7146_format *fmt = NULL; unsigned long flags; unsigned int resource; @@ -428,6 +429,9 @@ static int video_end(struct saa7146_fh *fh, struct file *file) /* shut down all used video dma transfers */ saa7146_write(dev, MC1, dmas); + if(q->curr) + saa7146_buffer_finish(dev, q, VIDEOBUF_DONE); + spin_unlock_irqrestore(&dev->slock, flags); vv->video_fh = NULL;