Re: how to trigger function in usb_device_pm_ops

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

 



On Mon, 7 Oct 2013, yoma sophian wrote:

> >> 1. When will platform register dev_pm_ops be called? Is it called
> >> before or after usb_device_pm_ops ?
> >
> > The platform suspend routine is called after the USB suspend routine.
> > The platform resume routine is called before the USB resume routine.
> I found some driver register
> a. platform_driver->suspend/resume
> instead of
> b. platform_driver->driver->pm->suspend/resume
> 
> is there any difference between above a) and b)?

platform_driver->suspend/resume is deprecated.  You should use 
driver->pm->suspend/resume for new code.

> > However, xHCI is fundamentally different from EHCI.  A single xHCI
> > controller manages two physically independent buses: a SuperSpeed bus
> > and a full/low/high-speed bus.  An EHCI controller, on the other hand,
> > manages only one bus.  Therefore the drivers need to be somewhat
> > different.
> Is that the reason why we register 2 HCDs in xhci driver?

Yes, it is.

> if so, how driver decide to use which hcd when Super/Non-Super speed
> devices plug in?

Simple: When a SuperSpeed device plugs in, the driver uses the 
SuperSpeed hcd.  When a non-SuperSpeed device plugs in, the driver uses 
the non-SuperSpeed hcd.  :-)

> If we are doing hibernate for example, why we still need to put
> bus/controller suspend?
> it should be fine if we just reset it and re-initialize it when
> hibernate happen.
> After all, OS is power down in hibernate, right?

Remember, it's possible that the hibernate transition might fail.  If 
it does fail, we want the controller to return to the same state it had 
before, not to be reset.

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




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

  Powered by Linux