Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp479405rdb; Fri, 6 Oct 2023 08:57:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFJJ92NxtA9ewIclf0GA36BQ3Nf8oPTNVB/gPJCIw2yMgBFauhYgrJuPrBBojANiKMRIp84 X-Received: by 2002:a9d:6206:0:b0:6c6:4843:2ac5 with SMTP id g6-20020a9d6206000000b006c648432ac5mr9060786otj.21.1696607829346; Fri, 06 Oct 2023 08:57:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696607829; cv=none; d=google.com; s=arc-20160816; b=oNAl4cNR2TDKW28Jhe72Sr5xDncLXiXZvJz6elbDM73TAjLoYcXpkKrE5XCrm5H4NP HVWhaqhdZ+4YqjZBqsqdRq6ihKBFo/tj36YAe6zB1LBdv9UtqajoggTDqL1ZzJKy8eco cASS/yOPotc6wnwTVYA3x5oiO45wLEU8PICCY1wjcj2d+Of+nO6794hVLu7DgH0QvC/F FAOd2ItnmeNfrOM69R+n9UZUFdn69Qix8exckC+Bbcde8YIDc7+Es/CXVfSxAmqUgShL fM6rI7X0H2vkt5grlDPCOmv2g8/5vOzZBuANDKJm66IibO3pJil74d3tfaOCZXXVe7tQ sHAw== 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=BwUCwF0DUFIOtt6ltK9cY1srHH/RX/2nJWYsjYdOQhU=; fh=fnE/bHGRt0bnLs/gLT7CmmXLtlYO+uB6FxtaiV5G/9U=; b=cUaW42N4dk9ZEb8VIxRuC1CZMBkbSl+8FBntZNFcSTlvmbj1DfTz5oDVOz8Ar4pNpS g6ld0lpAO0x1vOFHBAnLTr+VMozYacAqV40MZhFS6JWMY5ujnfOvt9DcQ1jNB66gYqGL uDZdwiHdXPbzq4uLWLSF9tmW+zXK4yn+yZfe7Gp7ZsaYJa3gXbdgbE44SPX3ZuVYJOJW fHPMo8SLH0EXLiA2Svm8EjYytKy6InXIWzAGJE9ETsgv95NGCcbj5Y4SUaayrQs4Zfuv nyfSCEqFtdwcB+QmZrYZtyJv69BLVoHMyf3s7PepJTKFwjtvcADxbEnT7+79spz7f82L HwOw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id 6-20020a630a06000000b00578a56a39dbsi3954730pgk.409.2023.10.06.08.57.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 08:57:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id 1E25081ADD79; Fri, 6 Oct 2023 08:57:06 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232887AbjJFP46 (ORCPT + 99 others); Fri, 6 Oct 2023 11:56:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50528 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232850AbjJFP44 (ORCPT ); Fri, 6 Oct 2023 11:56:56 -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 90370AD; Fri, 6 Oct 2023 08:56:55 -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 476F852050C; Fri, 6 Oct 2023 17:56:54 +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:56:54 +0200 From: Hardik Gajjar To: , , , , CC: , , , , Subject: [PATCH v4] usb: gadget: u_ether: Replace netif_stop_queue with netif_device_detach Date: Fri, 6 Oct 2023 17:56:46 +0200 Message-ID: <20231006155646.12938-1-hgajjar@de.adit-jv.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20231006153808.9758-1-hgajjar@de.adit-jv.com> References: <20231006153808.9758-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 agentk.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 (agentk.vger.email [0.0.0.0]); Fri, 06 Oct 2023 08:57:06 -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 Changes since version 3: - move netif_device_detach from eth_stop to gether_disconnect. --- 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