I have a USB 802.11n capable dongle that works fine in a netbook[3] but not 
in a server[2], which is where it was intended.  The sypmtom is a cessation 
of packet traffic followed by device timeout as described in urtwn(4).  
A similar problem was mentioned last year[1] on misc@, though the specific 
Realtek chipset involved was not posted.

I built a kernel with USB_DEBUG which enables URTWN_DEBUG, and while running 
with that test kernel I could not replicate the problem.  From that test, I 
understand that timing or a race condition are likely areas of research. It
aligns also with the slower system [3] not being able to replicate either.

I could use some help as I am unsure how to investigate further.  I tried
doubling the sc_tx_timer in if_urtwn.c from 5 to 10, with no effect, but 
that was just a stab in the dark.  Any suggestions for futher tests, or 
a whack with a cluestick would be welcome.

Thanks!

-Josh Grosse-

[1] http://marc.info/?t=134666801100001&r=1&w=2

[2] System that displays the timeout problem:

OpenBSD 5.4-current (GENERIC.MP) #82: Tue Oct 15 01:02:02 MDT 2013
    dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: Intel(R) Core(TM)2 Duo CPU E7200 @ 2.53GHz ("GenuineIntel" 686-class) 
1.60 GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,LONG,SSE3,DTES64,MWAIT,DS-CPL,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,LAHF,PERF
real mem  = 1072951296 (1023MB)
avail mem = 1043644416 (995MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 02/26/08, BIOS32 rev. 0 @ 0xf0010, SMBIOS 
rev. 2.4 @ 0xfb450 (24 entries)
bios0: vendor American Megatrends Inc. version "P1.90" date 02/26/2008
acpi0 at bios0: rev 0
acpi0: sleep states S0 S1 S4 S5
acpi0: tables DSDT FACP APIC MCFG OEMB
acpi0: wakeup devices PCI0(S4) USB1(S4) USB2(S4) USB3(S4) USB4(S4) EHCI(S4) 
PS2K(S4) PS2M(S4) UAR1(S4) SLAN(S4) P0PA(S4) SLPB(S4) HDAC(S5)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 266MHz
cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 Duo CPU E7200 @ 2.53GHz ("GenuineIntel" 686-class) 
2.53 GHz
cpu1: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,LONG,SSE3,DTES64,MWAIT,DS-CPL,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,LAHF,PERF
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 3, 24 pins
ioapic1 at mainbus0: apid 3 pa 0xfecc0000, version 3, 24 pins
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-255
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus -1 (P0P9)
acpiprt2 at acpi0: bus 3 (P0PA)
acpiprt3 at acpi0: bus 2 (NBPG)
acpiprt4 at acpi0: bus 128 (PCI1)
acpicpu0 at acpi0
acpicpu1 at acpi0
acpibtn0 at acpi0: SLPB
acpibtn1 at acpi0: PWRB
bios0: ROM list: 0xc0000/0xec00
cpu0: Enhanced SpeedStep disabled by BIOS
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "VIA PT894 Host" rev 0x00
viaagp0 at pchb0: v3
agp0 at viaagp0: aperture at 0xf8000000, size 0xf000000
pchb1 at pci0 dev 0 function 1 "VIA PT894 Host" rev 0x00
pchb2 at pci0 dev 0 function 2 "VIA PT894 Host" rev 0x00
pchb3 at pci0 dev 0 function 3 "VIA PT890 Host" rev 0x00
pchb4 at pci0 dev 0 function 4 "VIA PT894 Host" rev 0x00
"VIA PT894 IOAPIC" rev 0x00 at pci0 dev 0 function 5 not configured
pchb5 at pci0 dev 0 function 7 "VIA PT894 Host" rev 0x00
ppb0 at pci0 dev 1 function 0 "VIA VT8377 AGP" rev 0x00
pci1 at ppb0 bus 1
vga1 at pci1 dev 0 function 0 "NVIDIA GeForce 7600 GT" rev 0xa2
wsdisplay0 at vga1 mux 1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
ppb1 at pci0 dev 2 function 0 vendor "VIA", unknown product 0xa208 rev 0x00: 
apic 3 int 3
pci2 at ppb1 bus 2
pciide0 at pci0 dev 15 function 0 "VIA VT8237S SATA" rev 0x00: DMA
pciide0: using apic 2 int 21 for native-PCI interrupt
pciide1 at pci0 dev 15 function 1 "VIA VT82C571 IDE" rev 0x07: DMA, channel 0 
configured to compatibility, channel 1 configured to compatibility
wd0 at pciide1 channel 0 drive 0: <ST380011A>
wd0: 16-sector PIO, LBA48, 76319MB, 156301488 sectors
wd1 at pciide1 channel 0 drive 1: <ST3750640A>
wd1: 16-sector PIO, LBA48, 715404MB, 1465149168 sectors
wd0(pciide1:0:0): using PIO mode 4, DMA mode 2
wd1(pciide1:0:1): using PIO mode 4, DMA mode 2
wd2 at pciide1 channel 1 drive 0: <ExcelStor Technology J880>
wd2: 16-sector PIO, LBA48, 78533MB, 160836480 sectors
wd3 at pciide1 channel 1 drive 1: <QUANTUM FIREBALLlct20 40>
wd3: 8-sector PIO, LBA, 38172MB, 78177792 sectors
wd2(pciide1:1:0): using PIO mode 4, DMA mode 2
wd3(pciide1:1:1): using PIO mode 4, DMA mode 2
uhci0 at pci0 dev 16 function 0 "VIA VT83C572 USB" rev 0xb0: apic 2 int 20
uhci1 at pci0 dev 16 function 1 "VIA VT83C572 USB" rev 0xb0: apic 2 int 22
uhci2 at pci0 dev 16 function 2 "VIA VT83C572 USB" rev 0xb0: apic 2 int 21
uhci3 at pci0 dev 16 function 3 "VIA VT83C572 USB" rev 0xb0: apic 2 int 23
ehci0 at pci0 dev 16 function 4 "VIA VT6202 USB" rev 0x90: apic 2 int 21
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "VIA EHCI root hub" rev 2.00/1.00 addr 1
viapm0 at pci0 dev 17 function 0 "VIA VT8237S ISA" rev 0x00: SMI
iic0 at viapm0
spdmem0 at iic0 addr 0x50: 512MB DDR2 SDRAM non-parity PC2-5300CL5
spdmem1 at iic0 addr 0x52: 512MB DDR2 SDRAM non-parity PC2-5300CL5
pchb6 at pci0 dev 17 function 7 "VIA VT8251 VLINK" rev 0x00
vr0 at pci0 dev 18 function 0 "VIA RhineII-2" rev 0x7c: apic 2 int 23, address 
00:19:66:70:d9:d2
ukphy0 at vr0 phy 1: Generic IEEE 802.3u media interface, rev. 10: OUI 
0x004063, model 0x0032
pchb7 at pci0 dev 19 function 0 "VIA VT8237A" rev 0x00
ppb2 at pci0 dev 19 function 1 "VIA VT8237A" rev 0x00
pci3 at ppb2 bus 3
rl0 at pci3 dev 4 function 0 "Accton MPX 5030/5038" rev 0x10: apic 2 int 17, 
address 00:10:b5:89:f8:ba
rlphy0 at rl0 phy 0: RTL internal PHY
dc0 at pci3 dev 5 function 0 "Lite-On PNIC-II" rev 0x25: apic 2 int 18, address 
00:a0:cc:e3:42:d6
dcphy0 at dc0 phy 31: internal PHY
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "VIA UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "VIA UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 "VIA UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci3: USB revision 1.0
uhub4 at usb4 "VIA UHCI root hub" rev 1.00/1.00 addr 1
pci4 at mainbus0 bus 128
azalia0 at pci4 dev 1 function 0 "VIA HD Audio" rev 0x10: apic 2 int 17
azalia0: codecs: Realtek ALC662
audio0 at azalia0
isa0 at mainbus0
isadma0 at isa0
com0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
wbsio0 at isa0 port 0x2e/2: W83697HF rev 0x12
lm1 at wbsio0 port 0x290/8: W83697HF
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
umass0 at uhub0 port 1 configuration 1 interface 0 "SanDisk Cruzer Switch" rev 
2.00/1.26 addr 2
umass0: using SCSI over Bulk-Only
scsibus0 at umass0: 2 targets, initiator 0
sd0 at scsibus0 targ 1 lun 0: <SanDisk, Cruzer Switch, 1.26> SCSI3 0/direct 
removable serial.07815572030C74414F47
sd0: 3819MB, 512 bytes/sector, 7821312 sectors
urtwn0 at uhub0 port 2 "Realtek 802.11n WLAN Adapter" rev 2.00/2.00 addr 3
urtwn0: MAC/BB RTL8188CUS, RF 6052 1T1R, address e8:4e:06:11:3e:34
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
sd1 at scsibus2 targ 1 lun 0: <OPENBSD, SR RAID 1, 005> SCSI2 0/direct fixed
sd1: 76316MB, 512 bytes/sector, 156295794 sectors
softraid0: volume sd1 is roaming, it used to be sd0, updating metadata
root on sd1a (e0835866b9a0c17e.a) swap on sd1b dump on sd1b

[3] A much slower system where the device works fine:

OpenBSD 5.4-current (GENERIC.MP) #75: Fri Oct 11 15:14:17 MDT 2013
    dera...@i386.openbsd.org:/usr/src/sys/arch/i386/compile/GENERIC.MP
cpu0: Intel(R) Atom(TM) CPU N270 @ 1.60GHz ("GenuineIntel" 686-class) 1.60 GHz
cpu0: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,SSE3,DTES64,MWAIT,DS-CPL,EST,TM2,SSSE3,xTPR,PDCM,MOVBE,LAHF,PERF
real mem  = 1064497152 (1015MB)
avail mem = 1035350016 (987MB)
mainbus0 at root
bios0 at mainbus0: AT/286+ BIOS, date 04/18/11, BIOS32 rev. 0 @ 0xf0010, SMBIOS 
rev. 2.5 @ 0xf0720 (30 entries)
bios0: vendor American Megatrends Inc. version "1601" date 04/18/2011
bios0: ASUSTeK Computer INC. 1005HA
acpi0 at bios0: rev 0
acpi0: sleep states S0 S3 S4 S5
acpi0: tables DSDT FACP APIC MCFG OEMB HPET SSDT
acpi0: wakeup devices P0P2(S4) P0P1(S4) HDAC(S4) P0P4(S4) P0P8(S4) P0P5(S4) 
P0P7(S4) P0P9(S4) P0P6(S4)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: apic clock running at 133MHz
cpu0: mwait min=64, max=64, C-substates=0.2.2.0.2, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Atom(TM) CPU N270 @ 1.60GHz ("GenuineIntel" 686-class) 1.60 GHz
cpu1: 
FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,NXE,SSE3,DTES64,MWAIT,DS-CPL,EST,TM2,SSSE3,xTPR,PDCM,MOVBE,LAHF,PERF
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins
ioapic0: misconfigured as apic 0, remapped to apid 2
acpimcfg0 at acpi0 addr 0xe0000000, bus 0-63
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 2 (P0P5)
acpiprt2 at acpi0: bus 1 (P0P7)
acpiprt3 at acpi0: bus -1 (P0P6)
acpiec0 at acpi0
acpicpu0 at acpi0: C3, C2, C1, PSS
acpicpu1 at acpi0: C3, C2, C1, PSS
acpitz0 at acpi0: critical temperature is 88 degC
acpibat0 at acpi0: BAT0 model "1005HA" serial   type LION oem "ASUS"
acpiac0 at acpi0: AC unit offline
acpiasus0 at acpi0
acpibtn0 at acpi0: LID_
acpibtn1 at acpi0: SLPB
acpibtn2 at acpi0: PWRB
bios0: ROM list: 0xc0000/0xec00!
cpu0: Enhanced SpeedStep 1600 MHz: speeds: 1600, 1333, 1067, 800 MHz
pci0 at mainbus0 bus 0: configuration mode 1 (bios)
pchb0 at pci0 dev 0 function 0 "Intel 82945GME Host" rev 0x03
vga1 at pci0 dev 2 function 0 "Intel 82945GME Video" rev 0x03
intagp0 at vga1
agp0 at intagp0: aperture at 0xd0000000, size 0x10000000
inteldrm0 at vga1
drm0 at inteldrm0
inteldrm0: 1024x600
wsdisplay0 at vga1 mux 1: console (std, vt100 emulation)
wsdisplay0: screen 1-5 added (std, vt100 emulation)
"Intel 82945GM Video" rev 0x03 at pci0 dev 2 function 1 not configured
azalia0 at pci0 dev 27 function 0 "Intel 82801GB HD Audio" rev 0x02: msi
azalia0: codecs: Realtek ALC269
audio0 at azalia0
ppb0 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x02: apic 2 int 16
pci1 at ppb0 bus 4
ppb1 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x02: apic 2 int 17
pci2 at ppb1 bus 2
athn0 at pci2 dev 0 function 0 "Atheros AR9285" rev 0x01: apic 2 int 17
athn0: AR9285 rev 2 (1T1R), ROM rev 13, address 00:25:d3:8a:f6:b4
ppb2 at pci0 dev 28 function 3 "Intel 82801GB PCIE" rev 0x02: apic 2 int 19
pci3 at ppb2 bus 1
alc0 at pci3 dev 0 function 0 "Attansic Technology L2C" rev 0xc0: msi, address 
90:e6:ba:37:cf:5e
atphy0 at alc0 phy 0: F1 10/100/1000 PHY, rev. 11
uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x02: apic 2 int 23
uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x02: apic 2 int 19
uhci2 at pci0 dev 29 function 2 "Intel 82801GB USB" rev 0x02: apic 2 int 18
uhci3 at pci0 dev 29 function 3 "Intel 82801GB USB" rev 0x02: apic 2 int 16
ehci0 at pci0 dev 29 function 7 "Intel 82801GB USB" rev 0x02: apic 2 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 "Intel EHCI root hub" rev 2.00/1.00 addr 1
ppb3 at pci0 dev 30 function 0 "Intel 82801BAM Hub-to-PCI" rev 0xe2
pci4 at ppb3 bus 5
ichpcib0 at pci0 dev 31 function 0 "Intel 82801GBM LPC" rev 0x02: PM disabled
ahci0 at pci0 dev 31 function 2 "Intel 82801GBM AHCI" rev 0x02: msi, AHCI 1.1
scsibus0 at ahci0: 32 targets
sd0 at scsibus0 targ 0 lun 0: <ATA, ST9160314AS, 0002> SCSI3 0/direct fixed 
naa.5000c50019076592
sd0: 152627MB, 512 bytes/sector, 312581808 sectors
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 "Intel UHCI root hub" rev 1.00/1.00 addr 1
usb4 at uhci3: USB revision 1.0
uhub4 at usb4 "Intel UHCI root hub" rev 1.00/1.00 addr 1
isa0 at ichpcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pms0: Synaptics touchpad, firmware 7.2
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
npx0 at isa0 port 0xf0/16: reported by CPUID; using exception 16
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
uvideo0 at uhub0 port 2 configuration 1 interface 0 "GenesysLogic Technology 
Co. III, Ltd. USB2.0 UVC 1.3M WebCam" rev 2.00/16.01 addr 2
video0 at uvideo0
vscsi0 at root
scsibus1 at vscsi0: 256 targets
softraid0 at root
scsibus2 at softraid0: 256 targets
root on sd0a (48b9941ca32383be.a) swap on sd0b dump on sd0b

Reply via email to