mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Francesco Lavra <flavra@baylibre.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Kuen-Han Tsai <khtsai@google.com>, Kees Cook <kees@kernel.org>,
	raub camaioni <raubcameo@gmail.com>,
	Sonali Pradhan <sonalipradhan@google.com>,
	 linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Felix Schladt <felix.schladt@gmail.com>
Subject: Re: [PATCH] usb: gadget: f_ncm: Restart timer when eth_start_xmit() fails
Date: Thu, 22 Oct 2026 12:24:23 +0200	[thread overview]
Message-ID: <d1534d72eae4fd210bda0b485ed05d3ef0147728.camel@baylibre.com> (raw)
In-Reply-To: <20260727165441.1969927-1-flavra@baylibre.com>

Friendly ping

On Mon, 2026-07-27 at 18:54 +0200, Francesco Lavra wrote:
> The ncm_tx_timeout() function is run by a timer when unsent data has been
> sitting for some time in the NCM driver waiting for more data to be
> pushed
> by the ethernet gadget driver, and calls eth_start_xmit() to trigger a
> flush of the unsent data. If there is no available struct usb_request
> (which can happen when there is sustained network traffic from the gadget
> device to the USB host), the unsent data is not flushed, and remains
> there
> until enough new data has been pushed by the ethernet gadget driver to
> fill
> a USB packet. This can cause outgoing network traffic to stall for
> several
> seconds, during which the gadget device appears unresponsive to the host.
> 
> Fix this issue by restarting the ncm_tx_timeout() timer if there is no
> available struct usb_request.
> 
> Signed-off-by: Francesco Lavra <flavra@baylibre.com>
> ---
>  drivers/usb/gadget/function/f_ncm.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/gadget/function/f_ncm.c
> b/drivers/usb/gadget/function/f_ncm.c
> index 64eabda2f546..fd84086473d7 100644
> --- a/drivers/usb/gadget/function/f_ncm.c
> +++ b/drivers/usb/gadget/function/f_ncm.c
> @@ -1158,7 +1158,8 @@ static enum hrtimer_restart ncm_tx_timeout(struct
> hrtimer *data)
>                  *
>                  * This will call directly into u_ether's
> eth_start_xmit()
>                  */
> -               netdev->netdev_ops->ndo_start_xmit(NULL, netdev);
> +               if (netdev->netdev_ops->ndo_start_xmit(NULL, netdev) ==
> NETDEV_TX_BUSY)
> +                       return HRTIMER_RESTART;
>         }
>         return HRTIMER_NORESTART;
>  }


  parent reply	other threads:[~2026-10-22 10:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-27 16:54 Francesco Lavra
2026-08-24  7:47 ` Felix Schladt
2026-10-22 10:24 ` Francesco Lavra [this message]
2026-10-22 13:26   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d1534d72eae4fd210bda0b485ed05d3ef0147728.camel@baylibre.com \
    --to=flavra@baylibre.com \
    --cc=felix.schladt@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=kees@kernel.org \
    --cc=khtsai@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=raubcameo@gmail.com \
    --cc=sonalipradhan@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®