SOLVED Load xhci on startup

Status
Not open for further replies.

gzunk

Dabbler
Joined
Jun 23, 2013
Messages
17
Just put my FreeNAS server into a new case which has USB3.0 front ports. My motherboard doesn't (SuperMicro X9SCM-F) so I bought a cheap USB3.0 pcie card.

After reboot, I had to run kldload xhci for it to start working, so I followed the instructions on adding it as a tunable so it would be available on startup, but I obviously did it wrong, because it didn't load.

So, any hints on how to get xhci to autoload on startup?
 

gzunk

Dabbler
Joined
Jun 23, 2013
Messages
17
I removed it when it didn't work, but I'll just add it again. Here's what I've added.
 

Attachments

  • tunables3.png
    tunables3.png
    23.8 KB · Views: 555
Last edited:
D

dlavigne

Guest
After the reboot (with this tunable), did it show in kldstat? If not, there should be a related error in /var/log/messages.
 

gzunk

Dabbler
Joined
Jun 23, 2013
Messages
17
Just rebooted with tunable again, and no loading. On bootup on the console it says "Loading Kernel Modules:" but then has nothing after it. Here's the output of various commands. Maybe I have top put xhci.ko as the name?

[root@ned ~]# kldstat
Id Refs Address Size Name
1 65 0xffffffff80200000 1468380 kernel
2 1 0xffffffff81812000 4845 geom_stripe.ko
3 1 0xffffffff81817000 10489 geom_raid3.ko
4 1 0xffffffff81828000 efdd geom_raid5.ko
5 1 0xffffffff81837000 5806 geom_gate.ko
6 1 0xffffffff8183d000 49bd geom_multipath.ko
7 1 0xffffffff81842000 15ff44 zfs.ko
8 14 0xffffffff819a2000 5701 opensolaris.ko
9 1 0xffffffff819a8000 b56 dtraceall.ko
10 1 0xffffffff819a9000 4ea3 profile.ko
11 3 0xffffffff819ae000 3569 cyclic.ko
12 11 0xffffffff819b2000 3433a dtrace.ko
13 1 0xffffffff819e7000 fb24 systrace_freebsd32.ko
14 1 0xffffffff819f7000 1098d systrace.ko
15 1 0xffffffff81a08000 4bca sdt.ko
16 1 0xffffffff81a0d000 48f5 lockstat.ko
17 1 0xffffffff81a12000 a9cc fasttrap.ko
18 1 0xffffffff81a1d000 6663 fbt.ko
19 1 0xffffffff81a24000 557d dtnfscl.ko
20 1 0xffffffff81a2a000 4585 dtmalloc.ko
21 1 0xffffffff81a2f000 4488 dtio.ko
22 1 0xffffffff81a34000 30fc5 if_cxgbe.ko
23 2 0xffffffff81a65000 2bb1 vboxnetflt.ko
24 2 0xffffffff81a68000 361ff vboxdrv.ko
25 1 0xffffffff81a9f000 447f ng_ether.ko
26 1 0xffffffff81aa4000 400a vboxnetadp.ko

[root@ned ~]# usbconfig
ugen0.1: <EHCI root HUB Intel> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.1: <EHCI root HUB Intel> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.2: <product 0x0024 vendor 0x8087> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.2: <product 0x0024 vendor 0x8087> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.3: <Hermon USB hidmouse Device Winbond Electronics Corp> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen0.4: <product 0x1000 vendor 0x090c> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)

[root@ned ~]# kldload xhci
[root@ned ~]# kldstat

Id Refs Address Size Name
1 68 0xffffffff80200000 1468380 kernel
2 1 0xffffffff81812000 4845 geom_stripe.ko
3 1 0xffffffff81817000 10489 geom_raid3.ko
4 1 0xffffffff81828000 efdd geom_raid5.ko
5 1 0xffffffff81837000 5806 geom_gate.ko
6 1 0xffffffff8183d000 49bd geom_multipath.ko
7 1 0xffffffff81842000 15ff44 zfs.ko
8 14 0xffffffff819a2000 5701 opensolaris.ko
9 1 0xffffffff819a8000 b56 dtraceall.ko
10 1 0xffffffff819a9000 4ea3 profile.ko
11 3 0xffffffff819ae000 3569 cyclic.ko
12 11 0xffffffff819b2000 3433a dtrace.ko
13 1 0xffffffff819e7000 fb24 systrace_freebsd32.ko
14 1 0xffffffff819f7000 1098d systrace.ko
15 1 0xffffffff81a08000 4bca sdt.ko
16 1 0xffffffff81a0d000 48f5 lockstat.ko
17 1 0xffffffff81a12000 a9cc fasttrap.ko
18 1 0xffffffff81a1d000 6663 fbt.ko
19 1 0xffffffff81a24000 557d dtnfscl.ko
20 1 0xffffffff81a2a000 4585 dtmalloc.ko
21 1 0xffffffff81a2f000 4488 dtio.ko
22 1 0xffffffff81a34000 30fc5 if_cxgbe.ko
23 2 0xffffffff81a65000 2bb1 vboxnetflt.ko
24 2 0xffffffff81a68000 361ff vboxdrv.ko
25 1 0xffffffff81a9f000 447f ng_ether.ko
26 1 0xffffffff81aa4000 400a vboxnetadp.ko
27 1 0xffffffff81aa9000 b69e xhci.ko

[root@ned ~]# usbconfig
ugen0.1: <EHCI root HUB Intel> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.1: <EHCI root HUB Intel> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.2: <product 0x0024 vendor 0x8087> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen1.2: <product 0x0024 vendor 0x8087> at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=SAVE (0mA)
ugen0.3: <Hermon USB hidmouse Device Winbond Electronics Corp> at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON (100mA)
ugen0.4: <product 0x1000 vendor 0x090c> at usbus0, cfg=0 md=HOST spd=HIGH (480Mbps) pwr=ON (500mA)
ugen2.1: <XHCI root HUB 0x1912> at usbus2, cfg=0 md=HOST spd=SUPER (5.0Gbps) pwr=SAVE (0mA)
 

Attachments

  • tunable2.png
    tunable2.png
    91.5 KB · Views: 495

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
I hate to break it to you, but if you bought some cheap USB 3 card it almost certainly isn't compatible with FreeBSD (and thereby FreeNAS).

USB3 suffers from two main problems (which is why its disabled):

1. Very little hardware is actually supported on USB3 in FreeBSD.
2. Much of the common USB3 hardware people were using was causing the system to crash on bootup. (this is primarily why we disabled it).

You really shouldn't be using USB regularly anyway (Sorry, I'm not going to discuss it again here.. please search for prior discussions on this topic) so you really shouldn't have a need for USB3. Even though your boot device may be USB3 you will not see a significant performance boost or a significant improvement in bootup times.

USB3 is one of those "no need to use it and its broke anyway so why deal with it?" situations. Obviously when USB3 support is more mature in FreeBSD we may re-enable it. But by and large the majority of users that had USB3 couldn't even bootup FreeNAS, so action was clearly required.
 
D

dlavigne

Guest
This is all true. However, it loads manually with kldload but not from the GUI. Depending upon the version and the results of adding .ko in the GUI, it may be a doc or a software bug.
 

gzunk

Dabbler
Joined
Jun 23, 2013
Messages
17
Cyberjock, thanks for the input, but you never did ask what I was going to be using it for - it's for temporarily plugging in keyboards and possibly external hard disks if I want to take a backup of something - but obviously if the kernel panics when I do that I'll not do it again. (Just checked, and it works fine with either keyboards or external USB3.0 hard disks, but time will tell).

You'll be glad to know that I'm running all my hard disks off SATA like a good boy should, and indeed I might invest in one of those LSI-SAS 9211-8i cards, not a cheap IBM card from ebay to crossflash, but a real one - because I fancy having 8 disks and my motherboard only has 6 SATA ports.

I was prepared for the the USB card not to work, I was prepared for there to be no driver and for it to be a complete waste of time, but I thought I would try it anyway, purely because my new case had front USB3.0 ports and I find it philosophically displeasing to have ports that aren't actually connected and usable, and because the connector was one of those 20 pin USB3.0 headers so I couldn't easily plug them into my USB 2.0 sockets.

Anyway, ramble over - I know that I might cause instability on my FreeNAS box, but hey - I like a bit of excitement in my life :). I'll try and stick the .ko in the tunable and see if that makes a difference.

Nope. No difference. When I solve it, I'll post the answer back up here.
 
Last edited:

gzunk

Dabbler
Joined
Jun 23, 2013
Messages
17
OK, I think i've figured it out. The variable name should be xhci_load as described in loader.conf, so the FreeNAS docs could probably do with being updated to give a reference to the loader.conf man page.

Sent from my SM-N9005 using Tapatalk
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525

gzunk

Dabbler
Joined
Jun 23, 2013
Messages
17
Can confirm, putting the variable name as xhci_load successfully made the xhci module load on startup.
 

gzunk

Dabbler
Joined
Jun 23, 2013
Messages
17
This thread wasn't about USB, it was about loading kernel modules on startup, which in this case just happened to be the USB3 module.

In Section 4.9 of the FreeNAS manual it describes how to add a tunable to get a module to load on startup and it says the Variable field should be set to "typically the name of the driver to load, as indicated by its man page" - which is incorrect, you have to set it the the name of the drive to load, with "_load" added to the end of it. There are additional ways you can do it, all described in loader.conf(5) which is why I think that this should be referenced in the manual.

I didn't find the bit in the manual that you quoted, because I knew what I wanted to do - automatically load a kernel module on startup - so I looked at that section of the manual, not at the section on Hardware Recommendations.
 
Last edited:

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,525
Ok. I understand what you are saying. But I'd say the manual is still accurate. It says it is "typically the name of the driver to load as indicated by its manpage". And if you are reading the manpage about a particular kernel driver it should be telling you to use xhci_load or whatever is applicable.
 

Raiz

Explorer
Joined
Nov 26, 2015
Messages
77
Could this be a possible route to booting FreeNAS 9.3.X off of a USB stick?

I had to ask.
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
Could this be a possible route to booting FreeNAS 9.3.X off of a USB stick?
If it works, yeah - unless GRUB craps out.
 

Raiz

Explorer
Joined
Nov 26, 2015
Messages
77
Hrmm... wondering about getting this working on my X11 board. I had always assumed that USB booting was not an option for me.
 
Status
Not open for further replies.
Top