On Wed, 11 May 2005, David Brownell wrote:

> > I haven't tried it out yet, but it looks good.  One thing stuck out
> > though: Why did you remove the test that prevents new drivers from trying
> > to bind to suspended devices?
> 
> It was superfluous; they'd get errors later, probe would still
> fail cleanly.  And it seemed as if any fixes to that should sit
> a few layers up.

It probably would fail, although not quite as cleanly.  But I agree that 
fixes should go higher up (i.e., the driver core).

> > Also, I think that deadlock on dpm_sem in the PM core is now gone, so 
> > there shouldn't be any problem about unbinding drivers with no suspend 
> > method.  
> 
> I thought so too, but then I looked at the code and I see that
> device_release_driver() calls device_detach_shutdown() which
> normally calls dpm_runtime_suspend() which grabs dpm_sem; which
> is the deadlock, given it's called from a context which already
> holds that lock.   (And it all seems rather counterproductive,
> since we want to unbind the driver specifically because there
> is no suspend method!!)

I'll have to look into this more thoroughly.

> There might be a way out though:  adding a NOP shutdown method
> to the driver that usb_register() creates.  (And maybe adding
> such an entry to struct usb_driver ... so the usbcore NOP method
> only gets used for drivers that don't provide their own.)

I don't see what adding a shutdown method has to do with drivers that
don't support suspend/resume.  Anyway, the dpm_sem problem still needs to
be fixed in the PM core.

> I understand wanting to make storage handle suspend/resume;
> and it should be pretty straightforward, too.
> 
> On the other hand, having a way around that dpm_sem deadlock
> would make all drivers handle suspend "sanely" without needing
> such new code ... and it'd be a huge step towards letting us
> get rid of CONFIG_USB_SUSPEND as an option (having its updated
> guts be the default).

Agreed.

Alan Stern



-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_id=7393&alloc_id=16281&op=click
_______________________________________________
linux-usb-devel@lists.sourceforge.net
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to