Bug 191432 - FreeBSD 10.0-STABLE #0 r267746: panic when using ue0 network
Summary: FreeBSD 10.0-STABLE #0 r267746: panic when using ue0 network
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: 10.0-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-usb (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-27 09:36 UTC by Vikash Badal
Modified: 2015-07-08 17:37 UTC (History)
3 users (show)

See Also:


Attachments
core.txt (165.46 KB, text/plain)
2014-06-27 09:36 UTC, Vikash Badal
no flags Details
dmesg (54.40 KB, text/plain)
2014-06-27 09:37 UTC, Vikash Badal
no flags Details
pciconf -lv (4.03 KB, text/plain)
2014-06-27 09:37 UTC, Vikash Badal
no flags Details
usbconfig (884 bytes, text/plain)
2014-06-27 09:37 UTC, Vikash Badal
no flags Details
hw.usb.uhub.debug=16 dmesg (92.24 KB, text/plain)
2014-06-27 19:21 UTC, Vikash Badal
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Vikash Badal 2014-06-27 09:36:07 UTC
Created attachment 144187 [details]
core.txt

hardware:
Dell M3800

nic:
ugen2.4: <AX88179 ASIX Elec. Corp.> at usbus2, cfg=0 md=HOST spd=HIGH
(480Mbps) pwr=ON (248mA)


Unread portion of the kernel message buffer:
panic: vm_fault: fault on nofault entry, addr: fffffe02346f0000
cpuid = 0
KDB: stack backtrace:
#0 0xffffffff8092a2d0 at kdb_backtrace+0x60
#1 0xffffffff808ef825 at panic+0x155
#2 0xffffffff80b5f8e9 at vm_fault_hold+0x1a89
#3 0xffffffff80b5de17 at vm_fault+0x77
#4 0xffffffff80ce455c at trap_pfault+0x19c
#5 0xffffffff80ce3d80 at trap+0x4a0
#6 0xffffffff80cca7f2 at calltrap+0x8
#7 0xffffffff81c1687e at axge_bulk_read_callback+0x19e
#8 0xffffffff8079684c at usbd_callback_wrapper+0x71c
#9 0xffffffff80797ac3 at usb_command_wrapper+0x113
#10 0xffffffff80796a71 at usb_callback_proc+0xc1
#11 0xffffffff80791b8f at usb_process+0x11f
#12 0xffffffff808c03da at fork_exit+0x9a
#13 0xffffffff80ccad2e at fork_trampoline+0xe
Uptime: 10m38s
Comment 1 Vikash Badal 2014-06-27 09:37:01 UTC
Created attachment 144188 [details]
dmesg

verbose dmesg
Comment 2 Vikash Badal 2014-06-27 09:37:37 UTC
Created attachment 144189 [details]
pciconf -lv
Comment 3 Vikash Badal 2014-06-27 09:37:56 UTC
Created attachment 144190 [details]
usbconfig
Comment 4 commit-hook freebsd_committer freebsd_triage 2014-06-27 10:24:51 UTC
A commit references this bug:

Author: hselasky
Date: Fri Jun 27 10:24:36 UTC 2014
New revision: 267955
URL: http://svnweb.freebsd.org/changeset/base/267955

Log:
  Add proper rangechecks in "axge_rx_frame()" function and
  fix receive loop header parsing.

  MFC after:	3 days
  PR:		191432

Changes:
  head/sys/dev/usb/net/if_axge.c
Comment 5 Hans Petter Selasky freebsd_committer freebsd_triage 2014-06-27 10:28:21 UTC
Hi,

Please try the patch in the commit above! And report back!

Thank you!

--HPS
Comment 6 Vikash Badal 2014-06-27 13:50:05 UTC
appears to be much more stable 

but network speeds are terrible. < 2 MB/s 


Installing ubuntu 10.0.4 sees the bus as usb 3 but Freebsd sees it as 2.0

ubuntu 10.0.4 

T:  Bus=04 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=5000 MxCh= 6
D:  Ver= 3.00 Cls=09(hub  ) Sub=00 Prot=03 MxPS= 9 #Cfgs=  1
P:  Vendor=1d6b ProdID=0003 Rev=03.13
S:  Manufacturer=Linux 3.13.0-24-generic xhci_hcd
S:  Product=xHCI Host Controller
S:  SerialNumber=0000:00:14.0
C:  #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=0mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub

T:  Bus=04 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#=  5 Spd=5000 MxCh= 0
D:  Ver= 3.00 Cls=ff(vend.) Sub=ff Prot=00 MxPS= 9 #Cfgs=  1
P:  Vendor=0b95 ProdID=1790 Rev=01.00
S:  Manufacturer=ASIX Elec. Corp.
S:  Product=AX88179
S:  SerialNumber=00503F56011487
C:  #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=496mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=00 Driver=ax88179_178a


Freebsd

ugen2.1: <EHCI root HUB Intel> at usbus2, cfg=0 md=HOST spd=HIGH
(480Mbps) pwr=SAVE (0mA)


ehci1@pci0:0:29:0:      class=0x0c0320 card=0x060d1028 chip=0x8c268086
rev=0x05
hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Lynx Point USB Enhanced Host Controller'
    class      = serial bus
    subclass   = USB
Comment 7 Hans Petter Selasky freebsd_committer freebsd_triage 2014-06-27 14:12:00 UTC
Hi,

Try plugging the adapter a few times and see if appears like USB 3.0.

You are sure the USB  port you are using is USB 3.0 capable?

The USB 3.0 controller you have "Lynx Point" is know to require special quirks in order for USB 3.0 ports to become active. Please also check your BIOS settings.

--HPS
Comment 8 Vikash Badal 2014-06-27 14:31:58 UTC
using the same bios settings and port on a unbuntu install i get gigE speeds.

its a replacement laptop so at the moment i just do fresh installs using the same bios settings.

can you point me in the direction of the quirks required ?
Comment 9 Hans Petter Selasky freebsd_committer freebsd_triage 2014-06-27 14:36:16 UTC
Hi,

The Lynx Point needs some magic to enable proper port rounting. By default all ports are USB 2.0.

Possibly by putting the correct value into:

hw.usb.xhci.xhci_port_route

In /boot/loader.conf

It will work.

--HPS
Comment 10 Vikash Badal 2014-06-27 16:50:39 UTC
tried 
 hw.usb.xhci.xhci_port_route="0xFFFFFFFF"
hw.usb.xhci.xhci_port_route="0x0"
hw.usb.xhci.xhci_port_route="0x1"
hw.usb.xhci.xhci_port_route="0x2"
hw.usb.xhci.xhci_port_route="0x4"
hw.usb.xhci.xhci_port_route="0x8"

no luck
Comment 11 Hans Petter Selasky freebsd_committer freebsd_triage 2014-06-27 17:48:52 UTC
Hi,

Could you check with a tool like wireshark, if the network adapter has data loss. Can also be checked using "ifconfig ue0".

For example if you "ping -f -s 1500 xxx" to some local address, how much packet loss is there?

What I see in the dmesg, is that there is a device that has trouble enumerating. See the IO-ERROR. If you enable hw.usb.uhub.debug=16 you will see the portnumber.

BTW: You should try:

0x1
0x2
..
0x80000000

Because the device has many ports.

--HPS
Comment 12 Vikash Badal 2014-06-27 19:21:19 UTC
Created attachment 144199 [details]
hw.usb.uhub.debug=16 dmesg
Comment 13 Hans Petter Selasky freebsd_committer freebsd_triage 2014-06-28 19:38:12 UTC
Comment on attachment 144199 [details]
hw.usb.uhub.debug=16 dmesg

Hi,

You need to put the sysctl setting into:
/boot/loader.conf

Because the failing enumeration happens very early on.

--HPS
Comment 14 Vikash Badal 2014-06-30 07:37:55 UTC
Hi

I have place all those values in /boot/loader.conf and still no luck
Comment 15 Vikash Badal 2014-06-30 12:09:47 UTC
(In reply to Vikash Badal from comment #14)
> Hi
> 
> I have place all those values in /boot/loader.conf and still no luck


I'm not sure if this is an issue:

# dmesg | grep Port routing
xhci0: Port routing mask set to 0xfffffffb
xhci0: Port routing mask set to 0x00000000

# sysctl -a | grep xhci_port
hw.usb.xhci.xhci_port_route: 4

# cat /boot/loader.conf
hw.usb.xhci.xhci_port_route="0x4"


does not matter what i set hw.usb.xhci.xhci_port_route to in /boot/loader.conf,
the last entry from dmesg matching routing is always

xhci0: Port routing mask set to 0x00000000
Comment 16 Hans Petter Selasky freebsd_committer freebsd_triage 2014-06-30 15:11:19 UTC
Can you check if your BIOS has any USB settings?

--HPS
Comment 17 Vikash Badal 2014-06-30 16:49:42 UTC
(In reply to Hans Petter Selasky from comment #16)
> Can you check if your BIOS has any USB settings?
> 
> --HPS

Current options:

USB Emulation    => enabled        tried with disabled
USB Powershare   => disabled
USB Wake support => disabled


External USB Ports  => Enabled     With disabled not ports are usable
USB debug           => Disabled    tried with Enabled
Comment 18 Hans Petter Selasky freebsd_committer freebsd_triage 2014-07-01 08:35:52 UTC
There are no BIOS settings to select SuperSpeed or HighSpeed USB mode of the USB ports?

--HPS
Comment 19 Vikash Badal 2014-07-01 16:44:46 UTC
(In reply to Hans Petter Selasky from comment #18)
> There are no BIOS settings to select SuperSpeed or HighSpeed USB mode of the
> USB ports?
> 
> --HPS

None.
Comment 20 Kevin Lo freebsd_committer freebsd_triage 2014-07-02 02:39:26 UTC
(In reply to Vikash Badal from comment #0)
> Created attachment 144187 [details]
> core.txt
> 
> hardware:
> Dell M3800
> 
> nic:
> ugen2.4: <AX88179 ASIX Elec. Corp.> at usbus2, cfg=0 md=HOST spd=HIGH
> (480Mbps) pwr=ON (248mA)
> 
> 
> Unread portion of the kernel message buffer:
> panic: vm_fault: fault on nofault entry, addr: fffffe02346f0000
> cpuid = 0
> KDB: stack backtrace:
> #0 0xffffffff8092a2d0 at kdb_backtrace+0x60
> #1 0xffffffff808ef825 at panic+0x155
> #2 0xffffffff80b5f8e9 at vm_fault_hold+0x1a89
> #3 0xffffffff80b5de17 at vm_fault+0x77
> #4 0xffffffff80ce455c at trap_pfault+0x19c
> #5 0xffffffff80ce3d80 at trap+0x4a0
> #6 0xffffffff80cca7f2 at calltrap+0x8
> #7 0xffffffff81c1687e at axge_bulk_read_callback+0x19e
> #8 0xffffffff8079684c at usbd_callback_wrapper+0x71c
> #9 0xffffffff80797ac3 at usb_command_wrapper+0x113
> #10 0xffffffff80796a71 at usb_callback_proc+0xc1
> #11 0xffffffff80791b8f at usb_process+0x11f
> #12 0xffffffff808c03da at fork_exit+0x9a
> #13 0xffffffff80ccad2e at fork_trampoline+0xe
> Uptime: 10m38s

I can't reproduce the issue here.  Could you tell me how to reproduce it?
Thanks.
Comment 21 Vikash Badal 2014-07-02 04:40:09 UTC
(In reply to Kevin Lo from comment #20)

> > (480Mbps) pwr=ON (248mA)
> I can't reproduce the issue here.  Could you tell me how to reproduce it?
> Thanks.

I scp-ed a file > 10MB to/from the laptop and that would trigger the panic.
Since i applied the patch, the panic issue is resolved.

The rest of this thread is about usb 3. maybe that should be a separate issue/bug.
Comment 22 Hans Petter Selasky freebsd_committer freebsd_triage 2014-07-02 05:46:28 UTC
Hi,

There is a new patch coming to improve the performance @ USB 2.0.

--HPS
Comment 23 commit-hook freebsd_committer freebsd_triage 2014-07-03 10:50:29 UTC
A commit references this bug:

Author: hselasky
Date: Thu Jul  3 10:49:47 UTC 2014
New revision: 268209
URL: http://svnweb.freebsd.org/changeset/base/268209

Log:
  - Disable hardware checksumming until it is properly tested.
  - Don't discard frames if the dropped or error flag is set.
  - Don't remove the last 4-bytes of every packet.
  - Add extra range check for data position offset when receiving data.

  MFC after:	1 day
  PR:		191432

Changes:
  head/sys/dev/usb/net/if_axge.c
Comment 24 commit-hook freebsd_committer freebsd_triage 2014-07-03 16:14:44 UTC
A commit references this bug:

Author: hselasky
Date: Thu Jul  3 16:13:44 UTC 2014
New revision: 268219
URL: http://svnweb.freebsd.org/changeset/base/268219

Log:
  MFC r267955 and r268209:
  - Add proper rangechecks in "axge_rx_frame()" function and
  fix receive loop header parsing.
  - Disable hardware checksumming until it is properly tested.

  PR:		191432

Changes:
_U  stable/10/
  stable/10/sys/dev/usb/net/if_axge.c
Comment 25 Hans Petter Selasky freebsd_committer freebsd_triage 2014-07-03 16:21:40 UTC
Hi,

Can you please re-test with the latest changes in 10-stable?

--HPS
Comment 26 commit-hook freebsd_committer freebsd_triage 2014-07-03 16:34:48 UTC
A commit references this bug:

Author: hselasky
Date: Thu Jul  3 16:34:02 UTC 2014
New revision: 268222
URL: http://svnweb.freebsd.org/changeset/base/268222

Log:
  MFC r266490, r266738, r267955, and r268209:
  - Improve performance by fixing incorrect Rx/Tx handling
  - Rename definition of AXGE_* to reflect reality
  - Add new USB IDs
  - Add proper rangechecks in "axge_rx_frame()" function and
  fix receive loop header parsing.
  - Disable hardware checksumming until it is properly tested.

  PR:	191432

Changes:
_U  stable/9/sys/
_U  stable/9/sys/dev/
  stable/9/sys/dev/usb/net/if_axge.c
  stable/9/sys/dev/usb/net/if_axgereg.h
  stable/9/sys/dev/usb/usbdevs
Comment 27 commit-hook freebsd_committer freebsd_triage 2014-07-03 17:42:55 UTC
A commit references this bug:

Author: hselasky
Date: Thu Jul  3 17:42:29 UTC 2014
New revision: 268226
URL: http://svnweb.freebsd.org/changeset/base/268226

Log:
  MFC r268221 and r268222:
  - Remove some unused variables.
  - Add proper rangechecks in "axge_rx_frame()" function and
  fix receive loop header parsing.
  - Add new USB IDs.

  Approved by: 	re, gjb @
  PR:		191432

Changes:
_U  releng/9.3/sys/
  releng/9.3/sys/dev/firewire/sbp.c
  releng/9.3/sys/dev/my/if_my.c
  releng/9.3/sys/dev/nfe/if_nfe.c
  releng/9.3/sys/dev/siba/siba_core.c
  releng/9.3/sys/dev/sis/if_sis.c
  releng/9.3/sys/dev/sk/if_sk.c
  releng/9.3/sys/dev/tx/if_tx.c
  releng/9.3/sys/dev/usb/net/if_axge.c
  releng/9.3/sys/dev/usb/net/if_axgereg.h
  releng/9.3/sys/dev/usb/usbdevs
Comment 28 Vikash Badal 2014-07-04 08:07:09 UTC
(In reply to Hans Petter Selasky from comment #25)
> Hi,
> 
> Can you please re-test with the latest changes in 10-stable?
> 
> --HPS

updated to 10.0-STABLE r268239.

No reproduce-able panic.
No improvement in networking speed.

I plugged in another USB 3.0 device. Still only see usb 2 from usbconfig

ugen2.4: <Seagate> at usbus2
umass0: <Seagate Expansion, class 0/0, rev 2.10/1.00, addr 4> on usbus2
umass0:  SCSI over Bulk-Only; quirks = 0x0100
umass0:2:0:-1: Attached to scbus2
da0 at umass-sim0 bus 0 scbus2 target 0 lun 0
da0: <Seagate Expansion 0608> Fixed Direct Access SCSI-6 device 
da0: Serial Number NA42A2SD
da0: 40.000MB/s transfers
da0: 476940MB (976773167 512 byte sectors: 255H 63S/T 60801C)
da0: quirks=0x2<NO_6_BYTE>

usbconfig shows:

ugen2.4: <Expansion Seagate> at usbus2, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (100mA)


same port positions for both AX8819 and Seagate harddrive on unbuntu 14.0.4 shows up as USB 3 :

T:  Bus=04 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=5000 MxCh= 0
D:  Ver= 3.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS= 9 #Cfgs=  1
P:  Vendor=0bc2 ProdID=2320 Rev=01.00
S:  Manufacturer=Seagate
S:  Product=Expansion
S:  SerialNumber=NA42A2SD
C:  #Ifs= 1 Cfg#= 1 Atr=80 MxPwr=144mA
I:  If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage

T:  Bus=04 Lev=01 Prnt=01 Port=01 Cnt=02 Dev#=  2 Spd=5000 MxCh= 0
D:  Ver= 3.00 Cls=ff(vend.) Sub=ff Prot=00 MxPS= 9 #Cfgs=  1
P:  Vendor=0b95 ProdID=1790 Rev=01.00
S:  Manufacturer=ASIX Elec. Corp.
S:  Product=AX88179
S:  SerialNumber=00503F56011487
C:  #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=496mA
I:  If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=00 Driver=ax88179_178a


have tried various values for 
hw.usb.xhci.xhci_port_route in /boot/loader.conf.

no difference.


The issue now is usb 3 as opposed to kernel panic.
Should a new PR be logged ?
Comment 29 Glen Barber freebsd_committer freebsd_triage 2015-07-08 17:37:23 UTC
Close PRs that have a corresponding commit to resolve the issue.