[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2025021436-seizing-prankish-ebf2@gregkh>
Date: Fri, 14 Feb 2025 09:00:58 +0100
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Prashanth K <prashanth.k@....qualcomm.com>
Cc: Ferry Toth <ftoth@...londelft.nl>,
Ricardo B Marliere <ricardo@...liere.net>,
Kees Cook <kees@...nel.org>, linux-usb@...r.kernel.org,
Elson Roy Serrao <quic_eserrao@...cinc.com>,
linux-kernel@...r.kernel.org, stable@...r.kernel.org
Subject: Re: [PATCH] usb: gadget: u_ether: Set is_suspend flag if remote
wakeup fails
On Wed, Feb 12, 2025 at 03:38:40PM +0530, Prashanth K wrote:
> Currently while UDC suspends, u_ether attempts to remote wakeup
> the host if there are any pending transfers. However, if remote
> wakeup fails, the UDC remains suspended but the is_suspend flag
> is not set. And since is_suspend flag isn't set, the subsequent
> eth_start_xmit() would queue USB requests to suspended UDC.
>
> To fix this, bail out from gether_suspend() only if remote wakeup
> operation is successful.
>
> Cc: stable@...r.kernel.org
> Fixes: 0a1af6dfa077 ("usb: gadget: f_ecm: Add suspend/resume and remote wakeup support")
> Signed-off-by: Prashanth K <prashanth.k@....qualcomm.com>
> ---
> drivers/usb/gadget/function/u_ether.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c
> index 09e2838917e2..f58590bf5e02 100644
> --- a/drivers/usb/gadget/function/u_ether.c
> +++ b/drivers/usb/gadget/function/u_ether.c
> @@ -1052,8 +1052,8 @@ void gether_suspend(struct gether *link)
> * There is a transfer in progress. So we trigger a remote
> * wakeup to inform the host.
> */
> - ether_wakeup_host(dev->port_usb);
> - return;
> + if (!ether_wakeup_host(dev->port_usb))
> + return;
What about the other place in the driver where this function is called
but the return value is ignored?
thanks,
greg k-h
Powered by blists - more mailing lists