public inbox for linux-usb@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: u_ether: Use __netif_rx() in rx_callback()
@ 2024-09-06 18:57 Hubert Wiśniewski
  2024-09-11 13:28 ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Hubert Wiśniewski @ 2024-09-06 18:57 UTC (permalink / raw)
  To: linux-usb

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



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

* Re: [PATCH] usb: gadget: u_ether: Use __netif_rx() in rx_callback()
  2024-09-06 18:57 [PATCH] usb: gadget: u_ether: Use __netif_rx() in rx_callback() Hubert Wiśniewski
@ 2024-09-11 13:28 ` Greg KH
  2024-09-17 10:29   ` Hubert Wiśniewski
  0 siblings, 1 reply; 3+ messages in thread
From: Greg KH @ 2024-09-11 13:28 UTC (permalink / raw)
  To: Hubert Wiśniewski; +Cc: linux-usb

On Fri, Sep 06, 2024 at 08:57:25PM +0200, Hubert Wiśniewski wrote:
> 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>

Doesn't match the "From:" line, so we can't take this :(

What commit id does this fix?

thanks,

greg k-h

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

* Re: [PATCH] usb: gadget: u_ether: Use __netif_rx() in rx_callback()
  2024-09-11 13:28 ` Greg KH
@ 2024-09-17 10:29   ` Hubert Wiśniewski
  0 siblings, 0 replies; 3+ messages in thread
From: Hubert Wiśniewski @ 2024-09-17 10:29 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-usb

On Wed, 2024-09-11 at 15:28 +0200, Greg KH wrote:
> On Fri, Sep 06, 2024 at 08:57:25PM +0200, Hubert Wiśniewski wrote:
> > 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>
> 
> Doesn't match the "From:" line, so we can't take this :(

Sorry, my mistake. I will fix that.

> What commit id does this fix?

This fixes baebdf48c360 ("net: dev: Makes sure netif_rx() can be invoked in
any context."). I will add an appropriate Fixes tag in v2.

Thank you for your feedback.

Hubert Wiśniewski



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

end of thread, other threads:[~2024-09-17 10:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-06 18:57 [PATCH] usb: gadget: u_ether: Use __netif_rx() in rx_callback() Hubert Wiśniewski
2024-09-11 13:28 ` Greg KH
2024-09-17 10:29   ` Hubert Wiśniewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox