All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antti Palosaari <crope@iki.fi>
To: Marko Ristola <marko.ristola@kolumbus.fi>
Cc: linux-media <linux-media@vger.kernel.org>, htl10@users.sourceforge.net
Subject: Re: DVB core enhancements - comments please?
Date: Sat, 21 Jul 2012 19:36:25 +0300	[thread overview]
Message-ID: <500ADA89.6090508@iki.fi> (raw)
In-Reply-To: <4FF32A2B.7010607@kolumbus.fi>

Morjens!

I am now working with that suspend/resume/power-management, as I got LNA 
issues resolved.

On 07/03/2012 08:21 PM, Marko Ristola wrote:
>
> Moikka Antti.
>
>
> On 07/01/2012 02:11 PM, Antti Palosaari wrote:
>> Moikka Marko,
>>
> -- snip --
>>
>> Hmm, I did some initial suspend / resume changes for DVB USB when I
>> rewrote it recently. On suspend, it just kills all ongoing urbs used
>> for streaming. And on resume it resubmit those urbs in order to resume
>> streaming. It just works as it doesn't hang computer anymore. What I
>> tested applications continued to show same television channels on resume.
>>
>> The problem for that solution is that it does not have any power
>> management as power management is DVB-core responsibility. So it
>> continues eating current because chips are not put sleep and due to
>> that those DVB-core changes are required.
>
> I think that runtime (RT) frontend power saving is a different thing.
> It isn't necessarily suspend/resume thing.

Yes it is different thing (DVB-core runtime power-management). But as 
there is currently implemented .init() and .sleep() callbacks both 
frontend and tuner for power management I don't see why not to use those 
for suspend and resume too.

> I implemented runtime Frontend power saving in 2007 on that patch I
> referenced.
> I used dvb-core's existing functionality. Maybe this concept is
> applicable for you too.
>
> I added into Mantis bridge device initialization following functions:
> +                       mantis->fe->ops.tuner_ops.sleep =
> mantis_dvb_tuner_sleep;
> +                       mantis->fe->ops.tuner_ops.init =
> mantis_dvb_tuner_init;
> tuner_ops.{sleep,init} modification had to be the last one.
>
> I maintained in mantis->has_power the frontend's power status.
> Maybe I could have read the active status from PCI context too.
>
> The concept was something like:
> - dvb-core has responsibility to call tuner_ops.sleep() and
> tuner_ops.init() when applicable.
> - Mantis PCI Bridge driver (or specific USB driver) has responsibility
>    to provide sleep and init implementations for the specific device.
> - Mantis bridge device will do the whole task of frontend power
> management, by calling Frontend's
>    tear down / initialization functions when necessary.

I looked it and reads your discussion too. That code seem never ended up 
for Mantis.

But the idea is just basically same: use existing sleep() calls to put 
device sleep on suspend and on resume use init() to wake-up again. You 
stored existing parameters inside driver state and retuned using those 
when set_frontend() get NULL as a parameter. Things has changed a little 
after that and now those parameters are stored already in dvb-frontend 
cache - which means a little less work for driver.

>>> - What changes encrypted channels need?
>>
>> I think none?



So after all, what I think currently, is:
* bridge sets and forwards .suspend() callback to dvb-core
* bridge sets and forwards .resume() callback to dvb-core
* on suspend, dvb-core puts device sleep
* on resume, dvb-core wake-ups device and inits tune (parameters are in 
cache already)

Clearly, put hardware sleep similarly as in case frontend is in sleep, 
but keep userland interface alive (frontend, demux, etc).


There is a quite lot of documentation to learn and overall whole Kernel 
power-managent is very complex. Fortunately driver implementation is 
very simple most cases. Also as changing DVB-core is needed it should be 
extremely care not make any regressions.

regards
Antti

-- 
http://palosaari.fi/



  reply	other threads:[~2012-07-21 16:36 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-28  0:33 DVB core enhancements - comments please? Antti Palosaari
2012-06-29  4:32 ` Mauro Carvalho Chehab
2012-06-29  5:03   ` Antti Palosaari
2012-06-29 11:24     ` Patrick Boettcher
2012-06-29 13:07       ` Antti Palosaari
2012-06-29 14:21       ` Patrick Boettcher
2012-06-29 14:28       ` Mauro Carvalho Chehab
2012-07-02 21:27         ` Antti Palosaari
2012-07-03 16:25           ` Mauro Carvalho Chehab
2012-07-03 16:50             ` Hin-Tak Leung
2012-07-03 19:54             ` Mauro Carvalho Chehab
2012-06-29 12:02     ` Mauro Carvalho Chehab
2012-06-29 12:55       ` Antti Palosaari
2012-06-30  9:44 ` Marko Ristola
2012-07-01 11:11   ` Antti Palosaari
2012-07-03 17:21     ` Marko Ristola
2012-07-21 16:36       ` Antti Palosaari [this message]
2012-07-25 10:38         ` Antti Palosaari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=500ADA89.6090508@iki.fi \
    --to=crope@iki.fi \
    --cc=htl10@users.sourceforge.net \
    --cc=linux-media@vger.kernel.org \
    --cc=marko.ristola@kolumbus.fi \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.