Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp435880rdb; Fri, 6 Oct 2023 07:52:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEeGL7zsuAaoqlu+oukNuGrJYt/SD9bZnC/FhLxlJSnCgNrzE7KCbYmf5t5LIq1JDf9ltqi X-Received: by 2002:a17:902:c411:b0:1c3:e2eb:f79d with SMTP id k17-20020a170902c41100b001c3e2ebf79dmr7743104plk.8.1696603969467; Fri, 06 Oct 2023 07:52:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696603969; cv=none; d=google.com; s=arc-20160816; b=T3pIDY9kTkhmMKVxX+2pAabzVfad0ZHMKRk0i/QC1kFc9t5CqxqCBvIjKGwyQXLXPi XqyyQe9tmYAybC9G/5BAs70z6l3KPg2JvrNzsIDBx5cnkb8OOA4zGu2t1vGqkUcWFCuX XwAdKCKQ0PrFEUbNDryt+SYqW0TaRJOYI/xInEZ7Irt9igpXQEgW0xHvALpQBB8o/UQI 7Nl0V9mvupiii/GIQOkH0lnDE27B6RIqXhBGJ83DgcYECNnKGo2Jt3feklh0JG+frCwq VjfHsuSRws/Z0soMkhiFM0cNgy7t2AM9arbQ/UjxKC8V4WI3ltOly8Xw7z2Qho+0IPmc sc/A== 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=1MX/urZbtxMAFfGwk+//ycsZvefIBZso6Hi23FabsFg=; fh=J372RQxIUYoWqHq2IFKMIZ/KexeneKiRjTNlN3d14/o=; b=l9+Ac7BJkk/5rWQqGZtVx6L5VVAUzR5DmPM5kOFX1ENsshAXJysjriK1qdk4yD1vHV FSvR2f4OilJvPjjYYKGkXDFItgiVv2nqdW8tACnwTiSd2ThBjLLyQUWsY5lvY6NuFHmn ri2BLbjF1WyjFpLtfl3VIQqRFWCIa8cPameKo/sBwf2JZbfAIxTjdtFqlzOls4A0rJp7 n8xO3XxNXWj86278y89hC2P4oJnlLhVG/PDw1+2Fuyg3Avf13a2vCBWXuKU94CUo15H0 EoPGA8G4rRwcHFOFLwywnECWjItYeBx5ywiYiNB79Prez0PDugGAkXgCQtFl7Zrc4glk IxzA== 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:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id u15-20020a170903124f00b001c60e273252si3982955plh.25.2023.10.06.07.52.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 07:52:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 snail.vger.email (Postfix) with ESMTP id 60CD08059E4B; Fri, 6 Oct 2023 07:50:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232664AbjJFOut (ORCPT + 99 others); Fri, 6 Oct 2023 10:50:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232658AbjJFOur (ORCPT ); Fri, 6 Oct 2023 10:50:47 -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 DA5FAE4; Fri, 6 Oct 2023 07:50:45 -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 4E5FA5206A7; Fri, 6 Oct 2023 16:50:44 +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:50:44 +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:50:36 +0200 Message-ID: <20231006145036.8668-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=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Fri, 06 Oct 2023 07:50:52 -0700 (PDT) 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