From patchwork Sat Mar 27 22:04:58 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthieu Castet X-Patchwork-Id: 88714 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o2RM4rjk001433 for ; Sat, 27 Mar 2010 22:04:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754062Ab0C0WEu (ORCPT ); Sat, 27 Mar 2010 18:04:50 -0400 Received: from smtp2-g21.free.fr ([212.27.42.2]:53796 "EHLO smtp2-g21.free.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754083Ab0C0WEt (ORCPT ); Sat, 27 Mar 2010 18:04:49 -0400 Received: from smtp2-g21.free.fr (localhost [127.0.0.1]) by smtp2-g21.free.fr (Postfix) with ESMTP id 1EA114B0045 for ; Sat, 27 Mar 2010 23:04:43 +0100 (CET) Received: from [192.168.1.234] (cac94-1-81-57-151-96.fbx.proxad.net [81.57.151.96]) by smtp2-g21.free.fr (Postfix) with ESMTP id 209844B00D9 for ; Sat, 27 Mar 2010 23:04:41 +0100 (CET) Message-ID: <4BAE810A.6030405@free.fr> Date: Sat, 27 Mar 2010 23:04:58 +0100 From: matthieu castet User-Agent: Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.8.1.23) Gecko/20090823 SeaMonkey/1.1.18 MIME-Version: 1.0 To: linux-media@vger.kernel.org Subject: [PATCH] fix dvb frontend lockup References: <4BA603AB.6070809@free.fr> In-Reply-To: <4BA603AB.6070809@free.fr> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Sat, 27 Mar 2010 22:04:54 +0000 (UTC) --- 1/linux/drivers/media/dvb/dvb-core/dvb_frontend.c 2010-03-27 22:59:50.000000000 +0100 +++ 2/linux/drivers/media/dvb/dvb-core/dvb_frontend.c 2010-03-27 23:01:34.000000000 +0100 @@ -686,7 +686,10 @@ } fepriv->thread = NULL; - fepriv->exit = 0; + if (kthread_should_stop()) + fepriv->exit = 2; + else + fepriv->exit = 0; mb(); dvb_frontend_wakeup(fe); @@ -1929,6 +1932,8 @@ int ret; dprintk ("%s\n", __func__); + if (fepriv->exit == 2) + return -ENODEV; if (adapter->mfe_shared) { mutex_lock (&adapter->mfe_lock); @@ -2021,7 +2026,7 @@ ret = dvb_generic_release (inode, file); if (dvbdev->users == -1) { - if (fepriv->exit == 1) { + if (fepriv->exit) { fops_put(file->f_op); file->f_op = NULL; wake_up(&dvbdev->wait_queue);