All of lore.kernel.org
 help / color / mirror / Atom feed
* generic power management for USB subsystem similar to PCI one?
@ 2020-07-21 15:53 Vaibhav Gupta
  2020-07-21 16:27 ` Alan Stern
  0 siblings, 1 reply; 2+ messages in thread
From: Vaibhav Gupta @ 2020-07-21 15:53 UTC (permalink / raw)
  To: Alan Stern
  Cc: Bjorn Helgaas, Bjorn Helgaas, Bjorn Helgaas, linux-usb,
	Rafael J. Wysocki

Hello,
Currently I am working on removing legacy power management .suspend() and
.resume() callbacks from PCI subsystem. The updates aim to give power management
control to PCI core and let drivers do the only device-specific jobs without
using any PCI helper functions.

I was wondering if similar changes can be applied to the USB subsystem?
I explored and found that .suspend() in USB drivers also accept the pm_message_t
type argument.
Also, .suspend() and .resume() in usb drivers, accept "struct usb_interface *"
type argument which seems similar to PCI legacy drivers accepting
"struct pci_dev*" type.

Moreover, "struct usb_device_driver" seems analogous to "struct pci_driver" as
it also has .suspend() and .resume() callback. Also, it has a bitfield
"generic_subclass:1" which is described as, " @generic_subclass: if set to 1,
the generic USB driver's probe, disconnect, resume and suspend functions will be
called in addition to the driver's own, so this part of the setup does not need
to be replicated. "

So the generic PM, talked about in USB drivers, is similar to PCI one? The
non-generic PM in USB is similar to legacy PM in PCI?

A similar update for the USB subsystem is possible?

--Vaibhav Gupta

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: generic power management for USB subsystem similar to PCI one?
  2020-07-21 15:53 generic power management for USB subsystem similar to PCI one? Vaibhav Gupta
@ 2020-07-21 16:27 ` Alan Stern
  0 siblings, 0 replies; 2+ messages in thread
From: Alan Stern @ 2020-07-21 16:27 UTC (permalink / raw)
  To: Vaibhav Gupta
  Cc: Bjorn Helgaas, Bjorn Helgaas, Bjorn Helgaas, linux-usb,
	Rafael J. Wysocki

On Tue, Jul 21, 2020 at 09:23:14PM +0530, Vaibhav Gupta wrote:
> Hello,
> Currently I am working on removing legacy power management .suspend() and
> .resume() callbacks from PCI subsystem. The updates aim to give power management
> control to PCI core and let drivers do the only device-specific jobs without
> using any PCI helper functions.
> 
> I was wondering if similar changes can be applied to the USB subsystem?
> I explored and found that .suspend() in USB drivers also accept the pm_message_t
> type argument.
> Also, .suspend() and .resume() in usb drivers, accept "struct usb_interface *"
> type argument which seems similar to PCI legacy drivers accepting
> "struct pci_dev*" type.
> 
> Moreover, "struct usb_device_driver" seems analogous to "struct pci_driver" as
> it also has .suspend() and .resume() callback. Also, it has a bitfield
> "generic_subclass:1" which is described as, " @generic_subclass: if set to 1,
> the generic USB driver's probe, disconnect, resume and suspend functions will be
> called in addition to the driver's own, so this part of the setup does not need
> to be replicated. "
> 
> So the generic PM, talked about in USB drivers, is similar to PCI one?

I don't know what you mean by "the generic PM".  IMO, overall USB power 
management is pretty similar to the arrangement in PCI, although with 
less legacy stuff remaining.

>  The
> non-generic PM in USB is similar to legacy PM in PCI?

No, I don't think so, although it's hard to give an exact answer to such 
an imprecise question.  What sort of thing would make USB PM similar to 
legacy PCI PM?

> A similar update for the USB subsystem is possible?

I think you'll find that the power management in USB drivers already 
does only device-specific things, with overall control remaining in the 
USB core.

Maybe if you came up with some more specific examples of what you are 
thinking of, I could give better answers.

Alan Stern

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-21 16:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-21 15:53 generic power management for USB subsystem similar to PCI one? Vaibhav Gupta
2020-07-21 16:27 ` Alan Stern

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.