All of lore.kernel.org
 help / color / mirror / Atom feed
* support USB 3.2 function remote wake
@ 2022-06-29  9:02 Chunfeng Yun
  2022-06-29 10:22 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 3+ messages in thread
From: Chunfeng Yun @ 2022-06-29  9:02 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: Greg Kroah-Hartman, Alan Stern, linux-usb, linux-mediatek

Hi,

I plan to support function remote wakeup on our usb3 device controller
driver.

A function may signal that it wants to exit from Function Suspend by
sending a Function Wake Notification to the host, and the notification
need knows the first interface number in this function.
But the current gadget ops:
    int (*wakeup)(struct usb_gadget *);
does not provide information about interface number;

There seems to be two ways:
1. add a new parameter as below,
    int (*wakeup)(struct usb_gadget *, u8 intf);
2. add a new ops, such as,
    int (*function_wakeup)(struct usb_gadget *, u8 intf);

Do you have any suggestions?

Thanks a lot


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

* Re: support USB 3.2 function remote wake
  2022-06-29  9:02 support USB 3.2 function remote wake Chunfeng Yun
@ 2022-06-29 10:22 ` Greg Kroah-Hartman
  2022-07-02  9:09   ` Chunfeng Yun
  0 siblings, 1 reply; 3+ messages in thread
From: Greg Kroah-Hartman @ 2022-06-29 10:22 UTC (permalink / raw)
  To: Chunfeng Yun; +Cc: Felipe Balbi, Alan Stern, linux-usb, linux-mediatek

On Wed, Jun 29, 2022 at 05:02:54PM +0800, Chunfeng Yun wrote:
> Hi,
> 
> I plan to support function remote wakeup on our usb3 device controller
> driver.

Is this based on dwc3 or some new silicon?

> A function may signal that it wants to exit from Function Suspend by
> sending a Function Wake Notification to the host, and the notification
> need knows the first interface number in this function.
> But the current gadget ops:
>     int (*wakeup)(struct usb_gadget *);
> does not provide information about interface number;

Why would the interface matter as you need to do this for the whole
device, not just one interface, right?

> There seems to be two ways:
> 1. add a new parameter as below,
>     int (*wakeup)(struct usb_gadget *, u8 intf);
> 2. add a new ops, such as,
>     int (*function_wakeup)(struct usb_gadget *, u8 intf);
> 
> Do you have any suggestions?

Look at what the existing ones do, I do not think you have different
suspend levels per USB interface, but rather the whole device.  Try it
and see.

thanks,

greg k-h

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

* Re: support USB 3.2 function remote wake
  2022-06-29 10:22 ` Greg Kroah-Hartman
@ 2022-07-02  9:09   ` Chunfeng Yun
  0 siblings, 0 replies; 3+ messages in thread
From: Chunfeng Yun @ 2022-07-02  9:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: Felipe Balbi, Alan Stern, linux-usb, linux-mediatek

On Wed, 2022-06-29 at 12:22 +0200, Greg Kroah-Hartman wrote:
> On Wed, Jun 29, 2022 at 05:02:54PM +0800, Chunfeng Yun wrote:
> > Hi,
> > 
> > I plan to support function remote wakeup on our usb3 device
> > controller
> > driver.
> 
> Is this based on dwc3 or some new silicon?
Based on mtu3;

> 
> > A function may signal that it wants to exit from Function Suspend
> > by
> > sending a Function Wake Notification to the host, and the
> > notification
> > need knows the first interface number in this function.
> > But the current gadget ops:
> >     int (*wakeup)(struct usb_gadget *);
> > does not provide information about interface number;
> 
> Why would the interface matter as you need to do this for the whole
> device, not just one interface, right?
Yes, it is, but usb3.2 only supports function remote wakeup.

I look at the code of core/hub.c, as described in function
usb_enable_remote_wakeup():
" For USB-3 devices: Assume there's only one function on the device and
enable remote wake for the first interface.  FIXME if the interface
association descriptor shows there's more than one function.
"
It assume the interface number is 0, and don't support multi-function
devices with IAD.

> 
> > There seems to be two ways:
> > 1. add a new parameter as below,
> >     int (*wakeup)(struct usb_gadget *, u8 intf);
> > 2. add a new ops, such as,
> >     int (*function_wakeup)(struct usb_gadget *, u8 intf);
> > 
> > Do you have any suggestions?
> 
> Look at what the existing ones do, 
Yes, I looked at all existing ones that support remote wakeup, but
seems no one support function wakeup (maybe also assume the interface
number is 0 if it does);

If we also follow the ways of host, no need change ops.
but there is also limitation for composite device with IAD;


> I do not think you have different
> suspend levels per USB interface, but rather the whole device.

>   Try it
> and see.
> 
> thanks,
> 
> greg k-h


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

end of thread, other threads:[~2022-07-02  9:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-29  9:02 support USB 3.2 function remote wake Chunfeng Yun
2022-06-29 10:22 ` Greg Kroah-Hartman
2022-07-02  9:09   ` Chunfeng Yun

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.