Skip to content

Commit

Permalink
usb: gadget: u_ether: Replace netif_stop_queue with netif_device_detach
Browse files Browse the repository at this point in the history
This patch replaces the usage of netif_stop_queue with netif_device_detach
in the u_ether driver. The netif_device_detach function not only stops all
tx queues by calling netif_tx_stop_all_queues but also marks the device as
removed by clearing the __LINK_STATE_PRESENT bit.

This change helps notify user space about the disconnection of the device
more effectively, compared to netif_stop_queue, which only stops a single
transmit queue.

Signed-off-by: Hardik Gajjar <hgajjar@de.adit-jv.com>
Link: https://lore.kernel.org/r/20231006155646.12938-1-hgajjar@de.adit-jv.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
hardik1609 authored and gregkh committed Oct 8, 2023
1 parent 0f5aa1b commit f49449f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/gadget/function/u_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -1200,7 +1200,7 @@ void gether_disconnect(struct gether *link)

DBG(dev, "%s\n", __func__);

netif_stop_queue(dev->net);
netif_device_detach(dev->net);
netif_carrier_off(dev->net);

/* disable endpoints, forcing (synchronous) completion
Expand Down

0 comments on commit f49449f

Please sign in to comment.