Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp436503rdb; Fri, 6 Oct 2023 07:53:54 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHPiFjAt7HOei7ilCsrXcJIBp5MippVfAokhnd2QXyewNA4CSuz54qLqvfPBVhwKfcduXrG X-Received: by 2002:a05:6a00:24d5:b0:68c:6a77:4845 with SMTP id d21-20020a056a0024d500b0068c6a774845mr10296236pfv.12.1696604034561; Fri, 06 Oct 2023 07:53:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696604034; cv=none; d=google.com; s=arc-20160816; b=r7Denyn3Ea1j4VAsYuuHAQzyhuL8yJ+rOWakohRfoP2U/jrqdiCagcdG1E72Zbu28E h8jYvplT1CWlqjLZEyIE10hq3lSC/ndpieT9MqvLTr2l0VVyNU167ZjP0FCjPv+xzvz2 XhSgaG/FNv1vma03Y6bykeOBA4+mGq4QOdkqB9MdvZJQljO+QE/VBKhLEgYhDCAfJY7e PlG7mulXoAwShMxkKSgkcYhmdSNGYirsAsc0p4nvtJa2gJTpQ80r6ZWxeZxATZSogmuu rd+ZWS8Vk/NcqyPL3lzx/pphhbJmUsjV97Wr7l/pPVagVyUpjNTwF1LMIChh1dKexsMg DwmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=7NU6tbDfpdvUEohI1lRngNSqOlNvyuq0b88uScp1KIA=; fh=fnE/bHGRt0bnLs/gLT7CmmXLtlYO+uB6FxtaiV5G/9U=; b=NVnGOg8gN2WkI9y1I4lEVBHm0dOxuev+NV/Iv650y2hdSQKDx+lqbPR9E4nAne1u+U maOhfPuIpUyl038SogVXN0yviBEEtwTNii6/gTHulPdCUaOrImSRcNYRr/SwREBhavth sD6EGnyj0+GBBJgdAaG3vDTAZjuH/JnUua0QSy76MrVG75HM54Z7AKNAHippXx82Chiv MJFgPj1wCm+JQqg+jaZYgtrHPoN1RF1H1Aj1d+z11/JiPF1SAsZ5uTxY/5n/xLbQN7Ih bUPprEm0o4+aZzuvVC1Kc51DzjAM1g4ihrfUUFyxrjD38xXY7yb51Cts6sNFcNcsGDSf Fs7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id ea25-20020a056a004c1900b00690ffbb46e6si932728pfb.261.2023.10.06.07.53.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 07:53:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (Postfix) with ESMTP id 12B178074515; Fri, 6 Oct 2023 07:53:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232637AbjJFOxo (ORCPT + 99 others); Fri, 6 Oct 2023 10:53:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232663AbjJFOxm (ORCPT ); Fri, 6 Oct 2023 10:53:42 -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 E3BCEE4; Fri, 6 Oct 2023 07:53:40 -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 A414352050C; Fri, 6 Oct 2023 16:53: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:53:39 +0200 From: Hardik Gajjar To: , , , , CC: , , , , Subject: [PATCH v2] usb: gadget: u_ether: Replace netif_stop_queue with netif_device_detach Date: Fri, 6 Oct 2023 16:53:32 +0200 Message-ID: <20231006145332.8739-1-hgajjar@de.adit-jv.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231006141231.7220-1-hgajjar@de.adit-jv.com> References: <20231006141231.7220-1-hgajjar@de.adit-jv.com> 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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 06 Oct 2023 07:53:52 -0700 (PDT) X-Spam-Level: ** 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. Changes since version 1: - Correct Singed-off user name and e-mail Signed-off-by: Hardik Gajjar --- 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..b0daee35b996 100644 --- a/drivers/usb/gadget/function/u_ether.c +++ b/drivers/usb/gadget/function/u_ether.c @@ -635,7 +635,7 @@ static int eth_stop(struct net_device *net) unsigned long flags; VDBG(dev, "%s\n", __func__); - netif_stop_queue(net); + netif_device_detach(dev->net); DBG(dev, "stop stats: rx/tx %ld/%ld, errs %ld/%ld\n", dev->net->stats.rx_packets, dev->net->stats.tx_packets, -- 2.17.1