diff mbox series

[v2] usb: gadget: u_ether: Use __netif_rx() in rx_callback()

Message ID 10019b141275f7fa3e2446e207e7a9afaaa98b3d.camel@gmail.com (mailing list archive)
State Superseded
Headers show
Series [v2] usb: gadget: u_ether: Use __netif_rx() in rx_callback() | expand

Commit Message

Hubert Wiśniewski Sept. 17, 2024, 11:19 a.m. UTC
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.

Fixes: baebdf48c360 ("net: dev: Makes sure netif_rx() can be invoked in any context.")
Signed-off-by: Hubert Wiśniewski <hubert.wisniewski.25632@gmail.com>
---
v1 -> v2: Added Fixes tag and corrected Signed-off-by tag

 drivers/usb/gadget/function/u_ether.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Greg KH Sept. 17, 2024, 12:09 p.m. UTC | #1
On Tue, Sep 17, 2024 at 01:19: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.
> 
> Fixes: baebdf48c360 ("net: dev: Makes sure netif_rx() can be invoked in any context.")
> Signed-off-by: Hubert Wiśniewski <hubert.wisniewski.25632@gmail.com>
> ---
> v1 -> v2: Added Fixes tag and corrected Signed-off-by tag
> 

Hi,

This is the friendly patch-bot of Greg Kroah-Hartman.  You have sent him
a patch that has triggered this response.  He used to manually respond
to these common problems, but in order to save his sanity (he kept
writing the same thing over and over, yet to different people), I was
created.  Hopefully you will not take offence and will fix the problem
in your patch and resubmit it so that it can be accepted into the Linux
kernel tree.

You are receiving this message because of the following common error(s)
as indicated below:

- You have marked a patch with a "Fixes:" tag for a commit that is in an
  older released kernel, yet you do not have a cc: stable line in the
  signed-off-by area at all, which means that the patch will not be
  applied to any older kernel releases.  To properly fix this, please
  follow the documented rules in the
  Documentation/process/stable-kernel-rules.rst file for how to resolve
  this.

If you wish to discuss this problem further, or you have questions about
how to resolve this issue, please feel free to respond to this email and
Greg will reply once he has dug out from the pending patches received
from other developers.

thanks,

greg k-h's patch email bot
Sebastian Andrzej Siewior Sept. 17, 2024, 2:33 p.m. UTC | #2
On 2024-09-17 13:19:25 [+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.
> 
> Fixes: baebdf48c360 ("net: dev: Makes sure netif_rx() can be invoked in any context.")
> Signed-off-by: Hubert Wiśniewski <hubert.wisniewski.25632@gmail.com>

This does not look right.
Can you add a backtrace and check with lockdep enabled?
netif_rx() should not disable BH if invoked from an interrupt.


Sebastian
diff mbox series

Patch

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);
 		}