[linux-dvb] [patch/rfc] frontend powermanagement

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Stezenbach <js@xxxxxxxxxxx> writes:

> Gerd Knorr wrote:
> > +void dvb_suspend_frontend(struct dvb_frontend* fe)
> > +{
> > +	if (fe->ops->sleep)
> > +		fe->ops->sleep(fe);
> > +}
> 
> Does the PM core allow us to call this after the dvb_frontend_thread
> has been put in the refridgerator? If not we might have to
> add a FESTATE_FREEZER.

I'm pretty sure the processes and also the kernel threads are already
frozen at that point, will double-check when actually testing that
stuff through.

> I also see the follwoing:
>                 if (dvb_powerdown_on_sleep)
>                         if (fe->ops->set_voltage)
>                                 fe->ops->set_voltage(fe, SEC_VOLTAGE_OFF);
> 
> You might wat to add this to dvb_suspend_frontend() (and maybe call
> dvb_suspend_frontend() then from the dvb_frontend_thread()).

Calling from the thread isn't an option I think (see above).

> One problem is of course that it won't work with DiSEqC (the app
> would have to resend the DiSEqC sequence after wakeup; since DiSEqC
> sequences can be arbitrarily complex the drivers make no effort to
> remember them for automatic re-send.)

Good point.  Hmm.

> We could add a flag to enum fe_status to signal this condition to
> the app after wakeup.

Yes, one possible way to handle that.  I'd check whenever some generic
thing exists to inform apps about suspend/resume before actually
adding that.

> Or we don't power down the LNB, but that's lousy power management then.

It would't help anyway, at least for the suspend-to-disk case where
the whole machine will be powered off ;)

> > +	if (fe->ops->init)
> > +		fe->ops->init(fe);
> 
> dvb_frontend_init();

Ok.

> > +	fepriv->state = FESTATE_RETUNE;
> > +	dvb_frontend_wakeup(fe);
> > +	dvb_frontend_add_event (fe, 0);	    
> > +	fepriv->status = 0;
> 
> I see this is the same sequence as in FE_SET_FRONTEND,

Yes, there I've taken it from ;)

> I wonder if it should be (in both places):
> 
> 	fepriv->state = FESTATE_RETUNE;
> 	fepriv->status = 0;
> 	dvb_frontend_add_event (fe, 0);
> 	dvb_frontend_wakeup(fe);
> 
> since dvb_frontend_thread() can change fepriv->status and generate
> events after wakeup.

Maybe also move that into a small helper function called from both
places then?

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)



[Index of Archives]     [Linux Media]     [Video 4 Linux]     [Asterisk]     [Samba]     [Xorg]     [Xfree86]     [Linux USB]

  Powered by Linux