From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from smtp101.biz.mail.mud.yahoo.com ([68.142.200.236]) by www.linuxtv.org with smtp (Exim 4.63) (envelope-from ) id 1LXoex-0000AL-Ll for linux-dvb@linuxtv.org; Fri, 13 Feb 2009 04:24:12 +0100 Message-ID: <4994E795.6030700@telegentsystems.com> Date: Fri, 13 Feb 2009 11:23:01 +0800 From: Zhang Xiaobing MIME-Version: 1.0 To: linux-dvb@linuxtv.org Subject: [linux-dvb] A dvb-core code problem Reply-To: linux-media@vger.kernel.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============1383362058==" Mime-version: 1.0 Sender: linux-dvb-bounces@linuxtv.org Errors-To: linux-dvb-bounces+mchehab=infradead.org@linuxtv.org List-ID: This is a multi-part message in MIME format. --===============1383362058== Content-Type: multipart/alternative; boundary="------------000502000301090107030101" This is a multi-part message in MIME format. --------------000502000301090107030101 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I found a code problem in dvb-core when I was debugging with my dvb driver. The code in dvb_dvr_release() file dmxdev.c /* TODO */ dvbdev->users--; if(*dvbdev->users== -1* && dmxdev->exit==1) { fops_put(file->f_op); file->f_op = NULL; mutex_unlock(&dmxdev->mutex); "dvbdev->users== -1" should be changed to "dvbdev->users== 1", otherwise driver may block forever in dvb_dmxdev_release() where a wakeup condition is "dvbdev->users== 1". Here is the code in dvb_dmxdev_release(). if (dmxdev->dvr_dvbdev->users > 1) { wait_event(dmxdev->dvr_dvbdev->wait_queue, *dmxdev->dvr_dvbdev->users==1*); } I hope it is right to post this message here. -- Xiaobing Zhang --------------000502000301090107030101 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I found a code problem in dvb-core when I was debugging with my dvb driver.

The code in dvb_dvr_release() file dmxdev.c
/* TODO */
    dvbdev->users--;
    if(dvbdev->users== -1 && dmxdev->exit==1) {
        fops_put(file->f_op);
        file->f_op = NULL;
        mutex_unlock(&dmxdev->mutex);

"dvbdev->users== -1" should be changed to "dvbdev->users== 1", otherwise driver may block forever in dvb_dmxdev_release() where a wakeup condition is "dvbdev->users== 1".

Here is the code in dvb_dmxdev_release().

if (dmxdev->dvr_dvbdev->users > 1) {
        wait_event(dmxdev->dvr_dvbdev->wait_queue,
                dmxdev->dvr_dvbdev->users==1);
}

I hope it is right to post this message here.

--

Xiaobing Zhang

--------------000502000301090107030101-- --===============1383362058== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-dvb users mailing list For V4L/DVB development, please use instead linux-media@vger.kernel.org linux-dvb@linuxtv.org http://www.linuxtv.org/cgi-bin/mailman/listinfo/linux-dvb --===============1383362058==--