linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: u_ether: Replace netif_stop_queue with netif_device_detach
@ 2023-10-06 14:12 Hardik Gajjar
  2023-10-06 14:21 ` Greg KH
                   ` (2 more replies)
  0 siblings, 3 replies; 34+ messages in thread
From: Hardik Gajjar @ 2023-10-06 14:12 UTC (permalink / raw)
  To: gregkh, s.hauer, jonathanh, linux-usb, linux-kernel
  Cc: quic_linyyuan, paul, quic_eserrao, erosca, gah2hi

From: gah2hi <external.Hardik.Gajjar@de.bosch.com>

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: gah2hi <external.Hardik.Gajjar@de.bosch.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..9d1c40c152d8 100644
--- a/drivers/usb/gadget/function/u_ether.c
+++ b/drivers/usb/gadget/function/u_ether.c
@@ -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
-- 
2.17.1


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

end of thread, other threads:[~2024-05-15 18:38 UTC | newest]

Thread overview: 34+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-10-06 14:12 [PATCH] usb: gadget: u_ether: Replace netif_stop_queue with netif_device_detach Hardik Gajjar
2023-10-06 14:21 ` Greg KH
2023-10-06 14:50 ` Hardik Gajjar
2023-10-06 14:53 ` [PATCH v2] " Hardik Gajjar
2023-10-06 14:59   ` Greg KH
2023-10-06 15:38   ` [PATCH v3] " Hardik Gajjar
2023-10-06 15:56     ` [PATCH v4] " Hardik Gajjar
2024-01-14 16:59       ` Andy Shevchenko
2024-01-15 13:27         ` Hardik Gajjar
2024-01-15 20:10           ` Ferry Toth
2024-04-03 21:01             ` Ferry Toth
2024-04-05 11:38               ` Hardik Gajjar
2024-04-07 20:51                 ` Ferry Toth
2024-04-10 17:37                   ` Andy Shevchenko
2024-04-11 14:26                     ` Hardik Gajjar
2024-04-11 16:39                       ` Andy Shevchenko
2024-04-11 20:52                         ` Ferry Toth
2024-04-16 13:48                           ` Andy Shevchenko
2024-04-17 15:13                             ` Hardik Gajjar
2024-04-25 21:27                               ` Ferry Toth
2024-04-28 21:07                                 ` Ferry Toth
2024-04-30 15:32                                   ` Hardik Gajjar
2024-04-30 19:40                                     ` Ferry Toth
2024-04-30 21:12                                       ` Ferry Toth
2024-05-02 15:29                                         ` Hardik Gajjar
2024-05-02 15:31                                           ` Andy Shevchenko
2024-05-02 16:16                                             ` Hardik Gajjar
2024-05-03  7:24                                               ` Linux regression tracking (Thorsten Leemhuis)
2024-05-03  9:15                                                 ` Hardik Gajjar
2024-05-03 12:39                                                   ` Linux regression tracking (Thorsten Leemhuis)
2024-05-02 20:13                                           ` Ferry Toth
2024-05-02 20:32                                             ` Ferry Toth
2024-05-10  9:45                                               ` Hardik Gajjar
2024-05-15 18:38                                                 ` Ferry Toth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).