lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <szlqp4i6vdhqzipxefzol5nyabzww2dezkqo67chwjv6puamaj@6pdq77cwm2w4>
Date: Mon, 15 Sep 2025 22:28:00 +0800
From: Xu Yang <xu.yang_2@....com>
To: Greg KH <gregkh@...uxfoundation.org>
Cc: tglx@...utronix.de, mingo@...nel.org, linux-usb@...r.kernel.org, 
	linux-kernel@...r.kernel.org, imx@...ts.linux.dev, jun.li@....com
Subject: Re: [PATCH] usb: gadget: zero: add function wakeup support

On Mon, Sep 15, 2025 at 01:36:07PM +0200, Greg KH wrote:
> On Mon, Sep 15, 2025 at 05:02:30PM +0800, Xu Yang wrote:
> > When the device working at enhanced superspeed, it needs to send function
> > remote wakeup signal to the host instead of device remote wakeup. Add
> > function wakeup support for the purpose.
> > 
> > Signed-off-by: Xu Yang <xu.yang_2@....com>
> > ---
> >  drivers/usb/gadget/legacy/zero.c | 27 ++++++++++++++++++---------
> >  1 file changed, 18 insertions(+), 9 deletions(-)
> > 
> > diff --git a/drivers/usb/gadget/legacy/zero.c b/drivers/usb/gadget/legacy/zero.c
> > index a05785bdeb30..fe286b597f9f 100644
> > --- a/drivers/usb/gadget/legacy/zero.c
> > +++ b/drivers/usb/gadget/legacy/zero.c
> > @@ -147,6 +147,12 @@ static struct usb_gadget_strings *dev_strings[] = {
> >  	NULL,
> >  };
> >  
> > +static struct usb_function *func_lb;
> > +static struct usb_function_instance *func_inst_lb;
> > +
> > +static struct usb_function *func_ss;
> > +static struct usb_function_instance *func_inst_ss;
> > +
> >  /*-------------------------------------------------------------------------*/
> >  
> >  static struct timer_list	autoresume_timer;
> > @@ -156,6 +162,7 @@ static void zero_autoresume(struct timer_list *unused)
> >  {
> >  	struct usb_composite_dev	*cdev = autoresume_cdev;
> >  	struct usb_gadget		*g = cdev->gadget;
> > +	int status;
> >  
> >  	/* unconfigured devices can't issue wakeups */
> >  	if (!cdev->config)
> > @@ -165,10 +172,18 @@ static void zero_autoresume(struct timer_list *unused)
> >  	 * more significant than just a timer firing; likely
> >  	 * because of some direct user request.
> >  	 */
> > -	if (g->speed != USB_SPEED_UNKNOWN) {
> > -		int status = usb_gadget_wakeup(g);
> > -		INFO(cdev, "%s --> %d\n", __func__, status);
> > +	if (g->speed == USB_SPEED_UNKNOWN)
> > +		return;
> > +
> > +	if (g->speed >= USB_SPEED_SUPER) {
> > +		if (loopdefault)
> > +			status = usb_func_wakeup(func_lb);
> > +		else
> > +			status = usb_func_wakeup(func_ss);
> > +	} else {
> > +		status = usb_gadget_wakeup(g);
> >  	}
> > +	INFO(cdev, "%s --> %d\n", __func__, status);
> 
> Is this INFO() call still needed?  Shouldn't that be removed?

For me, this information is useful to know the test results. I prefer
to keep it.

Thanks,
Xu Yang

> 
> thanks,
> 
> greg k-h

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ