On Tue, 1 Oct 2013, yoma sophian wrote: > hi all: > >> > >>> >> When we use "echo mem > /sys/power/state" , we didn't see any function > >>> > > >>> > "mem" is a kind of sleep, not a kind of hibernation. > >>> But I don't see any usb sleep funciton called from log > >> > >> What messages do you expect to see? > > When I try the command yesterday, I didn't plug in usb dick. :) > > I attach the log after I plug in usb stick. > from the log, I conclude calling path as below: > 1. calling dev_pm_ops > 2. calling interface driver's suspend > 3. calling usb device's suspend. That's right. > My questions are: > 1. in dev_pm_ops, we use same function, usb_suspend, but different > pm_message to tell different kind of power management. Yes. > 2. but in usb device's suspend, generic_suspend, different pm_message > seems has the same effect. Not true. generic_suspend() does this: /* Non-root devices don't need to do anything for FREEZE or PRETHAW */ else if (msg.event == PM_EVENT_FREEZE || msg.event == PM_EVENT_PRETHAW) rc = 0; else rc = usb_port_suspend(udev, msg); The FREEZE and PRETHAW events are treated differently from the others. > 3. is there any platform apis in generic_suspend for us to register > when we try to handle hw's specific behavior during hibernate/restore? No. What specific behavior do you want to handle? Alan Stern -- 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