Re: Autosuspending devices that seem to need reset_resume

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

 



On Mon, Jun 08, 2009 at 05:19:31PM -0400, Alan Stern wrote:

> This looks rather strange.  Are you sure you don't mean "|=" instead of 
> "&="?  Anyway, this code doesn't belong here.  The reset_resume routine 
> is supposed to do whatever is necessary to restore any device state 
> that was lost when the device was reset.

Yes, that would explain some of my confusion. Sometimes I swear I 
shouldn't be let near a computer.

> > Secondly, is there a 
> > better way to do this in the first place?
> 
> Better way to do what?  Indicate that the device should always get a 
> reset-resume?  No; see above.

If I indicate it needs a reset-resume then it doesn't seem to actually 
be reset unless I add the needs_binding option in the reset_resume 
callback, which strikes me as being absolutely the wrong thing to do.

> >  I've got no documentation for 
> > the card, but there's no relevant state kept when there isn't an open 
> > interface.
> 
> But what about when there _is_ an open interface?  The reset_resume 
> method has to handle all cases.

When system suspend takes place it reboots itself and appears as a 
different USB ID, so there's no hope of restoring state. The remaining 
case would presumably be one where userspace forces a suspend despite 
the device being open? I'm not sure how to handle that.

It's possible that this is unnecessary in the first place and I'm 
working around some other problem. With vanilla code, if I echo 
"suspended" to power/level and then echo "on" to it, the device works. 
If I echo "auto" to it and leave it to suspend, then it stops working 
until I switch it back to "on", even if I don't explicitly reset it. I'm 
not sure why this makes a difference.

-- 
Matthew Garrett | mjg59@xxxxxxxxxxxxx
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux