NetBSD Problem Report #52526

From gson@gson.org  Mon Sep  4 17:46:08 2017
Return-Path: <gson@gson.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 22AA77A180
	for <gnats-bugs@gnats.NetBSD.org>; Mon,  4 Sep 2017 17:46:08 +0000 (UTC)
Message-Id: <20170904174601.A9124989071@guava.gson.org>
Date: Mon,  4 Sep 2017 20:46:01 +0300 (EEST)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: Panic on "ifconfig athn0 down"
X-Send-Pr-Version: 3.95

>Number:         52526
>Category:       kern
>Synopsis:       Panic on "ifconfig athn0 down"
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Sep 04 17:50:00 +0000 2017
>Last-Modified:  Thu Jun 25 16:35:00 +0000 2020
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current, source date 2017.07.21.02.51.12
>Organization:

>Environment:
System: NetBSD
Architecture: i386
Machine: i386
>Description:

I'm trying to get a USB WiFi adapter to work on a NetBSD-current/i386 system,
without much success.  At one point during the process I entered the command
"ifconfig athn0 down", and the machine paniced as follows:

  (gdb) where
  #0  0xc011dd95 in maybe_dump (howto=260) at /bracket/prod/current/src/sys/arch/i386/i386/machdep.c:708
  #1  cpu_reboot (howto=howto@entry=260, bootstr=bootstr@entry=0x0) at /bracket/prod/current/src/sys/arch/i386/i386/machdep.c:729
  #2  0xc092c540 in vpanic (fmt=fmt@entry=0xc0f526ce "trap", ap=ap@entry=0xd9570b08 "\220\vW\331\220\vW\331\001") at /bracket/prod/current/src/sys/kern/subr_prf.c:342
  #3  0xc092c5ca in panic (fmt=fmt@entry=0xc0f526ce "trap") at /bracket/prod/current/src/sys/kern/subr_prf.c:258
  #4  0xc012063f in trap (frame=0xd9570b90) at /bracket/prod/current/src/sys/arch/i386/i386/trap.c:325
  #5  0xc0116f5f in alltraps ()
  #6  0xd9570b90 in ?? ()
  #7  0xc0392a46 in usb_transfer_complete (xfer=xfer@entry=0xc2867624) at /bracket/prod/current/src/sys/dev/usb/usbdi.c:941
  #8  0xc057e516 in uhci_abort_xfer (xfer=<optimized out>, status=<optimized out>) at /bracket/prod/current/src/sys/dev/usb/uhci.c:2423
  #9  0xc0391978 in usbd_ar_pipe (pipe=pipe@entry=0xc27a4e48) at /bracket/prod/current/src/sys/dev/usb/usbdi.c:880
  #10 0xc039275c in usbd_abort_pipe (pipe=0xc27a4e48) at /bracket/prod/current/src/sys/dev/usb/usbdi.c:668
  #11 0xc040d991 in athn_usb_stop_locked (ifp=ifp@entry=0xc2119ae4) at /bracket/prod/current/src/sys/dev/usb/if_athn_usb.c:2937
  #12 0xc040db9b in athn_usb_stop (ifp=0xc2119ae4, disable=0) at /bracket/prod/current/src/sys/dev/usb/if_athn_usb.c:2907
  #13 0xc040e6f7 in athn_usb_ioctl (ifp=0xc2119ae4, cmd=2156947728, data=0xc29af3c8) at /bracket/prod/current/src/sys/dev/usb/if_athn_usb.c:2676
  #14 0xc09c217e in doifioctl (so=0xc29a26a4, cmd=2156947728, data=0xc29af3c8, l=0xc27cc2a0) at /bracket/prod/current/src/sys/net/if.c:3042
  #15 0xc094381c in soo_ioctl (fp=0xc2988bc0, cmd=2156947728, data=0xc29af3c8) at /bracket/prod/current/src/sys/kern/sys_socket.c:202
  #16 0xc0937714 in sys_ioctl (l=0xc27cc2a0, uap=0xd9570f68, retval=0xd9570f60) at /bracket/prod/current/src/sys/kern/sys_generic.c:671
  #17 0xc015a37d in sy_call (rval=0xd9570f60, uap=0xd9570f68, l=0xc27cc2a0, sy=0xc12390d8 <sysent+1080>) at /bracket/prod/current/src/sys/sys/syscallvar.h:65
  #18 sy_invoke (code=54, rval=0xd9570f60, uap=0xd9570f68, l=0xc27cc2a0, sy=0xc12390d8 <sysent+1080>) at /bracket/prod/current/src/sys/sys/syscallvar.h:94
  #19 syscall (frame=0xd9570fa8) at /bracket/prod/current/src/sys/arch/x86/x86/syscall.c:144
  #20 0xc0100696 in Xsyscall ()
  #21 0xd9570fa8 in ?? ()

This is the same Comfast CF-WU871N adapter as in PR 51531.

>How-To-Repeat:

>Fix:

>Audit-Trail:
From: Nick Hudson <skrll@netbsd.org>
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: kern/52526: Panic on "ifconfig athn0 down"
Date: Tue, 5 Sep 2017 08:51:22 +0100

 On 09/04/17 18:50, Andreas Gustafsson wrote:
 >> Number:         52526
 >> Category:       kern
 >> Synopsis:       Panic on "ifconfig athn0 down"
 [snip]
 >> I'm trying to get a USB WiFi adapter to work on a NetBSD-current/i386 system,
 >> without much success.  At one point during the process I entered the command
 >> "ifconfig athn0 down", and the machine paniced as follows:
 >>
 >>    (gdb) where
 >>    #0  0xc011dd95 in maybe_dump (howto=260) at /bracket/prod/current/src/sys/arch/i386/i386/machdep.c:708
 >>    #1  cpu_reboot (howto=howto@entry=260, bootstr=bootstr@entry=0x0) at /bracket/prod/current/src/sys/arch/i386/i386/machdep.c:729
 >>    #2  0xc092c540 in vpanic (fmt=fmt@entry=0xc0f526ce "trap", ap=ap@entry=0xd9570b08 "\220\vW\331\220\vW\331\001") at /bracket/prod/current/src/sys/kern/subr_prf.c:342
 >>    #3  0xc092c5ca in panic (fmt=fmt@entry=0xc0f526ce "trap") at /bracket/prod/current/src/sys/kern/subr_prf.c:258
 >>    #4  0xc012063f in trap (frame=0xd9570b90) at /bracket/prod/current/src/sys/arch/i386/i386/trap.c:325
 >>    #5  0xc0116f5f in alltraps ()
 >>    #6  0xd9570b90 in ?? ()
 >>    #7  0xc0392a46 in usb_transfer_complete (xfer=xfer@entry=0xc2867624) at /bracket/prod/current/src/sys/dev/usb/usbdi.c:941

 Can you print the whole xfer from here, please?

 Thanks,
 Nick

From: matthew green <mrg@eterna.com.au>
To: Nick Hudson <skrll@netbsd.org>
Cc: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
    gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: re: kern/52526: Panic on "ifconfig athn0 down"
Date: Tue, 05 Sep 2017 18:15:00 +1000

 > >>    #7  0xc0392a46 in usb_transfer_complete (xfer=3Dxfer@entry=3D0xc28=
 67624) at /bracket/prod/current/src/sys/dev/usb/usbdi.c:941
 > =

 > Can you print the whole xfer from here, please?

 hmm, i wonder if this is:

 941         pipe->up_methods->upm_done(xfer);

 and the up_methods happens to be xhci_device_isoc_methods:

 232 static const struct usbd_pipe_methods xhci_device_isoc_methods =3D {
 233         .upm_cleartoggle =3D xhci_noop,
 234 };

 ie, does not set upm_done member.


 .mrg.

From: Andreas Gustafsson <gson@gson.org>
To: matthew green <mrg@eterna.com.au>
Cc: gnats-bugs@NetBSD.org
Subject: re: kern/52526: Panic on "ifconfig athn0 down"
Date: Sun, 17 Sep 2017 21:36:29 +0300

 On Sep 5, matthew green wrote:
 >  hmm, i wonder if this is:
 >  
 >  941         pipe->up_methods->upm_done(xfer);
 >  
 >  and the up_methods happens to be xhci_device_isoc_methods:
 >  
 >  232 static const struct usbd_pipe_methods xhci_device_isoc_methods =3D {
 >  233         .upm_cleartoggle =3D xhci_noop,
 >  234 };
 >  
 >  ie, does not set upm_done member.

 This was on uhci, not xhci.
 -- 
 Andreas Gustafsson, gson@gson.org

From: Masanobu SAITOH <msaitoh@execsw.org>
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: msaitoh@execsw.org
Subject: Re: kern/52526: Panic on "ifconfig athn0 down"
Date: Mon, 3 Jun 2019 19:05:04 +0900

 On 2017/09/05 2:50, Andreas Gustafsson wrote:
 >> Number:         52526
 >> Category:       kern
 >> Synopsis:       Panic on "ifconfig athn0 down"
 >> Confidential:   no
 >> Severity:       serious
 >> Priority:       high
 >> Responsible:    kern-bug-people
 >> State:          open
 >> Class:          sw-bug
 >> Submitter-Id:   net
 >> Arrival-Date:   Mon Sep 04 17:50:00 +0000 2017
 >> Originator:     Andreas Gustafsson
 >> Release:        NetBSD-current, source date 2017.07.21.02.51.12
 >> Organization:
 > 
 >> Environment:
 > System: NetBSD
 > Architecture: i386
 > Machine: i386
 >> Description:
 > 
 > I'm trying to get a USB WiFi adapter to work on a NetBSD-current/i386 system,
 > without much success.  At one point during the process I entered the command
 > "ifconfig athn0 down", and the machine paniced as follows:
 > 
 >   (gdb) where
 >   #0  0xc011dd95 in maybe_dump (howto=260) at /bracket/prod/current/src/sys/arch/i386/i386/machdep.c:708
 >   #1  cpu_reboot (howto=howto@entry=260, bootstr=bootstr@entry=0x0) at /bracket/prod/current/src/sys/arch/i386/i386/machdep.c:729
 >   #2  0xc092c540 in vpanic (fmt=fmt@entry=0xc0f526ce "trap", ap=ap@entry=0xd9570b08 "\220\vW\331\220\vW\331\001") at /bracket/prod/current/src/sys/kern/subr_prf.c:342
 >   #3  0xc092c5ca in panic (fmt=fmt@entry=0xc0f526ce "trap") at /bracket/prod/current/src/sys/kern/subr_prf.c:258
 >   #4  0xc012063f in trap (frame=0xd9570b90) at /bracket/prod/current/src/sys/arch/i386/i386/trap.c:325
 >   #5  0xc0116f5f in alltraps ()
 >   #6  0xd9570b90 in ?? ()
 >   #7  0xc0392a46 in usb_transfer_complete (xfer=xfer@entry=0xc2867624) at /bracket/prod/current/src/sys/dev/usb/usbdi.c:941
 >   #8  0xc057e516 in uhci_abort_xfer (xfer=<optimized out>, status=<optimized out>) at /bracket/prod/current/src/sys/dev/usb/uhci.c:2423
 >   #9  0xc0391978 in usbd_ar_pipe (pipe=pipe@entry=0xc27a4e48) at /bracket/prod/current/src/sys/dev/usb/usbdi.c:880
 >   #10 0xc039275c in usbd_abort_pipe (pipe=0xc27a4e48) at /bracket/prod/current/src/sys/dev/usb/usbdi.c:668
 >   #11 0xc040d991 in athn_usb_stop_locked (ifp=ifp@entry=0xc2119ae4) at /bracket/prod/current/src/sys/dev/usb/if_athn_usb.c:2937
 >   #12 0xc040db9b in athn_usb_stop (ifp=0xc2119ae4, disable=0) at /bracket/prod/current/src/sys/dev/usb/if_athn_usb.c:2907
 >   #13 0xc040e6f7 in athn_usb_ioctl (ifp=0xc2119ae4, cmd=2156947728, data=0xc29af3c8) at /bracket/prod/current/src/sys/dev/usb/if_athn_usb.c:2676
 >   #14 0xc09c217e in doifioctl (so=0xc29a26a4, cmd=2156947728, data=0xc29af3c8, l=0xc27cc2a0) at /bracket/prod/current/src/sys/net/if.c:3042
 >   #15 0xc094381c in soo_ioctl (fp=0xc2988bc0, cmd=2156947728, data=0xc29af3c8) at /bracket/prod/current/src/sys/kern/sys_socket.c:202
 >   #16 0xc0937714 in sys_ioctl (l=0xc27cc2a0, uap=0xd9570f68, retval=0xd9570f60) at /bracket/prod/current/src/sys/kern/sys_generic.c:671
 >   #17 0xc015a37d in sy_call (rval=0xd9570f60, uap=0xd9570f68, l=0xc27cc2a0, sy=0xc12390d8 <sysent+1080>) at /bracket/prod/current/src/sys/sys/syscallvar.h:65
 >   #18 sy_invoke (code=54, rval=0xd9570f60, uap=0xd9570f68, l=0xc27cc2a0, sy=0xc12390d8 <sysent+1080>) at /bracket/prod/current/src/sys/sys/syscallvar.h:94
 >   #19 syscall (frame=0xd9570fa8) at /bracket/prod/current/src/sys/arch/x86/x86/syscall.c:144
 >   #20 0xc0100696 in Xsyscall ()
 >   #21 0xd9570fa8 in ?? ()
 > 
 > This is the same Comfast CF-WU871N adapter as in PR 51531.
 > 
 >> How-To-Repeat:
 > 
 >> Fix:
 > 

 Do you still have this problem?
 Some changes have been added to athn(4) since September 2017, so this problem might be fixed now.

 -- 
 -----------------------------------------------
                 SAITOH Masanobu (msaitoh@execsw.org
                                  msaitoh@netbsd.org)

From: Andreas Gustafsson <gson@gson.org>
To: Masanobu SAITOH <msaitoh@execsw.org>
Cc: gnats-bugs@netbsd.org
Subject: Re: kern/52526: Panic on "ifconfig athn0 down"
Date: Fri, 14 Jun 2019 19:17:42 +0300

 Masanobu SAITOH wrote:
 >  Do you still have this problem?
 >  Some changes have been added to athn(4) since September 2017, so this problem might be fixed now.

 I'm not sure if it's still the same problem, but the driver is still
 causing panics.

 I re-tested with the same adapter but on a different system (amd64
 with ehci), using -current built from CVS source date
 2019.06.14.01.00.52.  The first time I ran my test script, the system
 rebooted.  If there were any messages on the console, they went by too
 fast to see them, and there was no kernel core dump, but I managed to
 fish out the console messages from dmesg after the reboot:

 [   751.004900] athn0 at uhub3 port 2
 [   752.483823] : Atheros AR9271
 [   752.483823] athn0: rev 1 (1T1R), ROM rev 15, address 48:5d:60:57:7d:4f
 [   752.879769] athn0: 11b rates: 1Mbps 2Mbps 5.5Mbps 11Mbps
 [   752.879769] athn0: 11g rates: 1Mbps 2Mbps 5.5Mbps 11Mbps 6Mbps 9Mbps 12Mbps 18Mbps 24Mbps 36Mbps 48Mbps 54Mbps
 [  2551.452330] panic: kernel diagnostic assertion "xfer->ux_status == USBD_CANCELLED || xfer->ux_status == USBD_TIMEOUT" failed: file "/tmp/bracket/build/2019.06.14.01.00.52-amd64-debug-baremetal/src/sys/dev/usb/ehci.c", line 1054 
 [  2551.452330] cpu0: Begin traceback...
 [  2551.452330] vpanic() at netbsd:vpanic+0x160
 [  2551.452330] stge_eeprom_wait.isra.4() at netbsd:stge_eeprom_wait.isra.4
 [  2551.452330] ehci_softintr() at netbsd:ehci_softintr+0x28b
 [  2551.452330] usb_soft_intr() at netbsd:usb_soft_intr+0x38
 [  2551.452330] softint_dispatch() at netbsd:softint_dispatch+0xf4
 [  2551.452330] DDB lost frame for netbsd:Xsoftintr+0x4f, trying 0xffffbb0050ea30f0
 [  2551.452330] Xsoftintr() at netbsd:Xsoftintr+0x4f
 [  2551.452330] --- interrupt ---
 [  2551.452330] ffffffffffffffff:
 [  2551.452330] cpu0: End traceback...

 [  2551.452330] dumping to dev 0,1 (offset=61361456, size=718638):
 [  2551.452330] dump [   1.0000000] Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
 [     1.000000] 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017,
 [     1.000000] 2018, 2019 The NetBSD Foundation, Inc.  All rights reserved.
 [     1.000000] Copyright (c) 1982, 1986, 1989, 1991, 1993
 [     1.000000] The Regents of the University of California.  All rights reserved.

 After the reboot, I ran the script several times more without a panic.
 I then ran some manual tests that included configuring the interface
 and starting dhcpcd on it, ran the script again, and it paniced again.

 The test script is as follows.  /etc/wpa_supplicant.conf contains
 a single "network" block with my WPA2 network's ssid and psk.

 iface=athn0
 wpa_supplicant -i $iface -c /etc/wpa_supplicant.conf >wpa_supplicant.log &
 wpa_supplicant_pid=$!
 echo pid $wpa_supplicant_pid
 #wpa_cli status
 # dhcpcd $iface
 ifconfig $iface 10.0.1.42 netmask 255.255.255.0
 #wpa_cli status
 ifconfig $iface
 ifconfig $iface up
 ifconfig $iface
 #wpa_cli status
 ping -n -c 20 10.0.1.1
 kill $wpa_supplicant_pid
 sleep 5
 ifconfig $iface
 ifconfig $iface down

 -- 
 Andreas Gustafsson, gson@gson.org

From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
    netbsd-bugs@netbsd.org, gson@gson.org (Andreas Gustafsson)
Subject: re: kern/52526: Panic on "ifconfig athn0 down"
Date: Sat, 15 Jun 2019 07:27:31 +1000

 i've been seeing odd panics with usb ethernet lately, the same sort
 of problem across several devices.  i saw the same problem on =

 cdce(4), axen(4), and ure(4).  this one looks the same as well.

 i suspect there is a new problem in if.c calls to if_start(), since
 the exact same problem occurs on all 3 for me, and 4th for you.

 inspired by mlelstv's changes to if_mue.c (providing a mutex around
 the if_start call, effectively), which seems to help some, but i
 still see crashes in cdce_start() fairly often, but the cause did
 change from two cases two one case.

 previously, it would crash with most likely this trace:

 panic: kernel diagnostic assertion "xfer->ux_state =3D=3D XFER_BUSY" faile=
 d: file "/usr/src/sys/dev/usb/usbdi.c", line 1039 xfer 0xffff0000f5cf7b80 =
 state is 9e
 fp ffffffc060998ab0 kern_assert() at ffffffc00058dc4c netbsd:kern_assert+0=
 x5c
 fp ffffffc060998b40 usb_insert_transfer() at ffffffc0000c6dd0 netbsd:usb_i=
 nsert_transfer+0xe0
 fp ffffffc060998b60 ehci_device_bulk_transfer() at ffffffc00016d54c netbsd=
 :ehci_device_bulk_transfer+0x2c
 fp ffffffc060998b90 usbd_transfer() at ffffffc0000c5a28 netbsd:usbd_transf=
 er+0x98
 fp ffffffc060998bc0 cdce_start() at ffffffc0000f5978 netbsd:cdce_start+0xa=
 8
 fp ffffffc060998bf0 cdce_txeof() at ffffffc0000f5b78 netbsd:cdce_txeof+0x1=
 18
 fp ffffffc060998c40 usb_transfer_complete() at ffffffc0000c6aa8 netbsd:usb=
 _transfer_complete+0x1c8
 fp ffffffc060998c90 ehci_softintr() at ffffffc00016e7d4 netbsd:ehci_softin=
 tr+0x174

 or less likely without the mutex, but *only* with the mutex:

 panic: kernel diagnostic assertion "xfer->ux_state =3D=3D XFER_BUSY" faile=
 d: file "/usr/src/sys/dev/usb/usbdi.c", line 1039 xfer 0xffff0000f5cf7b80 =
 state is 9e

 fp ffffffc06198f760 kern_assert() at ffffffc00058dccc netbsd:kern_assert+0=
 x5c
 fp ffffffc06198f7f0 usb_insert_transfer() at ffffffc0000c6dd0 netbsd:usb_i=
 nsert_transfer+0xe0
 fp ffffffc06198f810 ehci_device_bulk_transfer() at ffffffc00016d5cc netbsd=
 :ehci_device_bulk_transfer+0x2c
 fp ffffffc06198f840 usbd_transfer() at ffffffc0000c5a28 netbsd:usbd_transf=
 er+0x98
 fp ffffffc06198f870 cdce_start() at ffffffc0000f59a8 netbsd:cdce_start+0xb=
 8
 fp ffffffc06198f8b0 if_transmit() at ffffffc0004eabf0 netbsd:if_transmit+0=
 x150
 fp ffffffc06198f8f0 ether_output() at ffffffc0004f73e4 netbsd:ether_output=
 +0x244
 fp ffffffc06198f950 ip_if_output() at ffffffc00021e1bc netbsd:ip_if_output=
 +0xac
 fp ffffffc06198f990 ip_output() at ffffffc00021fa80 netbsd:ip_output+0x116=
 0

 the patch i'm using is below.


 .mrg.

 Index: if_cdce.c
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /cvsroot/src/sys/dev/usb/if_cdce.c,v
 retrieving revision 1.47
 diff -p -u -r1.47 if_cdce.c
 --- if_cdce.c	5 May 2019 03:17:54 -0000	1.47
 +++ if_cdce.c	14 Jun 2019 21:26:06 -0000
 @@ -271,6 +271,8 @@ cdce_attach(device_t parent, device_t se
  		eaddr[5] =3D (uint8_t)(device_unit(sc->cdce_dev));
  	}
  =

 +	mutex_init(&sc->cdce_start_lock, MUTEX_DEFAULT, IPL_NONE);
 +
  	s =3D splnet();
  =

  	aprint_normal_dev(self, "address %s\n", ether_sprintf(eaddr));
 @@ -326,6 +328,8 @@ cdce_detach(device_t self, int flags)
  	sc->cdce_attached =3D 0;
  	splx(s);
  =

 +	mutex_destroy(&sc->cdce_start_lock);
 +
  	return 0;
  }
  =

 @@ -338,12 +342,17 @@ cdce_start(struct ifnet *ifp)
  	if (sc->cdce_dying || (ifp->if_flags & IFF_OACTIVE))
  		return;
  =

 +	mutex_enter(&sc->cdce_start_lock);
 +
  	IFQ_POLL(&ifp->if_snd, m_head);
 -	if (m_head =3D=3D NULL)
 +	if (m_head =3D=3D NULL) {
 +		mutex_exit(&sc->cdce_start_lock);
  		return;
 +	}
  =

  	if (cdce_encap(sc, m_head, 0)) {
  		ifp->if_flags |=3D IFF_OACTIVE;
 +		mutex_exit(&sc->cdce_start_lock);
  		return;
  	}
  =

 @@ -353,6 +362,8 @@ cdce_start(struct ifnet *ifp)
  =

  	ifp->if_flags |=3D IFF_OACTIVE;
  =

 +	mutex_exit(&sc->cdce_start_lock);
 +
  	ifp->if_timer =3D 6;
  }
  =

 Index: if_cdcereg.h
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
 =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
 RCS file: /cvsroot/src/sys/dev/usb/if_cdcereg.h,v
 retrieving revision 1.9
 diff -p -u -r1.9 if_cdcereg.h
 --- if_cdcereg.h	23 Apr 2016 10:15:31 -0000	1.9
 +++ if_cdcereg.h	14 Jun 2019 21:26:06 -0000
 @@ -85,4 +85,6 @@ struct cdce_softc {
  	int			 cdce_rxeof_errors;
  	uint16_t		 cdce_flags;
  	char			 cdce_attached;
 +
 +	kmutex_t		 cdce_start_lock;
  };

From: "Jukka Ruohonen" <jruoho@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/52526 CVS commit: src/tests/sbin/ifconfig
Date: Thu, 25 Jun 2020 16:34:49 +0000

 Module Name:	src
 Committed By:	jruoho
 Date:		Thu Jun 25 16:34:49 UTC 2020

 Modified Files:
 	src/tests/sbin/ifconfig: t_repeated_updown.sh

 Log Message:
 Reference also PR kern/52526.


 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.2 src/tests/sbin/ifconfig/t_repeated_updown.sh

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

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.