Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp468481rdb; Fri, 6 Oct 2023 08:38:38 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEiItmS4XEl1aRpOFdupQrDOYutp2KPc94uPJxFeNxgh7GBi7xS8shuXHIb8VXXy24zYQoJ X-Received: by 2002:a17:90a:e38a:b0:26f:b228:faea with SMTP id b10-20020a17090ae38a00b0026fb228faeamr7808059pjz.18.1696606717705; Fri, 06 Oct 2023 08:38:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696606717; cv=none; d=google.com; s=arc-20160816; b=YhwfYt66nHhDDobbSU0Sn6a5auOp9zLQo5UrOUhjV7akkNcfR0+MUssxFn0a0LCPy8 ruvxoc/h9S0GLYFk6Bo/ESTqjl1cIg8F2oOBY/IwCLFitlqikBQSRO9yW4unnkhvuYyP GFfarKXyldn+sV0PPtaxru2pZPIoCguYX6nbvTQuyoczDi4EpOl44I3uZ3o9TkL9Wm7Q 780WAoX7oM5mqS2S/CuUb/CfzNTe2WAW6xNMiUMJqtTcM/0jYjDpiL9Jlc5Ac+NzhKSj mPiVowHWgHBuz3pLkh5wSK8kIcF+ipvC9psFwXz2v/udLlaaNzIZrQHB7SJZxjPsn7Ts /r8w== 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=pQIOhWrwnb+Gxd2t1anduoIpUGgjG1QD4/RsdjYvx+I=; fh=fnE/bHGRt0bnLs/gLT7CmmXLtlYO+uB6FxtaiV5G/9U=; b=gGP34Yy/w1uIrY31b1wAH5RgIyUCmUijQSR5P+QQ1jkodL3f3YBHfPWieSWwb389Yf oHX3hNoSyZWrP/sb2vDyA7cWOSjyUjuNbWLf7Hj9bTpFSvcroBOYb5sMHQnBFeqvqyFs gnqOVhdqKf21MXwcg6LPKgwzy8dY3gJUrEQMIfIX4J4UuzJY4DbgVWGss/ZAQ4kkj6p2 TZRgqRSPOqm/5kFwSA0OqaNXrUqy+eHttvVpkKwzq+Cz2LDvLvvn5ydpy0sp/K2X3MR5 6wRQPT82QnC3g0zvYay/z9QxspRaBVdCQcduQWU7rtTp0l/eg3eRJ0qP5xUkeE8UBJ9+ JIfQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id s16-20020a17090aad9000b0027b14cd13a3si3979978pjq.73.2023.10.06.08.38.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 08:38:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 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 284F185A6CD1; Fri, 6 Oct 2023 08:38:33 -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 S232859AbjJFPiV (ORCPT + 99 others); Fri, 6 Oct 2023 11:38:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232799AbjJFPiU (ORCPT ); Fri, 6 Oct 2023 11:38:20 -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 A394BA6; Fri, 6 Oct 2023 08:38:18 -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 046A652050C; Fri, 6 Oct 2023 17:38:17 +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 17:38:16 +0200 From: Hardik Gajjar To: , , , , CC: , , , , Subject: [PATCH v3] usb: gadget: u_ether: Replace netif_stop_queue with netif_device_detach Date: Fri, 6 Oct 2023 17:38:08 +0200 Message-ID: <20231006153808.9758-1-hgajjar@de.adit-jv.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231006145332.8739-1-hgajjar@de.adit-jv.com> References: <20231006145332.8739-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 08:38:33 -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. Signed-off-by: Hardik Gajjar --- Changes since version 1: - Correct Singed-off user name and e-mail Changes since version 2: - Move change history below signed-off-by --- 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