Netgear R7800 exploration (IPQ8065, QCA9984)

Update: changing my entire network to Tx/Rx on 20MHZ bandwidth seems to eliminate the problem; i'm wondering if its an issue with my packets source, rather than any individual setting on the R7800

I read that suggestion on the dd-wrt forum as well. So, I set my radio1 networks to 20MHz as well. Seems less unstable now.

@shelterx -- where do we find said firmware and how do we update it? What about the driver, does that need to be updated to match firmware?

# opkg list | grep ath10k | grep -v \\-ct

1 Like

Or go here:

1 Like

Any advise on resolving flashing problem with R7800? Any firmware except the Netgear's one leads to bootloop. Can telnet to the router running the original firmware and run linux commands there.

Did you TFTP install Openwrt firmware or attempt to flash it through the Web UI?

Yes, I tried installing via TFTP the original 18.06.04 (openwrt-18.06.4-ipq806x-netgear_r7800-squashfs-factory.img). Also several custom builds. But only R7800-V1.0.2.62.img seems to work.

If you do IRQ affinity by hand, I've seen the recommendation to put both eth0 and eth1 IRQs on CPU1. Do eth0 and eth1 both handle WiFi? I don't understand how it all maps from VLANs to CPUs to IRQs.

Is the proper way to add this to rc.local?

echo 2 > /proc/irq/31/smp_affinity
echo 2 > /proc/irq/32/smp_affinity

The values you can set seem to be 1,2,3. What do the bits mean? 1=CPU0, 2=CPU1, 3=??? (either?) ?

They are bits. A bitmask telling the allowed cores.
(It might be more clear if there were more cores.)

1 Like

I just tried hnyman's latest -ct build (r10829-91c84e87c2). Unfortunately the same wifi issues with 2 of my clients :frowning: Back to the "old" builds.

dmesg shows some crashes too, but it seems to recover from them.
I reported them on GitHub if anyone is interested in the full dmesg:

Not specifically for the R7800, but one of the latest trunk builds I tried (actually, the first 4.19 kernel I tried with ath10k (not -ct) and the fix for the crash on association (https://git.openwrt.org/?p=openwrt/openwrt.git;a=commitdiff;h=2ceee0e02362519f08be2a288bd8f42ca6cef257) had terrible WiFi performance. My device is an Archer C7 v2 (QCA988x).

For instance, going from a wireless laptop to a wired pc on local lan would not reach speeds above 100Mbps, where previous builds (kernel 4.14) could easily do 300Mpbs and up. Does this have anything to do with the "SWBA overrun on vdev 0, skipped old beacon" messages/bug?

At least partially. When monitoring CPU utilisation for a longer period, the mainline ath10k with "SWBA overrun" errors seemed to cause somewhat higher idle CPU load than the -ct version. Likely the "SWBA overrun" version also causes higher CPU load (and lower throughput) during higher traffic loads, too.

I used to have a lot of reboots with 18.6.1 and 18.6.2. Now with 18.6.4 everything works stable, never a problem. I rolled my own firmware with the builder though. Unfortunately my network has changed a lot so I'm not sure if the stability is because of my network setup has changed or if it's an actual improvement in Openwrt. (I have mostly the same devices (NAS'es, VM's etc), on my network but I now use a wireless AC bridge so I can move the devices away from the living room, if anything this puts even more stress on the wireless connection)

I briefly tried DD-WRT and it was stable too, but Openwrt just "feels" more right with this router, and had better performance and WIFI speeds. Tried an earlier KONG build of Openwrt, it was a little more stable, but not quite. Also had a lot of problems when logging onto the router, I sometimes had to switch browsers. (it wasnt necessarily the "https" option's fault, which KONG's build used, because I use it myself in my own build now without problem).

It might still have problems in a technical sense, which some of you could analyze through logs and "-CT" version or whatnot. But for all intents and purposes, it serves my needs.

Except one really strange thing, Outward (from the router through ethernet) Samba performance slows way down to 2MB/s when I'm using a Kernel with MUQSS CPU scheduler, building the same kernel but with CFS scheduler fixes that. I can also put an external switch in-between, that also fixes it. This is with an old Fast Ethernet chipset though, and I haven't tried to replicate this on other PC's.

Thanks. Any mention of what might be the cause? I'm not sure why it would suddenly not work at 80HT- could it be a buffering issue which causes the R7800 to drop high throughput packets?

What's the status on kernel 4.19 for the R7800? Although I haven't tried running 4.14 for a long time, I believe the issue with fragmented UDP responses causing reboots still exists. From what I've seen the fixes in 4.19 never made it into 4.14.

The patches aren't available in master yet, but I've been running them (and the changes to get USB working) for a couple of months now (nbg6817).

I've also been running 4.19 for some months now with @chunkeey's 4.19 patch, but I haven't applied any patches to fix USB since I don't use it. Does USB need more testing?

This is what I use on top of @chunkeey's v4.19 patch (tested only on the nbg6817, USB 2.0 and 3.0 are working), but he suggested in the commit message that USB 3.0 throughput might be a little (20 MBit/s) slower (I can't test that, I don't have any USB 3.0 devices which would max out the bandwidth (it's higher than USB 2.0 can offer, but that's all I can test)).

diff --git a/target/linux/ipq806x/Makefile b/target/linux/ipq806x/Makefile
index cca8c20cb3..c7515c31f2 100644
--- a/target/linux/ipq806x/Makefile
+++ b/target/linux/ipq806x/Makefile
@@ -17,13 +17,11 @@ KERNELNAME:=zImage Image dtbs
 
 include $(INCLUDE_DIR)/target.mk
 
-# TODO: 4.19 drops kmod-usb-dwc3-of-simple which is replaced by_kmod-usb-dwc3-qcom
-# 4.19 also integrates kmod-usb-phy-qcom-dwc3
 DEFAULT_PACKAGES += \
 	kmod-leds-gpio kmod-gpio-button-hotplug swconfig \
 	kmod-ata-core kmod-ata-ahci kmod-ata-ahci-platform \
 	kmod-usb-core kmod-usb-ohci kmod-usb2 kmod-usb-ledtrig-usbport \
-	kmod-usb3 kmod-usb-dwc3-of-simple kmod-usb-phy-qcom-dwc3 \
+	kmod-usb3 kmod-usb-dwc3-qcom kmod-usb-phy-qcom-dwc3 \
 	kmod-ath10k-ct wpad-basic \
 	uboot-envtools
 
diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-ap161.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-ap161.dts
index f1f50f0e0f..983295031e 100644
--- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-ap161.dts
+++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-ap161.dts
@@ -140,11 +140,11 @@
 			status = "okay";
 		};
 
-		usb30@0 {
+		usb3_0: usb3@110f8800 {
 			status = "okay";
 		};
 
-		usb30@1 {
+		usb3_1: usb3@100f8800 {
 			status = "okay";
 		};
 
diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-c2600.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-c2600.dts
index 6e3b5f0ccb..9bf0c4d6b7 100644
--- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-c2600.dts
+++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-c2600.dts
@@ -314,14 +314,14 @@
 			};
 		};
 
-		usb30@0 {
+		usb3_0: usb3@110f8800 {
 			status = "okay";
 
 			pinctrl-0 = <&usb0_pwr_en_pin>;
 			pinctrl-names = "default";
 		};
 
-		usb30@1 {
+		usb3_1: usb3@100f8800 {
 			status = "okay";
 
 			pinctrl-0 = <&usb1_pwr_en_pin>;
diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-d7800.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-d7800.dts
index e187c3e42a..f8aa70b75d 100644
--- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-d7800.dts
+++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-d7800.dts
@@ -152,14 +152,14 @@
 			status = "okay";
 		};
 
-		usb30@0 {
+		usb3_0: usb3@110f8800 {
 			status = "okay";
 
 			pinctrl-0 = <&usb0_pwr_en_pins>;
 			pinctrl-names = "default";
 		};
 
-		usb30@1 {
+		usb3_1: usb3@100f8800 {
 			status = "okay";
 
 			pinctrl-0 = <&usb1_pwr_en_pins>;
diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-db149.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-db149.dts
index 491c37cf22..4b6b9abd22 100644
--- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-db149.dts
+++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-db149.dts
@@ -123,11 +123,11 @@
 			status = "okay";
 		};
 
-		usb30@0 {
+		usb3_0: usb3@110f8800 {
 			status = "okay";
 		};
 
-		usb30@1 {
+		usb3_1: usb3@100f8800 {
 			status = "okay";
 		};
 
diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts
index e5f95ab857..399b11c2d6 100644
--- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts
+++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-ea8500.dts
@@ -145,11 +145,11 @@
 			status = "okay";
 		};
 
-		usb30@0 {
+		usb3_0: usb3@110f8800 {
 			status = "okay";
 		};
 
-		usb30@1 {
+		usb3_1: usb3@100f8800 {
 			status = "okay";
 		};
 
diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-r7500.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-r7500.dts
index c21abb90c9..93dc5aab1a 100644
--- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-r7500.dts
+++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-r7500.dts
@@ -132,12 +132,12 @@
 			status = "okay";
 		};
 
-		usb30@0 {
+		usb3_0: usb3@110f8800 {
 			clocks = <&gcc USB30_1_MASTER_CLK>;
 			status = "okay";
 		};
 
-		usb30@1 {
+		usb3_1: usb3@100f8800 {
 			clocks = <&gcc USB30_0_MASTER_CLK>;
 			status = "okay";
 		};
diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts
index b02f86404f..003d11b952 100644
--- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts
+++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-r7500v2.dts
@@ -156,14 +156,14 @@
 			status = "okay";
 		};
 
-		usb30@0 {
+		usb3_0: usb3@110f8800 {
 			status = "okay";
 
 			pinctrl-0 = <&usb0_pwr_en_pins>;
 			pinctrl-names = "default";
 		};
 
-		usb30@1 {
+		usb3_1: usb3@100f8800 {
 			status = "okay";
 
 			pinctrl-0 = <&usb1_pwr_en_pins>;
diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts
index 989d0c3c09..031a602d2c 100644
--- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts
+++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064-vr2600v.dts
@@ -233,11 +233,11 @@
 			};
 		};
 
-		usb30@0 {
+		usb3_0: usb3@110f8800 {
 			status = "okay";
 		};
 
-		usb30@1 {
+		usb3_1: usb3@100f8800 {
 			status = "okay";
 		};
 
diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064.dtsi b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064.dtsi
index 2a6bd25216..c53a5c61bf 100644
--- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064.dtsi
+++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8064.dtsi
@@ -977,6 +977,22 @@
 			reg = <0x01200600 0x100>;
 		};
 
+		hs_phy_0: hs_phy_0 {
+			compatible = "qcom,dwc3-hs-usb-phy";
+			regmap = <&usb3_0>;
+			clocks = <&gcc USB30_0_UTMI_CLK>;
+			clock-names = "ref";
+			#phy-cells = <0>;
+		};
+
+		ss_phy_0: ss_phy_0 {
+			compatible = "qcom,dwc3-ss-usb-phy";
+			regmap = <&usb3_0>;
+			clocks = <&gcc USB30_0_MASTER_CLK>;
+			clock-names = "ref";
+			#phy-cells = <0>;
+		};
+
 		usb3_0: usb3@110f8800 {
 			compatible = "qcom,dwc3", "syscon";
 			#address-cells = <1>;
@@ -992,22 +1008,6 @@
 
 			status = "disabled";
 
-			hs_phy_0: hs_phy {
-				compatible = "qcom,dwc3-hs-usb-phy";
-				regmap = <&usb3_0>;
-				clocks = <&gcc USB30_0_UTMI_CLK>;
-				clock-names = "ref";
-				#phy-cells = <0>;
-			};
-
-			ss_phy_0: ss_phy {
-				compatible = "qcom,dwc3-ss-usb-phy";
-				regmap = <&usb3_0>;
-				clocks = <&gcc USB30_0_MASTER_CLK>;
-				clock-names = "ref";
-				#phy-cells = <0>;
-			};
-
 			dwc3_0: dwc3@11000000 {
 				compatible = "snps,dwc3";
 				reg = <0x11000000 0xcd00>;
@@ -1019,6 +1019,22 @@
 			};
 		};
 
+		hs_phy_1: hs_phy_1 {
+			compatible = "qcom,dwc3-hs-usb-phy";
+			regmap = <&usb3_1>;
+			clocks = <&gcc USB30_1_UTMI_CLK>;
+			clock-names = "ref";
+			#phy-cells = <0>;
+		};
+
+		ss_phy_1: ss_phy_1 {
+			compatible = "qcom,dwc3-ss-usb-phy";
+			regmap = <&usb3_1>;
+			clocks = <&gcc USB30_1_MASTER_CLK>;
+			clock-names = "ref";
+			#phy-cells = <0>;
+		};
+			
 		usb3_1: usb3@100f8800 {
 			compatible = "qcom,dwc3", "syscon";
 			#address-cells = <1>;
@@ -1034,22 +1050,6 @@
 
 			status = "disabled";
 
-			hs_phy_1: hs_phy {
-				compatible = "qcom,dwc3-hs-usb-phy";
-				regmap = <&usb3_1>;
-				clocks = <&gcc USB30_1_UTMI_CLK>;
-				clock-names = "ref";
-				#phy-cells = <0>;
-			};
-
-			ss_phy_1: ss_phy {
-				compatible = "qcom,dwc3-ss-usb-phy";
-				regmap = <&usb3_1>;
-				clocks = <&gcc USB30_1_MASTER_CLK>;
-				clock-names = "ref";
-				#phy-cells = <0>;
-			};
-
 			dwc3_1: dwc3@10000000 {
 				compatible = "snps,dwc3";
 				reg = <0x10000000 0xcd00>;
diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts
index 2a9f82ff14..35358fda8d 100644
--- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts
+++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8065-nbg6817.dts
@@ -189,14 +189,14 @@
 			};
 		};
 
-		usb30@0 {
+		usb3_0: usb3@110f8800 {
 			status = "okay";
 
 			pinctrl-0 = <&usb0_pwr_en_pins>;
 			pinctrl-names = "default";
 		};
 
-		usb30@1 {
+		usb3_1: usb3@100f8800 {
 			status = "okay";
 
 			pinctrl-0 = <&usb1_pwr_en_pins>;
diff --git a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8065-r7800.dts b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8065-r7800.dts
index 0bc6853ac5..033aa6b079 100644
--- a/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8065-r7800.dts
+++ b/target/linux/ipq806x/files-4.19/arch/arm/boot/dts/qcom-ipq8065-r7800.dts
@@ -224,14 +224,14 @@
 			status = "okay";
 		};
 
-		usb30@0 {
+		usb3_0: usb3@110f8800 {
 			status = "okay";
 
 			pinctrl-0 = <&usb0_pwr_en_pins>;
 			pinctrl-names = "default";
 		};
 
-		usb30@1 {
+		usb3_1: usb3@100f8800 {
 			status = "okay";
 
 			pinctrl-0 = <&usb1_pwr_en_pins>;
diff --git a/target/linux/ipq806x/patches-4.19/0067-generic-Mangle-bootloader-s-kernel-arguments.patch b/target/linux/ipq806x/patches-4.19/0067-generic-Mangle-bootloader-s-kernel-arguments.patch
index c7123eac52..e6e6665a67 100644
--- a/target/linux/ipq806x/patches-4.19/0067-generic-Mangle-bootloader-s-kernel-arguments.patch
+++ b/target/linux/ipq806x/patches-4.19/0067-generic-Mangle-bootloader-s-kernel-arguments.patch
@@ -184,6 +184,6 @@ Signed-off-by: Adrian Panella <ianchi74@outlook.com>
 +	}
 +#endif
 +
- 	parse_early_param();
- 	after_dashes = parse_args("Booting kernel",
- 				  static_command_line, __start___param,
+ 	/* parameters may set static keys */
+ 	jump_label_init();
+	parse_early_param();

It would be nice if ipq806x could be moved forward to kernel 4.19 in master.

2 Likes

we also have patch for cpuidle and broken tsense