From owner-freebsd-usb@freebsd.org Tue Sep 1 15:04:52 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 7102E3CB2C2 for ; Tue, 1 Sep 2020 15:04:52 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from mailman.nyi.freebsd.org (unknown [127.0.1.3]) by mx1.freebsd.org (Postfix) with ESMTP id 4Bgr2r2LV2z4dg7 for ; Tue, 1 Sep 2020 15:04:52 +0000 (UTC) (envelope-from ian@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 5070F3CB2C1; Tue, 1 Sep 2020 15:04:52 +0000 (UTC) Delivered-To: usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 503AC3CB317 for ; Tue, 1 Sep 2020 15:04:52 +0000 (UTC) (envelope-from ian@freebsd.org) Received: from outbound2k.ore.mailhop.org (outbound2k.ore.mailhop.org [54.148.219.64]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4Bgr2q66dgz4f6w for ; Tue, 1 Sep 2020 15:04:51 +0000 (UTC) (envelope-from ian@freebsd.org) ARC-Seal: i=1; a=rsa-sha256; t=1598972690; cv=none; d=outbound.mailhop.org; s=arc-outbound20181012; b=ILvkxouPAxdgVk1LiN5tGfKbvEvSEFhytnU/LlHsdldakWmcf7kERKzOxIcotgFRLJhzQKoZphjZd W7o18Y2BNH8UYYolZEewhhz31L7U9Mz6s6okOUQ7xJbGRDUtr4Af15gQ4Lvf+uXB21BPGWerwGjrDN dxUXD5zZajphMUZtmxilCx4nVGZSO+CPI04XnjNC9cW+q316YQJJYnrsJiVvDSRU14NN7lldZ/v1uJ XiCdjLE8WFn2tq5BfyiabcKxO16vUgPXusEKyCKq6n/C86HgcYpTkWCLT+UlaCZ0/u7PR+FXFTrKES zDawE9gtOOpzLdIyhG9k2AlYYiYjD+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=arc-outbound20181012; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:dkim-signature:from; bh=7W8II7mMCB0AcE6KmUDKhVAMF4aXHQVlXWjPG6axtXs=; b=ZD0IgsQBc5WzBxEwbzTwt+VsU3nGdN3nwGUQpv+bJ4lef7sZPLYEgiRlRZwsuA8tYVhc/FP9MQv+u 8bZJAMb4KMHG9ISwAO3uELrcAov5ZKE340TBcZOzf34qbdTlKgrfgBN5C5wAmRcpU/Ic3dH7vxPRfS OH6yghEyuIqdLVi4A/r/OdfqD5sHOA5kLAENvtpOGCXscXIHv4WfoCcUVJd0AfhF/A8dipKZ8jQMXd NsZtLwPgcYMvzLyj++j77F0nvIZ4eH1BnMZSObiAfilGngVtyjcw+737aPPQCrkQfHlFxihJTZfuiP mtTrfjWMUI9VmdUksp9R2/8eq4IFcKw== ARC-Authentication-Results: i=1; outbound4.ore.mailhop.org; spf=softfail smtp.mailfrom=freebsd.org smtp.remote-ip=67.177.211.60; dmarc=none header.from=freebsd.org; arc=none header.oldest-pass=0; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=outbound.mailhop.org; s=dkim-high; h=content-transfer-encoding:mime-version:content-type:references:in-reply-to: date:to:from:subject:message-id:from; bh=7W8II7mMCB0AcE6KmUDKhVAMF4aXHQVlXWjPG6axtXs=; b=fVXJCBp2HOu3zTiRs5/tlXvlDgHcoVHEl1dhMYQT8pRcMuCbSNa0DXSGac1b790gCkqRaw14ZcavK s7u/rmSHnz8WhSPApaNXu60jJhhw2Y/ZGKiKeETWy/RvLrVTbBd0+0shi0GD8+O9NbAb9l++SrDxtC AygaSNhxUGuyMIc72X5widrUAZvyupy22VyvFOFL/LcDQ47Vh3Xl/2NkhDFTG7bTSiNc0KKydmPt7L Lcwr2fWe2Hr0WC1bhVELtye0IkQr/ZUFFQl+kuEuaNQFChwMlOrTGvH6fVeUmaen+U/bF+02c75HT4 D3FAcEaRSV2aE0slbP32o1yg1n0YdMg== X-MHO-RoutePath: aGlwcGll X-MHO-User: 790388be-ec64-11ea-9e11-df46ed8f892f X-Report-Abuse-To: https://support.duocircle.com/support/solutions/articles/5000540958-duocircle-standard-smtp-abuse-information X-Originating-IP: 67.177.211.60 X-Mail-Handler: DuoCircle Outbound SMTP Received: from ilsoft.org (c-67-177-211-60.hsd1.co.comcast.net [67.177.211.60]) by outbound4.ore.mailhop.org (Halon) with ESMTPSA id 790388be-ec64-11ea-9e11-df46ed8f892f; Tue, 01 Sep 2020 15:04:49 +0000 (UTC) Received: from rev (rev [172.22.42.240]) by ilsoft.org (8.15.2/8.15.2) with ESMTP id 081F4joH041460; Tue, 1 Sep 2020 09:04:45 -0600 (MDT) (envelope-from ian@freebsd.org) Message-ID: <16a7523227a32a4551f4459c06101f1ca0206e9b.camel@freebsd.org> Subject: Re: USB-dongle modem keeps changing from cuaU0 to cuaU1 and bck From: Ian Lepore To: Willem Jan Withagen , Hans Petter Selasky , usb@freebsd.org Date: Tue, 01 Sep 2020 09:04:45 -0600 In-Reply-To: <5a58c96d-81f5-cb7d-16c5-c28250aeed7f@digiware.nl> References: <8ffb4077-b0cb-ed0c-bd86-9fa164ae140d@digiware.nl> <4007b388-4f62-bcfc-1003-0ad2f079c1d4@selasky.org> <5a58c96d-81f5-cb7d-16c5-c28250aeed7f@digiware.nl> Content-Type: text/plain; charset="ASCII" X-Mailer: Evolution 3.28.5 FreeBSD GNOME Team Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4Bgr2q66dgz4f6w X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [0.00 / 15.00]; local_wl_from(0.00)[freebsd.org]; ASN(0.00)[asn:16509, ipnet:54.148.0.0/15, country:US] X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 01 Sep 2020 15:04:52 -0000 On Tue, 2020-09-01 at 16:23 +0200, Willem Jan Withagen wrote: > On 1-9-2020 16:10, Hans Petter Selasky wrote: > > On 2020-09-01 15:54, Willem Jan Withagen wrote: > > > Could it be because the dongle itself crashes? > > > > Yes, if they reboot or there are disturbances on the USB cables, then > > a new index number may be assigned during re-enumeration. > > There is no hub or something in between, and it is directly connected. > So I'm guessing that the modem resets/reboots. > > Let's see if devd can help. > > It does not happen very often, but now already twice on a day that it > should have worked. > 8-( > > --WjW > A typical scenario when this problem happens is: - cuaU0 is opened by an app. - Something Happens(tm) to make the device disconnect from the bus, but cuaU0 is still open by the app so the devfs node remains. - The transient problems clears, the bus is re-enumerated, but since cuaU0 is still in use by the app, cuaU1 gets assigned. - Eventually the app tries to read from cuaU0 and gets an error return from the read and closes the device, freeing cuaU0 in devfs. If you use devd rules to assign a particular alias based on the device's serial number or bus:hub:port tuples, the same underlying problem is going to be there: the app may still have the old device open and hasn't yet noticed that it has disappeared. If the way the alias is assigned is to create a symlink, and that's done using ln -fs then it may work out. But there may be some need to have the devd rule signal or kill/restart your app that's doing the monitoring. -- Ian