[linux-dvb] Suspend/Resume support for budget-av

Oliver Endriss o.endriss at gmx.de
Sun Aug 12 14:42:33 CEST 2007


Julian Scheel wrote:
> Oliver Endriss schrieb:
> > Julian Scheel wrote:
> >   
> >> Attached is a patch with adds full support for suspend/resume in budget-av. 
> >> Actually only the CI interface needs to be reinitialised as all the tuner 
> >> stuff gets reinitialised at the next tuning-process anyway.
> >> So this patch should be ready to go pretty straightforward into head.
> >>     
> >
> > Please post the sub-system ids of the cards you tested and which power
> > states you tested.
> >   
> Going to look up the IDs later, when I have access to my dev-system.
> But it should be all current KNC DVB-C and DVB-S cards.
> >> diff -r c45e373bbca3 linux/drivers/media/common/saa7146_core.c
> >> --- a/linux/drivers/media/common/saa7146_core.c Sat Jul 28 00:06:44 2007 -0300
> >> +++ b/linux/drivers/media/common/saa7146_core.c Tue Aug 07 23:22:54 2007 +0200
> >> @@ -515,6 +515,28 @@ static void saa7146_remove_one(struct pc
> >>         saa7146_num--;
> >>  }
> >>
> >> +static int saa7146_suspend(struct pci_dev *pdev)
> >> +{
> >> +       struct saa7146_dev* dev = pci_get_drvdata(pdev);
> >> +       DEB_EE(("dev:%p\n",dev));
> >> +       int err;
> >> +
> >> +       err = dev->ext->suspend(dev);
> >>     
> >           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> > Causes an oops if the card driver did not set the suspend hook.
> >
> > Fix:
> > 	int err = -EBUSY;
> > 	if (dev->ext->suspend)
> > 		err = dev->ext->suspend(dev);
> >   
> Agreed (c:
> >> +
> >> +       return err;
> >> +}
> >> +
> >> +static int saa7146_resume(struct pci_dev *pdev)
> >> +{
> >> +       struct saa7146_dev* dev = pci_get_drvdata(pdev);
> >> +       DEB_EE(("dev:%p\n",dev));
> >> +       int err;
> >> +
> >> +       err = dev->ext->resume(dev);
> >>     
> >
> > ditto
> >
> > IMO this patch can only work with S1 state. Higher states turn off PCI
> > power and require re-initialization of saa7146, demod, tuner etc.
> > See other drivers which fully implement suspend/resume.
> >   
> Works perfectly fine with S3-state for me. Actually S3 always worked 
> fine, only ci interface did not work anymore after S3, that is fixed 
> with this patch.

Hm, I did some tests with budget.c:
- "echo standby > /sys/power/state" works
- "echo mem > /sys/power/state" does not work!
- "echo disk > /sys/power/state" does not work!

It works if the PCI bus stays 'on', i.e. the card is not powered-off.
So there is much more to be done if we want to support power states
properly.

Btw, could you test if the CI works without reinitialisation if you
apply the attached patch? I can't test it. Without this patch the kernel
thread will die and the CI does not work anymore...

CU
Oliver

-- 
----------------------------------------------------------------
VDR Remote Plugin 0.3.9: http://www.escape-edv.de/endriss/vdr/
----------------------------------------------------------------
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dvb_ca_en50221_suspend.diff
Type: text/x-diff
Size: 1126 bytes
Desc: not available
Url : http://www.linuxtv.org/pipermail/linux-dvb/attachments/20070812/781c5a94/attachment.diff 


More information about the linux-dvb mailing list