NetBSD Problem Report #55329

From www@netbsd.org  Sun May 31 15:42:43 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 0AA0D1A9218
	for <gnats-bugs@gnats.NetBSD.org>; Sun, 31 May 2020 15:42:43 +0000 (UTC)
Message-Id: <20200531154242.34CC51A921A@mollari.NetBSD.org>
Date: Sun, 31 May 2020 15:42:42 +0000 (UTC)
From: rspmn@arcor.de
Reply-To: rspmn@arcor.de
To: gnats-bugs@NetBSD.org
Subject: ugensa(4)/u3g(4): duplicated USB_VENDOR_SIERRA USB_PRODUCT_SIERRA_USB305 entry
X-Send-Pr-Version: www-1.0

>Number:         55329
>Category:       kern
>Synopsis:       ugensa(4)/u3g(4): duplicated USB_VENDOR_SIERRA USB_PRODUCT_SIERRA_USB305 entry
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    kern-bug-people
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 31 15:45:00 +0000 2020
>Closed-Date:    Wed Aug 02 15:47:37 +0000 2023
>Last-Modified:  Wed Aug 02 15:47:37 +0000 2023
>Originator:     Reinhard Speyerer
>Release:        NetBSD 9.0
>Organization:
>Environment:
NetBSD netbsd 9.0 NetBSD 9.0 (GENERIC) #0: Fri Feb 14 00:06:28 UTC 2020  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/i386/compile/GENERIC i386
>Description:
Support for USB_VENDOR_SIERRA USB_PRODUCT_SIERRA_USB305 devices was added
to both ugensa(4) and u3g(4) in PR #43468 ("Add Sierra Wireless USB 305
Support to ugensa device"). The corresponding USB PID 0x68a3 is also used
by newer devices like MC8704 and MC7700/MC7710 which provide several
serial ports like this (unsupported entries deleted):

at!udusbcomp=?
0  - HIP  DM    NMEA  AT    MDM1  MDM2  MDM3  MS  SUPPORTED
2  - HIP  DM    NMEA  AT    NIC1  MS              SUPPORTED
3  - HIP  DM    NMEA  AT    MDM1  NIC1  MS        SUPPORTED
4  - HIP  DM    NMEA  AT    NIC1  NIC2  NIC3  MS  SUPPORTED
5  - HIP  DM    NMEA  AT    ECM1  MS              SUPPORTED
OK

Since ugensa(4) wins when attaching to the device and since it only
supports a single serial port the AT port for these devices is not
available.

>How-To-Repeat:
Connect a Sierra Wireless device with USB PID 0x68a3 which has several
serial ports (e.g. a MC7710 set to AT!UDPID=68a3) to a USB port and check
dmesg(1) output:

[ 346.1530744] ugensa0 at uhub5 port 2
[ 346.1530744] ugensa0: Sierra Wireless, Incorporated (0x1199) MC7710 (0x68a3), rev 2.00/0.06, addr 4
[ 346.1530744] ucom4 at ugensa0: Generic Serial Device

>Fix:
Apply this patch

--- ugensa.c.orig	2019-05-09 04:43:35.000000000 +0200
+++ ugensa.c	2020-05-20 19:07:11.000000000 +0200
@@ -90,3 +90,2 @@
 	{{ USB_VENDOR_QUALCOMM_K, USB_PRODUCT_QUALCOMM_K_CDMA_MSM_K }, 0 },
-	{{ USB_VENDOR_SIERRA, USB_PRODUCT_SIERRA_USB305 }, 0 },
 	{{ USB_VENDOR_ZTE, USB_PRODUCT_ZTE_AC8700 }, 0 },

to the NetBSD 9.0 sources and rebuild the kernel. After reboot:

[   363.433249] u3g0 at uhub5 port 2 configuration 1 interface 0
[   363.433249] ucom4 at u3g0 portno 0: 3G Modem
[   363.433249] u3g1 at uhub5 port 2 configuration 1 interface 1
[   363.433249] ucom5 at u3g1 portno 0: 3G Modem
[   363.433249] u3g_match: failed to get interface, err=INVAL
[   363.433249] cdce0 at uhub5 port 2 configuration 1 interface 12
[   363.433249] cdce0: Sierra Wireless, Incorporated (0x1199) MC7710 (0x68a3), rev 2.00/0.06, addr 4
[   363.443255] cdce0: Ethernet address 00:a0:c6:00:00:00

Now the HIP and DM ports are available but not the AT port.
This will be fixed in my u3g.c patch next.

>Release-Note:

>Audit-Trail:
From: "Nick Hudson" <skrll@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55329 CVS commit: src/sys/dev/usb
Date: Fri, 5 Jun 2020 08:01:49 +0000

 Module Name:	src
 Committed By:	skrll
 Date:		Fri Jun  5 08:01:49 UTC 2020

 Modified Files:
 	src/sys/dev/usb: ugensa.c

 Log Message:
 Remove duplicated USB_VENDOR_SIERRA USB_PRODUCT_SIERRA_USB305 entry

 PR kern/55329


 To generate a diff of this commit:
 cvs rdiff -u -r1.41 -r1.42 src/sys/dev/usb/ugensa.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->pending-pullups
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Sun, 07 Jun 2020 12:22:28 +0000
State-Changed-Why:
[pullup-9 #948] Sierra Wireless USB 305 fixes


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55329 CVS commit: [netbsd-9] src/sys/dev/usb
Date: Sun, 7 Jun 2020 17:03:11 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sun Jun  7 17:03:11 UTC 2020

 Modified Files:
 	src/sys/dev/usb [netbsd-9]: u3g.c ugensa.c

 Log Message:
 Pull up following revision(s) (requested by skrll in ticket #948):

 	sys/dev/usb/ugensa.c: revision 1.42
 	sys/dev/usb/u3g.c: revision 1.41

 Remove duplicated USB_VENDOR_SIERRA USB_PRODUCT_SIERRA_USB305 entry
 PR kern/55329

 Replace calls to usbd_device2interface_handle in u3g_match() and
 u3g_attach() with the interface already passed in uiaa->uiaa_iface and
 store the interface in sc->sc_iface for later use by u3g_open()/

 Also skip Direct IP interfaces in u3g_match() to avoid potential side
 effects.

 PR kern/55330


 To generate a diff of this commit:
 cvs rdiff -u -r1.37.2.1 -r1.37.2.2 src/sys/dev/usb/u3g.c
 cvs rdiff -u -r1.39 -r1.39.2.1 src/sys/dev/usb/ugensa.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Wed, 02 Aug 2023 15:47:37 +0000
State-Changed-Why:
fixed in HEAD (prior to 10 branch), pulled up to 9
(follow up if this matters for 8)


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.47 2022/09/11 19:34:41 kim Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2023 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.