public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
From: "Hubert Wiśniewski" <hubert.wisniewski.25632@gmail.com>
To: linux-usb@vger.kernel.org
Subject: [PATCH] usb: gadget: u_ether: Use __netif_rx() in rx_callback()
Date: Fri, 06 Sep 2024 20:57:25 +0200	[thread overview]
Message-ID: <7d86b2ed20418cab986708e327adb4432f7078c2.camel@gmail.com> (raw)

netif_rx() now disables bottom halves, which causes the USB gadget to be
unable to receive frames if the interface is not brought up quickly enough
after being created by the driver (a bug confirmed on AM3352 SoC).

Replacing netif_rx() with __netif_rx() restores the old behavior and fixes
the bug. This can be done since rx_callback() is called from the interrupt
context.

Signed-off-by: Hubert Wiśniewski <wiih@viessmann.com>
---
 drivers/usb/gadget/function/u_ether.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/function/u_ether.c
b/drivers/usb/gadget/function/u_ether.c
index 4bb0553da658..fd7e483b4a48 100644
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -266,7 +266,7 @@ static void rx_complete(struct usb_ep *ep, struct
usb_request *req)
                        /* no buffer copies needed, unless hardware can't
                         * use skb buffers.
                         */
-                       status = netif_rx(skb2);
+                       status = __netif_rx(skb2);
 next_frame:
                        skb2 = skb_dequeue(&dev->rx_frames);
                }
-- 
2.30.2



             reply	other threads:[~2024-09-06 18:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-06 18:57 Hubert Wiśniewski [this message]
2024-09-11 13:28 ` [PATCH] usb: gadget: u_ether: Use __netif_rx() in rx_callback() Greg KH
2024-09-17 10:29   ` Hubert Wiśniewski

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=7d86b2ed20418cab986708e327adb4432f7078c2.camel@gmail.com \
    --to=hubert.wisniewski.25632@gmail.com \
    --cc=linux-usb@vger.kernel.org \
    /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