Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 27 Sep 2012 20:51:23 +0200
From:      Juergen Lock <nox@jelal.kn-bremen.de>
To:        Hans Petter Selasky <hselasky@c2i.net>
Cc:        freebsd-multimedia@freebsd.org, Juergen Lock <nox@jelal.kn-bremen.de>
Subject:   Re: In case mythtv setup is broken for you too...
Message-ID:  <20120927185123.GB6608@triton8.kn-bremen.de>
In-Reply-To: <201209270738.36691.hselasky@c2i.net>
References:  <20120812154930.GA23878@triton8.kn-bremen.de> <20120926200656.GA60363@triton8.kn-bremen.de> <201209270738.36691.hselasky@c2i.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Sep 27, 2012 at 07:38:36AM +0200, Hans Petter Selasky wrote:
> On Wednesday 26 September 2012 22:06:56 Juergen Lock wrote:
> > On Sun, Aug 12, 2012 at 05:49:30PM +0200, Juergen Lock wrote:
> > > Hi!
> > > 
> > >  (I guess I should post here too :)
> > >  
> > >  If mythtv setup is broken for you reporting a failed FE_GET_INFO ioctl
> > > 
> > > like reported in this mythtv ticket:
> > > 	http://code.mythtv.org/trac/ticket/10830
> > > 
> > > (reduced testcase:
> > > 	http://people.freebsd.org/~nox/tmp/ioctltst.c
> > > 
> > > ) try this media tree patch I posted a little while ago: (i.e. apply it
> > > to webcamd, there's a Download patch link at the top)
> > > 
> > > 	http://patchwork.linuxtv.org/patch/13563/
> > > 	
> > >  The full thread in case you want to help testing/reviewing the patch
> > > 
> > > for upstream Linux:
> > > 	http://thread.gmane.org/gmane.linux.drivers.video-input-
> infrastructure/5
> > > 	1644
> > 
> > The patch needed a small tweak for webcamd 3.7.0.3, maybe we should
> > add it to EXTRA_PATCHES as an OPTION?
> > 
> > --- media_tree/drivers/media/dvb-core/dvb_frontend.c.orig
> > +++ media_tree/drivers/media/dvb-core/dvb_frontend.c
> > @@ -603,6 +603,7 @@ static int dvb_frontend_thread(void *dat
> >  	enum dvbfe_algo algo;
> > 
> >  	bool re_tune = false;
> > +	bool semheld = false;
> > 
> >  	dev_dbg(fe->dvb->device, "%s:\n", __func__);
> > 
> > @@ -626,6 +627,8 @@ restart:
> > 
> >  		if (kthread_should_stop() || dvb_frontend_is_exiting(fe)) {
> >  			/* got signal or quitting */
> > +			if (!down_interruptible (&fepriv->sem))
> > +				semheld = true;
> >  			fepriv->exit = DVB_FE_NORMAL_EXIT;
> >  			break;
> >  		}
> > @@ -741,6 +744,8 @@ restart:
> >  		fepriv->exit = DVB_FE_NO_EXIT;
> >  	mb();
> > 
> > +	if (semheld)
> > +		up(&fepriv->sem);
> >  	dvb_frontend_wakeup(fe);
> >  	return 0;
> >  }
> > @@ -1819,16 +1824,20 @@ static int dvb_frontend_ioctl(struct fil
> >  	int err = -ENOTTY;
> > 
> >  	dev_dbg(fe->dvb->device, "%s: (%d)\n", __func__, _IOC_NR(cmd));
> > -	if (fepriv->exit != DVB_FE_NO_EXIT)
> > +	if (down_interruptible (&fepriv->sem))
> > +		return -ERESTARTSYS;
> > +
> > +	if (fepriv->exit != DVB_FE_NO_EXIT) {
> > +		up(&fepriv->sem);
> >  		return -ENODEV;
> > +	}
> > 
> >  	if ((file->f_flags & O_ACCMODE) == O_RDONLY &&
> >  	    (_IOC_DIR(cmd) != _IOC_READ || cmd == FE_GET_EVENT ||
> > -	     cmd == FE_DISEQC_RECV_SLAVE_REPLY))
> > +	     cmd == FE_DISEQC_RECV_SLAVE_REPLY)) {
> > +		up(&fepriv->sem);
> >  		return -EPERM;
> > -
> > -	if (down_interruptible (&fepriv->sem))
> > -		return -ERESTARTSYS;
> > +	}
> > 
> >  	if ((cmd == FE_SET_PROPERTY) || (cmd == FE_GET_PROPERTY))
> >  		err = dvb_frontend_ioctl_properties(file, cmd, parg);
> 
> Why are the media developers not taking this patch into the repo?

I'm not sure but maybe they are still not 100% convinced it doesn't
have unwanted side effects or something like that?  Or they
are just reluctant to change such an important piece of code?

 But I'm mostly guessing there, for us at least the patch works...
	Juergen



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120927185123.GB6608>