usb/186811: Intel NUC Haswell Generation USB 3 support (solution attached)

2014-02-16 Thread Philipp Maechler

Number: 186811
Category:   usb
Synopsis:   Intel NUC Haswell Generation USB 3 support (solution attached)
Confidential:   no
Severity:   non-critical
Priority:   low
Responsible:freebsd-usb
State:  open
Quarter:
Keywords:   
Date-Required:
Class:  sw-bug
Submitter-Id:   current-users
Arrival-Date:   Sun Feb 16 09:20:00 UTC 2014
Closed-Date:
Last-Modified:
Originator: Philipp Maechler
Release:9.2-RELEASE / 10.0-RELEASE
Organization:
Environment:
FreeBSD x.tontaube.ch 10.0-RELEASE FreeBSD 10.0-RELEASE #6 r261922M: Sat Feb 15 
19:30:32 CET 2014 r...@x.tontaube.ch:/usr/obj/usr/src/sys/GENERIC  amd64
Description:
I bought a Intel Nuc D34010WYK [0]. It has a QS77 Chipset with a Intel Panther 
Point USB Controller (as far as I can say).

The problem was, that a connected external harddisk case (it has a JMicron 
USB2Sata bridge JMicron JMS539 [1]) or even a simple usb 3 memory stick, it was 
always connected at highspeed (usb2) instead of superspeed (usb3) (see 
usbconfig in [2]). Of course, the attached harddisk drives only appeared to 
have only 40MB/s transfer rates instead of 400MB/s.

[0] http://www.intel.com/content/www/us/en/nuc/nuc-kit-d34010wyk.html
[1] http://www.jmicron.com/Product_JMS539.htm JMicron USB2Sata bridge (in a 
Raidsonic Icybox IB-3640SU3 together with a JMB321 SATA port multiplier)

[2]
faked output out of my head, if you need an exactly output I will provide after 
a reboot from a 10.0-RELEASE memory stick:
[root@x ~]# usbconfig
ugen0.1: XHCI root HUB 0x8086 at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) 
pwr=SAVE (0mA)
ugen1.1: EHCI root HUB Intel at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) 
pwr=SAVE (0mA)
ugen1.2: product 0x8000 vendor 0x8087 at usbus1, cfg=0 md=HOST spd=HIGH 
(480Mbps) pwr=SAVE (0mA)
ugen0.6: USB to ATAATAPI Bridge JMicron at usbus0, cfg=0 md=HOST spd=HIGH 
(480Mbps) pwr=ON (8mA)# - PROBLEM
ugen0.7: USB to ATAATAPI Bridge JMicron at usbus0, cfg=0 md=HOST spd=HIGH 
(480Mbps) pwr=ON (8mA)# - PROBLEM

How-To-Repeat:
Attach any USB 3 mass storage (maybe any device) to a Intel Nuc D34010WYK.

Below 9.2-RELEASE and 10.0-RELEASE, the device will only appear as a HIGH-speed 
device (usb2) instead of a SUPER-speed device (usb3). (e.g. output dmesg or 
usbconfig)
Fix:
By accident I found this commit:
  http://lists.freebsd.org/pipermail/svn-src-stable-9/2012-November/003213.html
I then realized, that the pci dev id on my intel nuc is 0x9c318086 instead of 
0x8c318086. In a fast hack I added the same code for this id in a 10.0-RELEASE 
Generic kernel [3] and the problem was solved [4], the devices are now 
correctly routed to xhci and have superspeed support.

I hope this pr helps to integrate the solution to FreeBSD, but I think the 
patch is not finished yet (maybe you would change the descriptions etc, as my 
knowledge of hardware naming is limited I'm not able to do). But as it doesn't 
change much, I'd define it as production-ready.

Philipp


[3]
[root@x /usr/src]# svn diff sys/dev/usb/controller/xhci_pci.c 
Index: sys/dev/usb/controller/xhci_pci.c
===
--- sys/dev/usb/controller/xhci_pci.c   (revision 261922)
+++ sys/dev/usb/controller/xhci_pci.c   (working copy)
@@ -106,6 +106,8 @@
return (Intel Panther Point USB 3.0 controller);
case 0x8c318086:
return (Intel Lynx Point USB 3.0 controller);
+   case 0x9c318086:
+   return (Intel Panther Point USB 3.0 controller);
 
default:
break;
@@ -239,6 +241,7 @@
switch (pci_get_devid(self)) {
case 0x1e318086:/* Panther Point */
case 0x8c318086:/* Lynx Point */
+   case 0x9c318086:/* Panther Point */
sc-sc_port_route = xhci_pci_port_route;
break;
default:

[4]
[root@x /usr/src]# usbconfig
ugen0.1: XHCI root HUB 0x8086 at usbus0, cfg=0 md=HOST spd=SUPER (5.0Gbps) 
pwr=SAVE (0mA)
ugen1.1: EHCI root HUB Intel at usbus1, cfg=0 md=HOST spd=HIGH (480Mbps) 
pwr=SAVE (0mA)
ugen1.2: product 0x8000 vendor 0x8087 at usbus1, cfg=0 md=HOST spd=HIGH 
(480Mbps) pwr=SAVE (0mA)
ugen0.6: USB to ATAATAPI Bridge JMicron at usbus0, cfg=0 md=HOST spd=SUPER 
(5.0Gbps) pwr=ON (2mA)  # - perfect
ugen0.7: USB to ATAATAPI Bridge JMicron at usbus0, cfg=0 md=HOST spd=SUPER 
(5.0Gbps) pwr=ON (2mA)   # - perfect

Patch attached with submission follows:

--- sys/dev/usb/controller/xhci_pci.c   2014-02-16 10:09:07.597292623 +0100
+++ sys/dev/usb/controller/xhci_pci.c.new   2014-02-16 10:09:00.400292742 
+0100
@@ -24,7 +24,7 @@
  */
 
 #include sys/cdefs.h
-__FBSDID($FreeBSD: releng/10.0/sys/dev/usb/controller/xhci_pci.c 255768 
2013-09-21 21:40:57Z hselasky $);
+__FBSDID($FreeBSD: release/10.0.0/sys/dev/usb/controller/xhci_pci.c 255768 
2013-09-21 21:40:57Z hselasky $);
 
 #include sys/stdint.h
 #include sys/stddef.h
@@ -106,6 +106,8 @@

Re: usb/186811: commit references a PR

2014-02-16 Thread dfilter service
The following reply was made to PR usb/186811; it has been noted by GNATS.

From: dfil...@freebsd.org (dfilter service)
To: bug-follo...@freebsd.org
Cc:  
Subject: Re: usb/186811: commit references a PR
Date: Sun, 16 Feb 2014 14:37:31 + (UTC)

 Author: hselasky
 Date: Sun Feb 16 14:37:23 2014
 New Revision: 261981
 URL: http://svnweb.freebsd.org/changeset/base/261981
 
 Log:
   Add new PCI ID for hardware which needs port routing for USB 3.0.
   
   PR:  usb/186811
   MFC after:   1 week
   Submitted by:Philipp Maechler philipp.maech...@mamo.li
 
 Modified:
   head/sys/dev/usb/controller/xhci_pci.c
 
 Modified: head/sys/dev/usb/controller/xhci_pci.c
 ==
 --- head/sys/dev/usb/controller/xhci_pci.c Sun Feb 16 14:35:19 2014
(r261980)
 +++ head/sys/dev/usb/controller/xhci_pci.c Sun Feb 16 14:37:23 2014
(r261981)
 @@ -102,6 +102,7 @@ xhci_pci_match(device_t self)
case 0x10421b21:
return (ASMedia ASM1042 USB 3.0 controller);
  
 +  case 0x9c318086:
case 0x1e318086:
return (Intel Panther Point USB 3.0 controller);
case 0x8c318086:
 @@ -237,6 +238,7 @@ xhci_pci_attach(device_t self)
  
/* On Intel chipsets reroute ports from EHCI to XHCI controller. */
switch (pci_get_devid(self)) {
 +  case 0x9c318086:/* Panther Point */
case 0x1e318086:/* Panther Point */
case 0x8c318086:/* Lynx Point */
sc-sc_port_route = xhci_pci_port_route;
 ___
 svn-src-...@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to svn-src-all-unsubscr...@freebsd.org
 
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org


Re: usb/186811: Intel NUC Haswell Generation USB 3 support (solution attached)

2014-02-16 Thread eadler
Synopsis: Intel NUC Haswell Generation USB 3 support (solution attached)

Responsible-Changed-From-To: freebsd-usb-eadler
Responsible-Changed-By: eadler
Responsible-Changed-When: Mon Feb 17 03:09:10 UTC 2014
Responsible-Changed-Why: 
I'll take it.

http://www.freebsd.org/cgi/query-pr.cgi?pr=186811
___
freebsd-usb@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-usb
To unsubscribe, send any mail to freebsd-usb-unsubscr...@freebsd.org