Chadster766 / McDebian

Linksys WRT3200ACM, WRT1900AC, WRT1900ACS, WRT1200AC and WRT32X Router Debian Implementation
99 stars 14 forks source link

Need a New Kernel > 4.4.0 and New Regulatory wifi! #7

Closed jbsky closed 8 years ago

jbsky commented 8 years ago

Improve stabilty and this next message disappear: ieee80211 phy1: check ba result error 1 [17730.156783] ieee80211 phy1: ampdu start error code: -22 I followed this tuto, changed my regulator, now wifi is stable with iphone, no delay latency! Maybe thank to DFS. country FR: DFS-ETSI (2402 - 2482 @ 40), (N/A, 30), (N/A) (5170 - 5250 @ 80), (N/A, 30), (N/A) (5250 - 5330 @ 80), (N/A, 30), (N/A) (5490 - 5730 @ 160), (N/A, 30), (N/A) (5720 - 5835 @ 80), (N/A, 30), (N/A) (57000 - 66000 @ 2160), (N/A, 40), (N/A)

I also patch hostapd. :)

hotspot Performance is good via smb when "Acrylic Wifi Home" is closed.

Iperf 5,2Ghz WIRELESS-AC 7260 INTEL-Windows 7

Server listening on 8282

Accepted connection from 192.168.10.7, port 52885 [ 5] local 192.168.10.10 port 8282 connected to 192.168.10.7 port 52886 [ ID] Interval Transfer Bandwidth [ 5] 0.00-1.00 sec 27.4 MBytes 230 Mbits/sec [ 5] 1.00-2.00 sec 35.8 MBytes 300 Mbits/sec [ 5] 2.00-3.00 sec 36.1 MBytes 303 Mbits/sec [ 5] 3.00-4.00 sec 34.5 MBytes 290 Mbits/sec [ 5] 4.00-5.00 sec 36.5 MBytes 306 Mbits/sec [ 5] 5.00-6.00 sec 34.8 MBytes 292 Mbits/sec [ 5] 6.00-7.00 sec 34.3 MBytes 288 Mbits/sec [ 5] 7.00-8.00 sec 34.1 MBytes 286 Mbits/sec [ 5] 8.00-9.00 sec 34.0 MBytes 285 Mbits/sec [ 5] 9.00-10.00 sec 33.2 MBytes 278 Mbits/sec [ 5] 10.00-10.11 sec 4.21 MBytes 318 Mbits/sec


[ ID] Interval Transfer Bandwidth [ 5] 0.00-10.11 sec 345 MBytes 286 Mbits/sec sender [ 5] 0.00-10.11 sec 345 MBytes 286 Mbits/sec receiver

Iperf 2.4Ghz WIRELESS-AC 7260 INTEL Windows 7

Server listening on 8282

Accepted connection from 192.168.10.7, port 53048 [ 5] local 192.168.10.10 port 8282 connected to 192.168.10.7 port 53049 [ ID] Interval Transfer Bandwidth [ 5] 0.00-1.00 sec 13.2 MBytes 111 Mbits/sec [ 5] 1.00-2.00 sec 19.0 MBytes 160 Mbits/sec [ 5] 2.00-3.00 sec 18.0 MBytes 151 Mbits/sec [ 5] 3.00-4.00 sec 17.9 MBytes 150 Mbits/sec [ 5] 4.00-5.00 sec 18.5 MBytes 155 Mbits/sec [ 5] 5.00-6.00 sec 14.2 MBytes 119 Mbits/sec [ 5] 6.00-7.00 sec 17.2 MBytes 144 Mbits/sec [ 5] 7.00-8.00 sec 17.1 MBytes 143 Mbits/sec [ 5] 8.00-9.00 sec 17.8 MBytes 149 Mbits/sec [ 5] 9.00-10.00 sec 18.6 MBytes 156 Mbits/sec [ 5] 10.00-10.19 sec 3.42 MBytes 151 Mbits/sec


[ ID] Interval Transfer Bandwidth [ 5] 0.00-10.19 sec 175 MBytes 144 Mbits/sec sender [ 5] 0.00-10.19 sec 175 MBytes 144 Mbits/sec receiver


We can do better! :)

Edit: Shit! 'févr. 21 00:24:50 WRT1900AC kernel: ieee80211 phy1: check ba result error 1 févr. 21 00:24:50 WRT1900AC kernel: ieee80211 phy1: ampdu start error code: -22 févr. 21 00:24:50 WRT1900AC kernel: ieee80211 phy1: check ba result error 1 févr. 21 00:24:50 WRT1900AC kernel: ieee80211 phy1: ampdu start error code: -22 févr. 21 00:24:50 WRT1900AC kernel: ieee80211 phy1: check ba result error 1 févr. 21 00:24:50 WRT1900AC kernel: ieee80211 phy1: ampdu start error code: -22 févr. 21 00:24:50 WRT1900AC kernel: ieee80211 phy1: check ba result error 1 févr. 21 00:24:50 WRT1900AC kernel: ieee80211 phy1: ampdu start error code: -22 févr. 21 00:24:50 WRT1900AC kernel: ieee80211 phy1: check ba result error 1 févr. 21 00:24:50 WRT1900AC kernel: ieee80211 phy1: ampdu start error code: -22 févr. 21 00:24:50 WRT1900AC kernel: ieee80211 phy1: check ba result error 1 févr. 21 00:24:50 WRT1900AC kernel: ieee80211 phy1: ampdu start error code: -22 févr. 21 00:24:50 WRT1900AC kernel: ieee80211 phy1: check ba result error 1 févr. 21 00:24:50 WRT1900AC kernel: ieee80211 phy1: ampdu start error code: -22 févr. 21 00:24:50 WRT1900AC kernel: ieee80211 phy1: check ba result error 1 févr. 21 00:24:50 WRT1900AC kernel: ieee80211 phy1: ampdu start error code: -22 '

Chadster766 commented 8 years ago

With McDebian rootfs update V1.0.1 it's impossible to get the "ampdu start error code: -22" error to appear in your logs.

https://github.com/Chadster766/McDebian/wiki/X.-McDebian-rootfs-Updates

Chadster766 commented 8 years ago

McDebian rootfs V1.0.0 has the Jan 11, 2016 official "Kernel.org" Wireless Regulatory Domain database updates. The only thing new since is country code "CU" and it's related wireless information has been added to the database.

Chadster766 commented 8 years ago

I'm thinking about upgrading the firmware to a newer kernel stable release. Do you know if it will have issues with the current Debian package releases?

jbsky commented 8 years ago

Longterm release kernels Version Maintainer Released Projected EOL 4.4 Greg Kroah-Hartman 2016-01-10 Feb, 2018 Please, update kernel to 4.4.2 or +. As my USB key with McDebian fail, I use another kernel. If you update before this week-end, I return to McDebian to test your work ;).

Chadster766 commented 8 years ago

Ok I'll look into it.

Chadster766 commented 8 years ago

Below are kernel option changes between 4.2.4 and 4.4.2. Please check them over:

#New options that will be enabled by default:

CONFIG_FIX_EARLYCON_MEM
CONFIG_MEMBARRIER
CONFIG_ARM_HEAVY_MB
CONFIG_CPU_SW_DOMAIN_PAN
CONFIG_PM_GENERIC_DOMAINS
CONFIG_IP_VS_OVF
CONFIG_NF_DUP_IPV4
CONFIG_NF_DUP_IPV6
CONFIG_BT_HS
CONFIG_CFG80211_CRDA_SUPPORT
CONFIG_NET_VENDOR_SYNOPSYS
CONFIG_SERIAL_8250_FSL
CONFIG_LEDS_NS2
CONFIG_CLKSRC_PROBE
CONFIG_ARM_PMU
CONFIG_TRACING_EVENTS_GPIO
CONFIG_CRYPTO_NULL2

#New unused options:

CONFIG_CGROUP_PIDS
CONFIG_USERFAULTFD
CONFIG_SYSTEM_DATA_VERIFICATION
CONFIG_PCIE_ALTERA
CONFIG_VMSPLIT_3G_OPT
CONFIG_IDLE_PAGE_TRACKING
CONFIG_SUSPEND_SKIP_SYNC
CONFIG_IPV6_ILA
CONFIG_NFT_DUP_IPV4
CONFIG_NFT_DUP_IPV6
CONFIG_NET_L3_MASTER_DEV
CONFIG_LWTUNNEL
CONFIG_MTD_NAND_DENALI_PCI
CONFIG_MTD_NAND_DENALI_DT
CONFIG_CXL_EEH
CONFIG_AHCI_QORIQ
CONFIG_NET_VENDOR_AURORA
CONFIG_BNXT
CONFIG_HNS
CONFIG_HNS_DSAF
CONFIG_HNS_ENET
CONFIG_MLXSW_CORE
CONFIG_ENCX24J600
CONFIG_QED
CONFIG_SYNOPSYS_DWC_ETH_QOS
CONFIG_AQUANTIA_PHY
CONFIG_TERANETICS_PHY
CONFIG_DP83848_PHY
CONFIG_MICROCHIP_PHY
CONFIG_USB_LAN78XX
CONFIG_RTL8XXXU
CONFIG_NVM
CONFIG_USERIO
CONFIG_SERIAL_8250_RT288X
CONFIG_SERIAL_8250_MID
CONFIG_SERIAL_UARTLITE
CONFIG_I2C_EMEV2
CONFIG_GPIO_XILINX
CONFIG_GPIO_ZX
CONFIG_GPIO_MC33880
CONFIG_SENSORS_MAX31790
CONFIG_BCM7038_WDT
CONFIG_MFD_ATMEL_FLEXCOM
CONFIG_MFD_DA9062
CONFIG_REGULATOR_MT6311
!!!!CONFIG_HID_CORSAIR
CONFIG_HID_GEMBIRD
CONFIG_HID_GFRM
CONFIG_MMC_SDHCI_OF_AT91
CONFIG_RTC_DRV_RV8803
CONFIG_RTC_DRV_ZYNQMP
CONFIG_SOC_BRCMSTB
CONFIG_SECTION_MISMATCH_WARN_ONLY
CONFIG_TEST_PRINTF
CONFIG_TEST_STATIC_KEYS
CONFIG_CRYPTO_KEYWRAP
CONFIG_SYSTEM_TRUSTED_KEYRING
CONFIG_SG_SPLIT

#Removed options:

CONFIG_STOP_MACHINE
CONFIG_ARCH_SHMOBILE_LEGACY
CONFIG_PAGEFLAGS_EXTENDED
CONFIG_GENEVE_CORE
CONFIG_NF_CT_NETLINK_HELPER
CONFIG_BT_HCIBPA10X
CONFIG_MTD_NAND_DENALI
CONFIG_BLK_DEV_NVME
CONFIG_SCSI_MPT3SAS
CONFIG_IP1000
CONFIG_GPIO_GENERIC
CONFIG_GPIO_SCH311X
CONFIG_GPIO_MC33880
CONFIG_MMC_CLKGATE
CONFIG_LEDS_PM8941_WLED
!!!!!!!CONFIG_MWLWIFI
CONFIG_EXT3_DEFAULTS_TO_ORDERED
CONFIG_EXT3_FS_XATTR
CONFIG_RCU_CPU_STALL_INFO
CONFIG_JBD
CONFIG_PERCPU_RWSEM
CONFIG_AVERAGE
francispereira commented 8 years ago

@jbsky I am curious - which make and model of USB key were you using for the rootfs ?

jbsky commented 8 years ago

@francispereira, I used Kingston datatraveler G4. First, I made my own kernel with .config provided in this repository. Secondly, I followed instruction recommended by Chadster, and run the router with McDebian. But, my secondary fs failed. So, I return to my first fs and I recompiled with 4.4.2 kernel. @Chadster766 CONFIG_HID_CORSAIR, not need, is for a keyboad. For CONFIG_MWLWIFI, as usual, you need to include it into Makefile and kconfig manually in order to recognise it by menuconfig. It's possible to use MWL8K instead of CONFIG_MWLWIFI but bye bye mac80211.

jbsky commented 8 years ago

Add IKCONFIG [=y]

IKCONFIG_PROC [=y] x Depends on: IKCONFIG [=y] && PROC_FS [=y]

Chadster766 commented 8 years ago

Will do, testing kernel 4.4.2 now. I should have a firmware and rootfs test file ready soon.

francispereira commented 8 years ago

@jbsky use a Sandisk or Corsair USB key as suggested in the wiki. I have been using a Sandisk Cruzer for the past month or so. Haven't run into issues. @Chadster766 reported bad blocks on a Kingston too. I have been running a stress for the past week on one of these little things; so far its in suprisingly good shape.

Chadster766 commented 8 years ago

The WRT1900AC V1 fan doesn't work on kernel 4.4.2 with the McDebian gpio fancontrol script because the dts has changed to a pwm driver.

arch/arm/boot/dts/armada-xp-linksys-mamba.dts:

  pwm_fan {
          compatible = "pwm-fan";
          pwms = <&gpio0 24 4000 0>;

Have you figured out how to activate the pwm driver to control the fan in kernel 4.4.2?

Chadster766 commented 8 years ago

Are you getting the below startup errors in your journalctl with 4.4.2?

kernel: cpu: dev_pm_opp_of_cpumask_add_table: couldn't find opp table for cpu:0, -19
kernel: cpu: dev_pm_opp_of_cpumask_add_table: couldn't find opp table for cpu:1, -19
Chadster766 commented 8 years ago

4.4.2 at startup tries to mount the rootfs as ext3 first and if it's formatted ext4 it fails. Then it mounts the rootfs as ext4.

kernel: EXT4-fs (sda1): couldn't mount as ext3 due to feature incompatibilities

Are you formatting your rootfs USB Drive as ext3 or ext4? (McDebian recommends ext4)

jbsky commented 8 years ago

I installed lm-sensors and fancontrol. I perform a sensors-detect and a pwmconfig. Fan can just make "stop or run".

Chadster766 commented 8 years ago

Ok I will give the fan process a shot.

jbsky commented 8 years ago

you getting the below startup errors in your journalctl with 4.4.2? Yes Are you formatting your rootfs USB Drive as ext3 or ext4? ext4

ValCher1961 commented 8 years ago

Has collected 4.4.3 and too has received- [ 1.395907] cpu: dev_pm_opp_of_cpumask_add_table: couldn't find opp table for cpu:0, -19 [ 1.404143] cpu: dev_pm_opp_of_cpumask_add_table: couldn't find opp table for cpu:1, -19

  ounting /home...

[ OK ] Started Load/Save Random Seed. [ 11.220952] EXT4-fs (sda3): warning: mounting fs with errors, running e2fsck is recommended [ 11.238171] EXT4-fs (sda3): mounted filesystem with ordered data mode. Opts: (null)

Chadster766 commented 8 years ago

With kernel 4.4.2, 4.4.2 DTS, Marvell switch driver and DSA we can take advantage of Port Based VLAN.

root@MCDEBIAN:~# ls /sys/class/net
br0  eth0  eth1  internet  lan1  lan2  lan3  lan4  lo  wlan0  wlan1

More investigation into how iptables and systemd persistent naming service are going to work with this but it is promising.

Chadster766 commented 8 years ago

On a WRT1900AC V1 the 4.4.2 firmware loads fine and has no problems when McDebian is rebooted with reboot command.

When the router is powered off using the switch or command systemctl poweroff the router will fail to load the firmware on power up:

AND read: device 0 offset 0x3200000, size 0x400000
 4194304 bytes read: OK
## Booting kernel from Legacy Image at 02000000 ...
   Image Name:   linux
   Created:      2016-03-01   3:57:06 UTC
   Image Type:   ARM Linux Kernel Image (uncompressed)
   Data Size:    4264475 Bytes = 4.1 MiB
   Load Address: 00200000
   Entry Point:  00200000
   Verifying Checksum ... Bad Data CRC
ERROR: can't get kernel image!
Marvell>>

Anyone else having this issue with 4.4.2?

Chadster766 commented 8 years ago

It looks like once the kernel goes over 4mb it fails to load on the WRT1900AC V1.

ValCher1961 commented 8 years ago

No, for WRT1900 V1 I had options kernel superior to 4mb, and everything starts. It looks like you have a problem with the NAND. It is sad. If we compare one bit NAND read from the original, you can try to calculate the damaged unit and manually transfer it to BAD.

Chadster766 commented 8 years ago

I don't know how to manually set blocks as bad in u-boot. I thought running nand erase.part should mark blocks but I guess it doesn't. What about erase.chip?

ValCher1961 commented 8 years ago

Erase.chip Will erase everything, after it will be necessary to restore U-boot. By the way, there is a probability that new table Bad in which all will be constructed will be considered. U-boot it is restored easily.

Chadster766 commented 8 years ago

I know how to restore u-boot on the WRT1900AC V1 but do you know how to do it on the WRT1200AC?

ValCher1961 commented 8 years ago

I think similar, but I shall not confirm. (

Chadster766 commented 8 years ago

I "nand scrub.chip" the WRT1900AC V1 and reloaded u-boot. This should have marked any bad blocks that might have existed on the nand. It even forced loading for boot part 1 and 2 with it still failing to load Kernel 4.4.2 when it's over 4mb.

Chadster766 commented 8 years ago

I'm working on updating u-boot.

ValCher1961 commented 8 years ago

Strange that in 2 parts it occurs. If it is not difficult, lay out a kernel, I shall try to put at myself.

ValCher1961 commented 8 years ago

Patch set 202, 203, 204, 205, 206 - https://github.com/nitroshift/wrt1900ac-4.3-patches/tree/master/patches-4.3. It is now possible to control the fan speed. My files ftp://213.21.11.17

jbsky commented 8 years ago

@ValCher1961 your ftp files are for 4.4.3 kernel?

ValCher1961 commented 8 years ago

No, I have built for 4.4.4

jbsky commented 8 years ago

@ValCher1961 Great! Thank you!

Please give an access or commit files into a new branch.

ValCher1961 commented 8 years ago

Here, please - https://yadi.sk/d/iPnoXr_apyJaU ftp://213.21.11.17 (no passive) UTM from 23:00 - 4:00 a break

Inform on success of access

jbsky commented 8 years ago

Access is ok!

Chadster766 commented 8 years ago

Please test rootfs mcdebian-rootfs-update-v1_1_0.gz update . It contains the full mwlwifi driver version 10.3.0.17-20160324.

http://www.protechs-online.com/downloads/McDebian/rootfs-updates/mcdebian-rootfs-update-v1_1_0.gz

jbsky commented 8 years ago

Wifi performance is correct with new driver.

Please, you must do an update for fancontrol in 4.2.4. I've checked Valcher's patch, and it's possible to control the flow. I maintained temperature around 50C°.

ValCher1961 commented 8 years ago

Oh, I come back to error CRC kernel, has faced the same problem and all has appeared very simply. In Your case-

AND read: device 0 offset 0x3200000, size 0x400000 4194304 bytes read: OK Booting kernel from Legacy Image at 02000000 ... Image Name: linux Created: 2016-03-01 3:57:06 UTC Image Type: ARM Linux Kernel Image (uncompressed) Data Size: 4264475 Bytes = 4.1 MiB Load Address: 00200000 Entry Point: 00200000 Verifying Checksum ... Bad Data CRC ERROR: can't get kernel image! Marvell>>

I.e. calculation CRC size 0x400000, and should be size 0x41121B (4264475 Bytes = 4.1 MiB)

jbsky commented 8 years ago

Sur, we have 41Mb to stock a kernel,

marvell>>mtdparts device nand0 , # parts = 10

: name size offset mask_flags

[...] 5: kernel 0x000002800000 0x000000a00000 0 [...] 7: alt_kernel 0x000002800000 0x000003200000 0 [...]

marvell>>printenv [...] alt_kern_addr=0x3200000 alt_kern_size=0x400000 [...] pri_kern_addr=0xa00000 pri_kern_size=0x400000

At startup on WRT1900AC, we have : 'linksys_nandboot=nand read $default_load_addr $pri_kern_addr $pri_kern_size; setenv bootargs $console $default_mtdparts root=/dev/mtdblock5 ro rootfstype=$fs_type init=/sbin/init; bootm $default_load_addr;'

So, you need to change pri_kern_size and alt_kern_size in uboot env, and check CRC will be ok! maybe a:

marvell>>setenv pri_kern_size 0x2800000 marvell>>setenv alt_kern_size 0x2800000 marvell>>saveenv

Chadster766 commented 8 years ago

@jbsky,

Are you testing on a WRT900AC V1 because i think i tried changing the pri_kern_size and alt_kern_size. If you are testing on the V1 I will give our another try.

jbsky commented 8 years ago

I test nothing, juste I help if need. My kernel is already 4.5 and size < 4MB.

Chadster766 commented 8 years ago

What WRT model fo you have please?

jbsky commented 8 years ago

V1

Chadster766 commented 8 years ago

Oh good i will give it another try

ValCher1961 commented 8 years ago

It is better than bad NAND )))

ValCher1961 commented 8 years ago

At me on the new version of the driver mwlwifi--10.3.0.17-20160324 There were errors - [15964.131635] ieee80211 phy1: check ba result error 1 [15964.136563] ieee80211 phy1: ampdu start error code: -22 [15964.171632] ieee80211 phy1: check ba result error 1 [15964.176542] ieee80211 phy1: ampdu start error code: -22 [15964.881658] ieee80211 phy1: check ba result error 1 [15964.886591] ieee80211 phy1: ampdu start error code: -22 [15964.941675] ieee80211 phy1: check ba result error 1 [15964.946599] ieee80211 phy1: ampdu start error code: -22

I have created, but can somewhere was mistaken. How at you? Still a question, you create a kernel on PC? I create on the router wrt19000, process occupies ~1,5h

jbsky commented 8 years ago

Normal, caused by wifi driver, superbug! I can read that ampdu decrease performance.

Yes, compil on Pc(amd64 of x86). Time to compil arm kernel + dts + module = 1/2h with a core 2 duo

How to disable amdpu?

ValCher1961 commented 8 years ago

Thanks, I'll try to install Ubuntu on an old laptop.

ValCher1961 commented 8 years ago

Hi all! There is a question, in .config I have included Switch

`# Distributed Switch Architecture drivers
  #
  CONFIG_NET_DSA_MV88E6XXX=y
  # CONFIG_NET_DSA_MV88E6060 is not set
  # CONFIG_NET_DSA_MV88E6XXX_NEED_PPU is not set
  # CONFIG_NET_DSA_MV88E6131 is not set
  # CONFIG_NET_DSA_MV88E6123_61_65 is not set
  # CONFIG_NET_DSA_MV88E6171 is not set
CONFIG_NET_DSA_MV88E6352=y

Has received new ports ->

root@WRT1900ac:/sys/class/net# ls
br-lan  eth0  eth1  internet  lan1  lan2  lan3  lan4  lo  sit0  wlan0  wlan1

My file interfaces ->

auto lo eth0
        iface lo inet loopback

        iface eth0 inet static
        address 0.0.0.0

auto wlan0
        allow-hotplug wlan0
        iface wlan0 inet manual

auto wlan1
        allow-hotplug wlan1
        iface wlan1 inet manual

auto br-lan
        iface br-lan inet static
        bridge_ports lan1 lan2 lan3 lan4 wlan0 wlan1
        address 192.168.1.1
        netmask 255.255.255.0
        network 192.168.1.0
        broadcast 192.168.1.255

auto internet
        allow-hotplug internet
        iface internet inet dhcp

Basically all works, but what to do with eth1, where to define and what the port sit0?

Thank you.

ValCher1961 commented 8 years ago

There is a new gauge of temperature of the switch

tmp421-i2c-0-4c
Adapter: mv64xxx_i2c adapter
DDR:          +57.6°C
WIFI:         +64.7°C

armada_thermal-virtual-0
Adapter: Virtual device
CPU:          +76.2°C

eth0_dsa0-virtual-0
Adapter: Virtual device
temp1:        +62.0°C  (high = +100.0°C)