linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hardik Gajjar <hgajjar@de.adit-jv.com>
To: <gregkh@linuxfoundation.org>, <s.hauer@pengutronix.de>,
	<jonathanh@nvidia.com>, <linux-usb@vger.kernel.org>,
	<linux-kernel@vger.kernel.org>
Cc: <quic_linyyuan@quicinc.com>, <paul@crapouillou.net>,
	<quic_eserrao@quicinc.com>, <erosca@de.adit-jv.com>,
	gah2hi <external.Hardik.Gajjar@de.bosch.com>
Subject: [PATCH] usb: gadget: u_ether: Replace netif_stop_queue with netif_device_detach
Date: Fri, 6 Oct 2023 16:12:31 +0200	[thread overview]
Message-ID: <20231006141231.7220-1-hgajjar@de.adit-jv.com> (raw)

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


             reply	other threads:[~2023-10-06 14:12 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 14:12 Hardik Gajjar [this message]
2023-10-06 14:21 ` [PATCH] usb: gadget: u_ether: Replace netif_stop_queue with netif_device_detach 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

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=20231006141231.7220-1-hgajjar@de.adit-jv.com \
    --to=hgajjar@de.adit-jv.com \
    --cc=erosca@de.adit-jv.com \
    --cc=external.Hardik.Gajjar@de.bosch.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jonathanh@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=paul@crapouillou.net \
    --cc=quic_eserrao@quicinc.com \
    --cc=quic_linyyuan@quicinc.com \
    --cc=s.hauer@pengutronix.de \
    /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;
as well as URLs for NNTP newsgroup(s).