Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp4205665rdb; Thu, 28 Dec 2023 14:00:24 -0800 (PST) X-Google-Smtp-Source: AGHT+IFq3irKjC+RA4kCSAS+KHPfyfdBeBz5Fp5ArNEFSK6oLGL7GsKPmiP5BHx0jJnb3cuFARI3 X-Received: by 2002:ac8:7c43:0:b0:427:8e04:f389 with SMTP id o3-20020ac87c43000000b004278e04f389mr20339435qtv.27.1703800824046; Thu, 28 Dec 2023 14:00:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703800824; cv=none; d=google.com; s=arc-20160816; b=Ks0yJIUXIvt8dwh3MlnSOuCcaqQpKNj1K+3uPewanhXZdWe//qaZ+zgPzn1JTL0D14 WvWIjOnSiV3swgEYLftCsROOaO0So9d2zR4Cm1nE4fXdJBP6lvT1LewlNg/2re4vDBGI ULUrKfJ6MCaog3Ngtt3UyRb9Dpj8+BJHQ8GKfiWcDfrazd7B3ZAMoO+2zt2bGZGWCTTX A97xrybSYKbfVtz5JFNGdEXJL9Zf/FGrKAG4d6QdZhex93+hfzdKlFouh5naGcNLfIVS hkg9xHIIzz7X5NtwNDrT0AhsRrKBLlSZ2ElL3QjdJv/jHQFe46mqq0tZi8iJDc438rEH ilzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=LgEGIQyRfeRyHPCX6/wQOZRpIUmt+wsH5bgEbO7v24Q=; fh=Ha6bq31M0f30lsPQuKDTSr/rMa8mQEaFto3BQtZ3oQ8=; b=PL5s1315gI2rFlShhx9A9CWfa3ZlWJgosjMZKPQCtOvLregF8H3Fd90vCislQwHZBW K+5Cfac0FO1SbLbP6NdNe6PzJS76fahzoKYUdEJk+N5uMNFaXiLBwUKYF6q5APldDS8N q9WBf6o3xtS4bqx2odXv5DanAnDbFFzUtmNSWCPb/15y6yS2li7EhJ5iN67SnblbS6kT oe0ba/MAPhap0Hua4CsN0gIvIsJsAYfeRPkv+96bvGj7qDJmu8Rxk+IceJOQ07TNZytW /RzPibgTFpiESf6WbTZOPbRyJ07Dhe2wIEnmKTzpTNKZjcl2+HuPDVuwAnuUUIyZ2tYY LPmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=s1 header.b=uJgMq1LK; spf=pass (google.com: domain of linux-kernel+bounces-12867-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12867-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=z3ntu.xyz Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id e19-20020ac85dd3000000b004239cba1ce8si17592267qtx.571.2023.12.28.14.00.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Dec 2023 14:00:24 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-12867-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@z3ntu.xyz header.s=s1 header.b=uJgMq1LK; spf=pass (google.com: domain of linux-kernel+bounces-12867-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-12867-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=z3ntu.xyz Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B3E791C21F16 for ; Thu, 28 Dec 2023 22:00:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4513710A02; Thu, 28 Dec 2023 22:00:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=z3ntu.xyz header.i=@z3ntu.xyz header.b="uJgMq1LK" X-Original-To: linux-kernel@vger.kernel.org Received: from ahti.lucaweiss.eu (ahti.lucaweiss.eu [128.199.32.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9850E1095F; Thu, 28 Dec 2023 22:00:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=z3ntu.xyz Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=z3ntu.xyz DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=z3ntu.xyz; s=s1; t=1703800801; bh=jRxI4sUcGXVzqRs0DmQVhY8OELVqC2WR+H20U6gi5PA=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=uJgMq1LKFLUr5e7mCnCYPlG2CoGCPj6cY9l1P5tphocAHEn7ugK4NKErplKTJUX7w 1TFJ2pZhvwEcHnnRl2IfCujQ8OU22Dqf2NhZYBQZN7DLv5jamw42q2fxnAaWNpqcZ3 TjZGWQuYqVYXgX5SoOuuSF3ywIEXx6YODQcSCNjQ= From: Luca Weiss To: Greg Kroah-Hartman , Hardik Gajjar , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Richard Acayan Cc: Richard Acayan , Thorsten Leemhuis , Caleb Connolly Subject: Re: [PATCH] usb: gadget: u_ether: Re-attach netif device to mirror detachment Date: Thu, 28 Dec 2023 22:59:59 +0100 Message-ID: <4713072.LvFx2qVVIh@z3ntu.xyz> In-Reply-To: <20231218164532.411125-2-mailingradian@gmail.com> References: <20231218164532.411125-2-mailingradian@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" On Montag, 18. Dezember 2023 17:45:33 CET Richard Acayan wrote: > In 6.7-rc1, there was a netif_device_detach call added to the > gether_disconnect function. This clears the __LINK_STATE_PRESENT bit of > the netif device and suppresses pings (ICMP messages) and TCP connection > requests from the connected host. If userspace temporarily disconnects > the gadget, such as by temporarily removing configuration in the gadget > configfs interface, network activity should continue to be processed > when the gadget is re-connected. Mirror the netif_device_detach call > with a netif_device_attach call in gether_connect to fix re-connecting > gadgets. (+Cc Thorsten Leemhuis) This appears to fix the regression on a 6.7-rc5-based build for qcom-msm8974pro-fairphone-fp2, that the NCM network gadget doesn't work. I've also heard reports from qcom-sdm845 and a PXA1908-based phone (if I see this correctly) about issues on 6.7. In postmarketOS on the device side the usb0 interface doesn't get the IP address assigned correctly it seems, but it seems to behave a bit inconsistently - but always broken. Anyways, with this patch everything looks good again. I hope this makes it for 6.7 final still. Tested-by: Luca Weiss > > Link: https://gitlab.com/postmarketOS/pmaports/-/tree/6002e51b7090aeeb42947e0ca7ec22278d7227d0/main/postmarketos-base-ui/rootfs-usr-lib-NetworkManager-dispatcher.d-50-tethering.sh > Fixes: f49449fbc21e ("usb: gadget: u_ether: Replace netif_stop_queue with netif_device_detach") > Signed-off-by: Richard Acayan > --- > drivers/usb/gadget/function/u_ether.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/usb/gadget/function/u_ether.c b/drivers/usb/gadget/function/u_ether.c > index 9d1c40c152d8..3c5a6f6ac341 100644 > --- a/drivers/usb/gadget/function/u_ether.c > +++ b/drivers/usb/gadget/function/u_ether.c > @@ -1163,6 +1163,8 @@ struct net_device *gether_connect(struct gether *link) > if (netif_running(dev->net)) > eth_start(dev, GFP_ATOMIC); > > + netif_device_attach(dev->net); > + > /* on error, disable any endpoints */ > } else { > (void) usb_ep_disable(link->out_ep);