Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp410930rdb; Fri, 6 Oct 2023 07:13:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFkj1ExZa1mnt2oU+8aS5ITjoqu39jg0EBktSpHVUlas3fgMInEeqr/PdG/abs2aWTzjFZn X-Received: by 2002:a05:6a00:2a0b:b0:696:b2cc:5b39 with SMTP id ce11-20020a056a002a0b00b00696b2cc5b39mr6478194pfb.20.1696601581952; Fri, 06 Oct 2023 07:13:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696601581; cv=none; d=google.com; s=arc-20160816; b=nSswq6m5bLgULdX4Cir9dMY26kbWKq395FyzW62Enq3WthYKxGTOvtlnUT1yMfadBZ V1hMW/Dpdy2fOsYUkJK60JhWnOf1gzRLmCsZoKc1UmJHvOiBbRt/0QGgE4Hcy5+cf4EP RuK+N1zD4Vx7Or7V6oNFI8lPsfJUzpzIRNfqSzXjyIZjW9ngD2N3saMuVzfMSaScb6ZQ JPBMy7hapK/SXvePFM24F1DdGneo9ZXLKgM4k+9CBHFdtIP9e/QexqImEg5/YNCqyzx6 J62EUgemBh/Y3KgfnkD8w+Qf68iCCinlwSNAgSQ7OGeZVNusH0JXBDSTvobobtjBDLxD oL5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=1MX/urZbtxMAFfGwk+//ycsZvefIBZso6Hi23FabsFg=; fh=J372RQxIUYoWqHq2IFKMIZ/KexeneKiRjTNlN3d14/o=; b=KrRaD2JLhozDwvD8E5eWuQi48RYys8jLnyZROCv7inhZyfWjBK1FcEzEX9WShJkmfZ lmxoN9Dtz4WpcU6oRPLZmlfFUmtODxThYe0H1RMQTSuoe/LFZe57Kv1m6d2PXFfxwUEh QmDvRJ7asyTQbi/Ep9DqdLP5jeJNxA+3ryId1u3DRgXbsNSGIJ/i86c6XeK4HsqJxUBV GKE+VQEwmDmoioqo1yXy+/zI231osEu8i/qp57dPC0q+pNGqqfc94vb5VOsDL9sZHViM Xvb0E1X8REzS1uT6uIDdF1O431hPmJfrETJHOJtFvo9AkpXYfl1+3xlG8z0FmWazr1Y6 q5Kg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id bx13-20020a056a00428d00b00690c0055246si1560774pfb.294.2023.10.06.07.13.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 07:13:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id A8BA780A7CEB; Fri, 6 Oct 2023 07:12:59 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232488AbjJFOMr (ORCPT + 99 others); Fri, 6 Oct 2023 10:12:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55684 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232378AbjJFOMq (ORCPT ); Fri, 6 Oct 2023 10:12:46 -0400 Received: from hi1smtp01.de.adit-jv.com (smtp1.de.adit-jv.com [93.241.18.167]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A15CAC; Fri, 6 Oct 2023 07:12:42 -0700 (PDT) Received: from hi2exch02.adit-jv.com (hi2exch02.adit-jv.com [10.72.92.28]) by hi1smtp01.de.adit-jv.com (Postfix) with ESMTP id EFA6C52050C; Fri, 6 Oct 2023 16:12:39 +0200 (CEST) Received: from vmlxhi-118.adit-jv.com (10.72.93.77) by hi2exch02.adit-jv.com (10.72.92.28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.32; Fri, 6 Oct 2023 16:12:39 +0200 From: Hardik Gajjar To: , , , , CC: , , , , gah2hi Subject: [PATCH] usb: gadget: u_ether: Replace netif_stop_queue with netif_device_detach Date: Fri, 6 Oct 2023 16:12:31 +0200 Message-ID: <20231006141231.7220-1-hgajjar@de.adit-jv.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.72.93.77] X-ClientProxiedBy: hi2exch02.adit-jv.com (10.72.92.28) To hi2exch02.adit-jv.com (10.72.92.28) X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Fri, 06 Oct 2023 07:12:59 -0700 (PDT) X-Spam-Level: ** From: gah2hi 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 --- 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