Welcome! Log In Create A New Profile

Advanced

NSA325-v2 : USB 3.0 hub doesn't work with Zyxel FW v4.80

Posted by shv 
shv
NSA325-v2 : USB 3.0 hub doesn't work with Zyxel FW v4.80
December 06, 2015 04:51AM
Hello,
I connected a USB3.0 HUB to the NSA325-v2 USB3.0 connector in the front. USB3.0 devices which are connected to the USB3.0 HUB, e.g. harddisks, are no recognized by the firmware. USB2.0 devices connected to the USB3.0 HUB are working.

demesg messages after connection of USB3.0 HUB to NSA325-v2:
usb 2-3: new high speed USB device using xhci_hcd and address 0
In hub_port_init, and number is 2, retry 0, port 3 .....
usb 2-3: configuration #1 chosen from 1 choice
usb 2-3: ep 0x81 - rounding interval to 2048 microframes
hub 2-3:1.0: USB hub found
xhci_hcd 0000:00:01.0: WARN: short transfer on control ep
hub 2-3:1.0: 4 ports detected
usb 2-1: new SuperSpeed USB device using xhci_hcd and address 3
In hub_port_init, and number is 3, retry 0, port 1 .....
usb 2-1: configuration #1 chosen from 1 choice
usb 2-1: ep 0x83 - rounding interval to 128 microframes
hub 2-1:1.0: USB hub found
xhci_hcd 0000:00:01.0: WARN: Stalled endpoint
xhci_hcd 0000:00:01.0: WARN: Stalled endpoint
xhci_hcd 0000:00:01.0: WARN: Stalled endpoint
hub 2-1:1.0: config failed, can't read hub descriptor (err -22)

demesg messages after connection a USB3.0 harddisk to the USB3.0 HUB:
--- nothing ---

Possibly this is a problem of the used kernel xhci-module: http://www.spinics.net/lists/linux-usb/msg47864.html
Hi, Sarah!

> There are two patches that Greg pushed to Linus yesterday that should
> solve this issue:
>
> e2b0217 xhci: Add defines for hardcoded slot states
> 001fd38 xhci: Do not issue device reset when device is not setup
>
> If you test with latest tree, it should fix your issue. The patches are
> marked as being bound for the stable trees.
>
> Let me know if you run into any other problems with the Etron xHCI host.

I applied the two patches (with minimal adjustments) to a 2.6.39 kernel and
they worked well!

I append the kernel log created by attaching a USB-3-pen-drive. It contains
several warnings. I'm also not sure, whether the pen-drive works at its full
speed (I benchmarked about 37MB/s (read), but expected about 70 to 90MB/s).

Lots of thanks to you, Greg and all the others involved for this great support!

Greetings, Michael

I've got the source code but don't have sufficient knowledge to fix the xhci kernel module. I don't want to replace the original kernel due to performance issues. Can anybody help to fix the module so that USB3.0 devices are working with original FW/kernel if they are connected through a USB3.0 hub? I will send you the links to the source code on PN request because I don't know if I can share the links and passwords officially.

Regards.
shv
Re: NSA325-v2 : USB 3.0 hub doesn't work with Zyxel FW v4.80
December 06, 2015 03:40PM
@shv,

Which kernel are you running, by "Zyxel FW v4.80" meaning you are running stock OS? Looking at the patch linked above, kernel 2.6.3x ?

Pardon me if I ask the obvious question :) why can't the performance problem be solved in kernels 3.2x to 4.2 ? I could take a look at the old module for you, but perhaps you want to solve your performance problem in newer kernels instead.

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
shv
Re: NSA325-v2 : USB 3.0 hub doesn't work with Zyxel FW v4.80
December 07, 2015 01:02PM
@bodhi,

I am running NSA 325-v2 stock OS v4.80 with stock kernel version "Linux NSA325-v2 2.6.31.8 #2 Fri May 15 12:20:01 CST 2015 armv5tel GNU/Linux". I prefere a patch for the stock xhci module to prevent any possible drawback due to kernel exchange. If we find a solution it might be regarded by Zyxel for the next FW update of the "old" hardware generation. It would be nice if you could have a look at it. I will send you a PN with the source code download links.

Yes it migth be also solved with a new kernel. But I prefere to change as little as necessary. It would be bood if only the xhci kernel module needs to be changed.

-shv
Re: NSA325-v2 : USB 3.0 hub doesn't work with Zyxel FW v4.80
December 08, 2015 05:54AM
shv Wrote:
> prefere a patch for the stock xhci module to
> prevent any possible drawback due to kernel
> exchange. If we find a solution it might be
> regarded by Zyxel for the next FW update of the
> "old" hardware generation.

I can totally understand that but I think it will not work this way:
  1. Building a kernel for the old firmware seems quite a hassle to me. As far as I can see there is very little documentation/knowledge around for modying the stock firmware at this level (compared to all the people who installed Debian/Arch/... and compile their own kernels regularly). The GPL dumps from Zyxel are the usual dump of a "board support package" from a SoC vendor. (Disclaimer: I did not look too closely into the GPL dump - maybe I'm completely wrong here!)
  2. The NSA325v2 is close to EOL from Zyxel's point of view. As far as I know they'll stop any development support in early 2016. Also they don't care (and never cared!) about keeping the kernel up-to-date (which is again the norm for embedded vendors!). I doubt they even have the knowledge in-house to do kernel development for their boards. For example your devices runs 2.6.31.8. Greg Kroah-Hartman published 2.6.31.14 (!) in July 2010. So if they don't even upgrade to the latest version of that stable line for more than 5 years I think it is very unlikely that they will add anything new just before the products goes EOL.

I can understand that from a commercial point of view of course: This is essentially a new feature but it won't get them new sales. So why risk breaking existing stuff when all customers so far accepted (or never noticed) the limitation?

The best way forward with the NSA325v2 (IMHO!) is the "hacker way": Volunteers care about the device and write patches to support the hardware. Thankfully the Marvell chipset has quite a bit of public register documentation and there are no binary blobs in the kernel as far as I can see. For example Philipp Kirchhofer just recently fixed two bugs in the Marvell PHY for TCP Segment Offloading. There is other work ongoing to utilize the crypto accelerator.

However all of that work seems to be driven by volunteers as there is no commercial interest in the Chipset/devices anymore. So work goes slowly and it really comes down to some (few!) individuals.



Edited 1 time(s). Last edit at 12/08/2015 05:54AM by Muchatet.
Re: NSA325-v2 : USB 3.0 hub doesn't work with Zyxel FW v4.80
December 08, 2015 01:44PM
> The best way forward with the NSA325v2 (IMHO!) is
> the "hacker way": Volunteers care about the device
> and write patches to support the hardware.

I would prefer shv to solve or help solving whatwever performance in kernel linux-4.2.0-kirkwood-tld-1, too. It might not be related to the kernel, and it could have been some bug or flaw in the current Debian packages.

We don't really want to do much with stock FW. However, it might be instructional to see the xhci patch that applied to 2.63x. I don't intent to spend much time with this :)

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
shv
Re: NSA325-v2 : USB 3.0 hub doesn't work with Zyxel FW v4.80
December 09, 2015 11:29AM
The download links I got from Zyxel don't work anymore. I requested new download links but didn't get them yet. I have the packages on my harddisk and will upload them next weekend. It is about 2,5GB and seams to be almost complete with tools and instructions how to build it.

The following packages are available:

build_NSA325.tar.gz 1,2GB
nsa325v2_470aals0c0.tar.gz 800MB
sdk3.3-genericfs-arm-mv5sft.tar.gz 400MB
tools.tar.gz 50MB

ReadMe.txt:
Prerequisite:

1. Install Ubuntu 10.04 desktop

2. Update your packages
	you can use terminal:(1) sudo apt-get update  (2) sudo apt-get upgrade
	or use X-window interface to execute [System > Administration > Update Manager] to update your packages

3. Install the following source packages
	After 'tar zxf tools.tar.gz; cd tools', you can see the following packages.
	* m4 1.4.13
	# tar zxf m4-1.4.13.tar.gz; cd m4-1.4.13; ./configure --prefix=/usr; make; sudo make install; cd ..
    * bison 1.875
	# tar zxf bison-1.875.tar.gz; cd bison-1.875; ./configure --prefix=/usr; make; sudo make install; cd ..
	* libtool 1.4.3
	# tar zxf libtool-1.4.3.tar.gz; cd libtool-1.4.3; ./configure --prefix=/usr; make; sudo make install; cd ..
	* autoconf 2.68
	# tar zxf autoconf-2.68.tar.gz; cd autoconf-2.68; ./configure --prefix=/usr; make; sudo make install; cd ..
	* automake 1.6.3
	# tar zxf automake-1.6.3.tar.gz; cd automake-1.6.3; ./configure --prefix=/usr; make; sudo make install; cd ..
	* Python 2.6.2
	# tar zxf Python-2.6.2.tgz; cd Python-2.6.2; ./configure --prefix=/usr/local; make; sudo make install; cd ..
	* fs.bison
	# sudo tar zxf fs.bison.tgz -C /
	* flex 2.5.33
	# tar zxf flex-2.5.33.tar.gz; cd flex-2.5.33; ./configure --prefix=/usr; make; sudo make install; cd ..
	* gettext 0.18
	# tar zxf gettext-0.18.tar.gz; cd gettext-0.18; ./configure --prefix=/usr; make; sudo make install; cd ..
	* g++ 4.4.3
	# sudo dpkg -i libstdc++6-4.4-dev_4.4.3-4ubuntu5.1_i386.deb g++-4.4_4.4.3-4ubuntu5.1_i386.deb g++_4%3a4.4.3-1ubuntu1_i386.deb

	
4. Change /bin/sh symbolic link (/bin/sh is linked to /bin/dash by default. dash can be regarded as a lightweight bash)
   Change /usr/bin/awk symbolic link to /usr/bin/gawk
$ sudo ln -f -s /bin/bash /bin/sh
$ sudo ln -f -s `which gawk` /usr/bin/awk
$ sudo ln -f -s `which flex` /usr/bin/lex
$ sudo rm -rf /usr/lib/libltdl.*  (clear the unneeded package)

===========================================================
To Prepare the environment to build NSA325, please enter the directory you want to put the trunk and execute:
$ mkdir -p /opt
$ sudo tar zxf sdk3.3-genericfs-arm-mv5sft.tar.gz -C /opt
$ tar zxf build_NSA325.tar.gz -C .
$ cd trunk

Then you are at the trunk directory of NSA325.

To build the all the opensource packages into binaries and locate them at the correct location, please execute:
$ source env.sh; ./mk325.sh world.gpl

If you run into any error, please reference the log file: zyxel-install-cross.txt

Once you have built up the environment, you can build the firmware of NSA-325 with the following command:
$ ./mk325.sh ras.gpl

	The path of built firmware is trunk/build/ras.bin .

============================================================
To build samba-3.5.6:

Prereuisites: Untar tool chain to /opt should be done with below command:
tar zxf sdk3.3-genericfs-arm-mv5sft.tar.gz -C /opt

1.please change path to trunk/sysapps/samba-3.5.6/source3/ 
2. execute .zyxel-armv5_sdk33.sh to do configure, set proper environment and execute make
./zyxel-armv5_sdk33.sh

============================================================
To build mdadm-2.6.2:

1.mdadm-2.6.2 is build during "./mk325.sh world.gpl"
2.You can manually build the mdadm-2.6.2 by command: ./mk325.sh mdadm
NOTE: If you run into any error, please reference the log file in
sysapps/mdadm-2.6.2/zyxel-install-cross.txt

============================================================
To build reiserfsprogs-3.6.19:

1.reiserfsprogs-3.6.19 is build during "./mk325.sh world.gpl"
2.You can manually build the reiserfsprogs-3.6.19 by command: ./mk325.sh reiserfsprogs
NOTE: If you run into any error, please reference the log file in
sysapps/reiserfsprogs-3.6.19/zyxel-install-cross.txt

============================================================
To build u-boot-1.1.4:

1.u-boot-1.1.4 is build during "./mk325.sh world.gpl"
2.You can manually build the u-boot-1.1.4 by command: ./mk325.sh u-boot
NOTE: If you run into any error, please reference the log file in
sysapps/u-boot-1.1.4_NSA325/zyxel-install-cross.txt

============================================================
To build linux-2.6.31.8:

1.Kernel linux-2.6.31.8 is build during "./mk325.sh world.gpl"
2.You can manually build by command: ./mk325.sh buildkernel
NOTE: If you run into any error, please reference the log file in
linux-2.6.31.8/zyxel-install-cross.txt

============================================================
To build dhcpcd-1.3.22-pl4:

1.dhcpcd-1.3.22-pl4 is build during "./mk325.sh world.gpl"
2.You can manually build by command: ./mk325.sh dhcpcd
NOTE: If you run into any error, please reference the log file in
sysapps/dhcpcd-1.3.22-pl4/zyxel-install-cross.txt

============================================================
To build cherrypy-3.1.2:

1.cherrypy-3.1.2 are python scripts, do not need to be compiled

============================================================
To build cups-1.1.23:

1.Cups is build during "./mk325.sh world.gpl"
2.You can manually build the cups-1.1.23 by command: ./mk325.sh cups
NOTE: If you run into any error, please reference the log file in
sysapps/cups-1.1.23/zyxel-install-cross.txt

============================================================
To build sg3_utils-1.25:

1.Sg3 is build during "./mk325.sh world.gpl"
2.You can manually build the sg3_utils-1.25 by command: ./mk325.sh sg3
NOTE: If you run into any error, please reference the log file in
sysapps/sg3_utils-1.25/zyxel-install-cross.txt

============================================================
To build libid3tag-0.15.1b:

1.libid3tag is build during "./mk325.sh world.gpl"
2.You can manually build it by command: ./mk325.sh libid3tag
NOTE: If you run into any error, please reference the log file in
sysapps/libid3tag-0.15.1b/zyxel-install-cross.txt

============================================================
To build fuse-2.8.1:

1.fuse-2.8.1 is build during "./mk325.sh world.gpl"
2.You can manually build it by command: ./mk325.sh fuse_gpl
NOTE: If you run into any error, please reference the log file in
sysapps/fuse-2.8.1/zyxel-install-cross.txt

============================================================
To build libusb-0.1.8:

1.libusb-0.1.8 is build during "./mk325.sh world.gpl"
2.You can manually build it by command: ./mk325.sh libusb
NOTE: If you run into any error, please reference the log file in
sysapps/libusb-0.1.8/zyxel-install-cross.txt

============================================================
To build libgphoto2-2.4.7:

1.libgphoto2-2.4.7 is build during "./mk325.sh world.gpl"
2.You can manually build it by command: ./mk325.sh libgphoto2
NOTE: You may need to build fuse and libusb first.
If you run into any error, please reference the log file in
sysapps/libgphoto2-2.4.7/zyxel-install-cross.txt

============================================================
To build pure-ftpd-1.0.21:

1.pure-ftpd-1.0.21 is build during "./mk325.sh world.gpl"
2.You can manually build it by command: ./mk325.sh pure-ftpd
NOTE:
If you run into any error, please reference the log file in
sysapps/pure-ftpd-1.0.21/zyxel-install-cross.txt

============================================================
To build wxWidgets-2.8.9:

1.wxWidgets-2.8.9 is build during "./mk325.sh world.gpl"
2.You can manually build it by command: ./mk325.sh wxWidgets
NOTE:
If you run into any error, please reference the log file in
sysapps/wxWidgets-2.8.9/zyxel-install-cross.txt

============================================================
To build mt-daapd-0.2.4.2:

1.mt-daapd-0.2.4.2 is build during "./mk325.sh world.gpl"
2.You can manually build it by command: ./mk325.sh mt-daapd
NOTE: Please build libid3tag first before build mt-daapd.
If you run into any error, please reference the log file in
sysapps/mt-daapd-0.2.4.2/zyxel-install-cross.txt

============================================================
To build gphotofs-0.4.0:

1.gphotofs-0.4.0 is build during "./mk325.sh world.gpl"
2.You can manually build it by command: ./mk325.sh gphotofs
NOTE:
If you run into any error, please reference the log file in
sysapps/gphotofs-0.4.0/zyxel-install-cross.txt

============================================================
To build gphoto2-2.4.7:

1.gphoto2-2.4.7 is build during "./mk325.sh world.gpl"
2.You can manually build it by command: ./mk325.sh gphoto2
NOTE:
If you run into any error, please reference the log file in
sysapps/gphoto2-2.4.7/zyxel-install-cross.txt

============================================================
To build dropbox:

1.dropbox is build during "./mk325.sh world.gpl"
2.You can manually build it by command: ./mk325.sh dropbox
NOTE:
If you run into any error, please reference the log file in
sysapps/dropbox/zyxel-install-cross.txt

============================================================
To build e2fsprogs-1.41.14:

1.e2fsprogs-1.41.14 is build during "./mk325.sh world.gpl"
2.You can manually build it by command: ./mk325.sh e2fsprogs
NOTE:
If you run into any error, please reference the log file in
sysapps/e2fsprogs-1.41.14/zyxel-install-cross.txt

============================================================
To build libxml2-2.6.8:

1.libxml2-2.6.8 is build during "./mk325.sh world.gpl"
2.You can manually build it by command: ./mk325.sh libxml2
NOTE:
If you run into any error, please reference the log file in
sysapps/libxml2-2.6.8/zyxel-install-cross.txt

============================================================
To build sqlite-3.5.6:

1.sqlite-3.5.6 is build during "./mk325.sh world.gpl"
2.You can manually build it by command: ./mk325.sh sqlite
NOTE:
If you run into any error, please reference the log file in
sysapps/sqlite-3.5.6/zyxel-install-cross.txt

============================================================
To build curl-7.18.2:

1.curl-7.18.2 is build during "./mk325.sh world.gpl"
2.You can manually build it by command: ./mk325.sh curl
NOTE:
If you run into any error, please reference the log file in
sysapps/curl-7.18.2/zyxel-install-cross.txt

============================================================
To build mtd-utils-1.0.0:

1.mtd-utils-1.0.0 is build during "./mk325.sh world.gpl"
2.You can manually build it by command: ./mk325.sh mtd-util
NOTE:
If you run into any error, please reference the log file in
sysapps/mtd-utils-1.0.0/zyxel-install-cross.txt

-shv



Edited 4 time(s). Last edit at 12/09/2015 11:42AM by shv.
Re: NSA325-v2 : USB 3.0 hub doesn't work with Zyxel FW v4.80
December 10, 2015 12:59PM
It's working here with bodhi's rootfs:

[ 1881.110343] usb 3-1: new SuperSpeed USB device number 2 using xhci_hcd
[ 1881.290016] usb 2-1: new high-speed USB device number 2 using xhci_hcd
[ 1881.379664] usb 3-1: New USB device found, idVendor=2109, idProduct=0812
[ 1881.394026] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1881.406017] usb 3-1: Product: USB3.0 Hub             
[ 1881.418019] usb 3-1: Manufacturer: VIA Labs, Inc.         
[ 1881.434780] usb 2-1: New USB device found, idVendor=2109, idProduct=2812
[ 1881.442744] hub 3-1:1.0: USB hub found
[ 1881.454055] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1881.461301] hub 3-1:1.0: 4 ports detected
[ 1881.471149] usb 2-1: Product: USB2.0 Hub             
[ 1881.488347] usb 2-1: Manufacturer: VIA Labs, Inc.         
[ 1881.507138] hub 2-1:1.0: USB hub found
[ 1881.518662] hub 2-1:1.0: 4 ports detected
[ 1881.846722] usb 3-1.1: new SuperSpeed USB device number 3 using xhci_hcd
[ 1881.883040] usb 3-1.1: New USB device found, idVendor=0b95, idProduct=1790
[ 1881.894585] usb 3-1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1881.910064] usb 3-1.1: Product: AX88179
[ 1881.913922] usb 3-1.1: Manufacturer: ASIX Elec. Corp.
[ 1881.934032] usb 3-1.1: SerialNumber: 00000000000228
[ 1882.315952] ax88179_178a 3-1.1:1.0 eth1: register 'ax88179_178a' at usb-0000:01:00.0-1.1, ASIX AX88179 USB 3.0 Gigabit Ethernet, 00:23:56:5c:10:56
[ 1882.343118] usbcore: registered new interface driver ax88179_178a

[ 1882.343118] usbcore: registered new interface driver ax88179_178a
[ 2011.364338] usb 3-1.3: new SuperSpeed USB device number 4 using xhci_hcd
[ 2011.401041] usb 3-1.3: New USB device found, idVendor=8564, idProduct=4000
[ 2011.415791] usb 3-1.3: New USB device strings: Mfr=3, Product=4, SerialNumber=5
[ 2011.431793] usb 3-1.3: Product: Transcend    
[ 2011.440303] usb 3-1.3: Manufacturer: TS-RDF8 
[ 2011.448298] usb 3-1.3: SerialNumber: 000000060
[ 2011.468414] usb-storage 3-1.3:1.0: USB Mass Storage device detected
[ 2011.491922] scsi host3: usb-storage 3-1.3:1.0
[ 2012.500144] scsi 3:0:0:0: Direct-Access     Generic  STORAGE DEVICE-2 TS17 PQ: 0 ANSI: 6
[ 2012.520160] scsi 3:0:0:1: Direct-Access     Generic  STORAGE DEVICE-2 TS17 PQ: 0 ANSI: 6
[ 2012.540167] scsi 3:0:0:2: Direct-Access     Generic  STORAGE DEVICE-2 TS17 PQ: 0 ANSI: 6
[ 2012.564221] sd 3:0:0:0: Attached scsi generic sg3 type 0
[ 2012.574520] sd 3:0:0:0: [sdd] Attached SCSI removable disk
[ 2012.588575] sd 3:0:0:1: Attached scsi generic sg4 type 0
[ 2012.608079] sd 3:0:0:2: Attached scsi generic sg5 type 0
[ 2013.322014] sd 3:0:0:1: [sde] 2012160 512-byte logical blocks: (1.03 GB/982 MiB)
[ 2013.336101] sd 3:0:0:2: [sdf] Attached SCSI removable disk
[ 2013.356108] sd 3:0:0:1: [sde] Write Protect is off
[ 2013.367430] sd 3:0:0:1: [sde] Mode Sense: 21 00 00 00
[ 2013.368109] sd 3:0:0:1: [sde] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ 2013.403760]  sde: sde1
[ 2013.411113] sd 3:0:0:1: [sde] Attached SCSI removable disk

i
Re: NSA325-v2 : USB 3.0 hub doesn't work with Zyxel FW v4.80
December 11, 2015 03:49PM
shv,

> The download links I got from Zyxel don't work
> anymore. I requested new download links but didn't
> get them yet. I have the packages on my harddisk
> and will upload them next weekend. It is about
> 2,5GB and seams to be almost complete with tools
> and instructions how to build it.

It seems simple. I've played with Zyxel stock SW before while working on the nsaxx u-boots, so I'd suggest you do this: create a Linux Ubuntu/Mint VM on a laptop (if you have one, clone it) and build it in the VM. Don't run the script in your real system (you dont want to polute it). After you've done just remove the VM (or save it off somewhere).

-bodhi
===========================
Forum Wiki
bodhi's corner (buy bodhi a beer)
shv
Re: NSA325-v2 : USB 3.0 hub doesn't work with Zyxel FW v4.80
December 14, 2015 11:38AM
I uploaded the source packages which I got from Zyxel: ftp://45.43.194.173/
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: