[pvrusb2] pvrusb2 and suspend.

xavier.gnata@free.fr xavier.gnata at free.fr
Wed Aug 16 10:08:52 CDT 2006


Quoting Mike Isely <isely at isely.net>:

> On Wed, 16 Aug 2006, xavier.gnata at free.fr wrote:
>
> > Well, I think you can do the same job (for suspend) as when the cable is
> > unpluged during the streaming. In this case, we close all the stuff
> correctly
> > don't we?
> > Xavier
> >
>
> "We"

you and your code ;)

 don't close everything.  The application does.  When the cable is
> pulled, the driver disassociates itself from the USB port and tears down
> any internal connectivity it has with the port.  However, all other
> connections (i.e. open file handles) are still present - and can't go away
> until the referencing entit(ies) close these down.

Arg I should sepnd time to read this part of your code again...sorry.

 What happens in
> reality is that the next time the application tries to do something to the
> device it will get an error in response - since the hardware is now gone.
> Then the application is supposed to close its connection.  If the app was
> blocked on a read when the cable is pulled, then the read() will be
> satisfied with an error.  If an I2C chip-driver module (e.g. tuner.ko,
> msp3400.ko, etc) tries to issue an I2C transaction then the transaction
> will fail.  The pvrusb2 driver at the moment won't disconnect those
> modules, but as soon as the last file handle is shut, then the driver will
> tear down all the rest of its internal state, which will cause the I2C
> adapter to tear down and then the modules will be forced out.

ok.

> On a suspend obviously we can treat it like the cable was pulled.  But it
> is not clear to me what has to happen on the other side of the driver.
> I'm just not very up-to-speed on how suspend is supposed to work.

grep suspend * in linux-2.6.17.8/drivers/media do not give a lot of results :(
It shows that msp3400-driver.c only reset the chip at suspend time...
I don't think you are suppose to take care on the other side of the driver
because but I may be wrong (of course, suspend documentation is not that clear
(it is a kernel API documentation...))

Ok suspend in pvrusb2 is not that usefull. Ok it can work putting pvrusb2 in the
 suspend blacklist but it would be great to see .suspend/.resume implemented in
every revelant drivers.

Xavier.


More information about the pvrusb2 mailing list