-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ath79: add support for linux-4.19 [done] #1635
Conversation
4d63f8c
to
d2c84a9
Compare
rebased and refreshed kernel config. |
d2c84a9
to
4021e5f
Compare
@981213 Thanks, works like a charm! Well, almost :-) I'm experiencing following on my Bullet M/XW which is ar9342:
Don't worry too much about it, I'll look into it later once I've more time, but maybe you would've idea where should I best start looking at. Here is complete dmesg ar9342-ubnt-bullet-m-xw-dmesg.txt |
I tried this out on a Ubiquiti UAP-LR and a UAP-AC-PRO and had no issues on either one. |
@ynezz Is it happen only on 4.19 or both 4.19/4.14? I would suggest a check for PLL values and phy-mode. |
Been running this on my TP-Link Archer C7 v2 for the past few days, no issues so far. |
@981213 Indeed, I'm able to reproduce it also on 4.14. I'll try ar71xx as next. |
@981213 So it's only related to ath79 as it doesn't happen on ar71xx. |
Kernel newer than 4.15 dropped "data" field and used from_timer to cast out the parent struct pointer for current timer. Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
linux 4.19 doesn't accept a NULL device for these functions. It also complains that the device struct in net_device doesn't have a dma_mask set. Pass the device struct from platform_device for these functions. Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
The following patches are dropped because they are merged upstream: -0001-tty-serial-drop-QCA-pecific-SoC-symbols.patch -0006-usb-drop-deprecated-symbols.patch -0009-MIPS-ath79-add-lots-of-missing-registers.patch -0010-MIPS-ath79-add-support-for-QCA953x-QCA956x-TP9343.patch -0014-MIPS-ath79-finetune-cpu-overrides.patch -0015-MIPS-ath79-enable-uart-during-early_prink.patch -0016-MIPS-ath79-get-PCIe-controller-out-of-reset.patch This patch is dropped due to the introduction of spi-mem framework: -461-spi-ath79-add-fast-flash-read.patch Thank to Michael Marley @mamarley for his work on this patch: -910-unaligned_access_hacks.patch Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
4021e5f
to
b24e63d
Compare
Rebased and dropped the to-do from my commit message. |
@ynezz According to the machine code "Ubiquiti Bullet M" uses 100Mbps fixed link in ar71xx and in ath79 the link status is polled from PHY. I don't know which one is correct because I have no idea what's the configuration of the actual device. |
@981213 I don't want to hijack this PR for this and other unrelated issues with ath79 anymore, so I've started new thread on mailing list. |
On ath79 and UBNT Bullet M XW (ar9342) I was experiencing weird issues during network setup[1] which I was able to reproduce easily with following commands: uci set network.lan.ipaddr='192.168.1.20' uci commit network ifup lan Which resulted after some time in: ... WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:461 dev_watchdog+0x16c/0x280 NETDEV WATCHDOG: eth0 (ag71xx): transmit queue 0 timed out ... Sometimes I wasn't able to use networking anymore, sometimes it was enough to just ifdown/ifup lan and network was backup. On ar71xx it was all working just fine. I've found out, that it was happening because ag71xx_poll() wasn't called, thus the TX queue wasn't emptied. The ag71xx_poll() is being called from napi hrtimer, which is enabled by napi_schedule() in ar71xx_interrupt(), but since no interrupts were ever fired again after ag71xx_stop() was called, it was always leading to tx queue timeouts: *** ag71xx_hard_start_xmit() eth0: packet injected into TX queue eth0: raw intr=00000001 TXPS POLL eth0: enable polling mode eth0: processing TX ring, flush=no eth0: disable polling mode, rx=1, tx=1,limit=32 ( `ifup lan done here` ) *** ag71xx_stop() *** ag71xx_open() *** ag71xx_hw_enable() IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready *** ag71xx_hard_start_xmit() eth0: packet injected into TX queue *** ag71xx_hard_start_xmit() eth0: packet injected into TX queue ... WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:320 dev_watchdog+0x164/0x274 So I've looked at ag71xx_stop() in ar71xx, added the missing bits to ath79 and fixed this issue. 1. openwrt#1635 (comment) Signed-off-by: Petr Štetiar <ynezz@true.cz>
I've tested this PR on ubnt_wa devices and it seem to work just fine. No immediate issues and/or performance degradation. Good work! |
Just tested this. I can't seem to mount my f2fs drive. I get some OOM kernel panic. |
On ath79 and UBNT Bullet M XW (ar9342) I was experiencing weird issues during network setup[1] which I was able to reproduce easily with following commands: uci set network.lan.ipaddr='192.168.1.20' uci commit network ifup lan Which resulted after some time in: ... WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:461 dev_watchdog+0x16c/0x280 NETDEV WATCHDOG: eth0 (ag71xx): transmit queue 0 timed out ... Sometimes I wasn't able to use networking anymore, sometimes it was enough to just ifdown/ifup lan and network was backup. On ar71xx it was all working just fine. I've found out, that it was happening because ag71xx_poll() wasn't called, thus the TX queue wasn't emptied. The ag71xx_poll() is being called from napi hrtimer, which is enabled by napi_schedule() in ar71xx_interrupt(), but since no interrupts were ever fired again after ag71xx_stop() was called, it was always leading to tx queue timeouts: *** ag71xx_hard_start_xmit() eth0: packet injected into TX queue eth0: raw intr=00000001 TXPS POLL eth0: enable polling mode eth0: processing TX ring, flush=no eth0: disable polling mode, rx=1, tx=1,limit=32 ( `ifup lan done here` ) *** ag71xx_stop() *** ag71xx_open() *** ag71xx_hw_enable() IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready *** ag71xx_hard_start_xmit() eth0: packet injected into TX queue *** ag71xx_hard_start_xmit() eth0: packet injected into TX queue ... WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:320 dev_watchdog+0x164/0x274 So I've looked at ag71xx_stop() in ar71xx, added the missing bits to ath79 and fixed this issue. 1. openwrt/openwrt#1635 (comment) Signed-off-by: Petr Štetiar <ynezz@true.cz> [move ag->link before ag71xx_hw_disable to retain ordering as original] Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
On ath79 and UBNT Bullet M XW (ar9342) I was experiencing weird issues during network setup[1] which I was able to reproduce easily with following commands: uci set network.lan.ipaddr='192.168.1.20' uci commit network ifup lan Which resulted after some time in: ... WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:461 dev_watchdog+0x16c/0x280 NETDEV WATCHDOG: eth0 (ag71xx): transmit queue 0 timed out ... Sometimes I wasn't able to use networking anymore, sometimes it was enough to just ifdown/ifup lan and network was backup. On ar71xx it was all working just fine. I've found out, that it was happening because ag71xx_poll() wasn't called, thus the TX queue wasn't emptied. The ag71xx_poll() is being called from napi hrtimer, which is enabled by napi_schedule() in ar71xx_interrupt(), but since no interrupts were ever fired again after ag71xx_stop() was called, it was always leading to tx queue timeouts: *** ag71xx_hard_start_xmit() eth0: packet injected into TX queue eth0: raw intr=00000001 TXPS POLL eth0: enable polling mode eth0: processing TX ring, flush=no eth0: disable polling mode, rx=1, tx=1,limit=32 ( `ifup lan done here` ) *** ag71xx_stop() *** ag71xx_open() *** ag71xx_hw_enable() IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready *** ag71xx_hard_start_xmit() eth0: packet injected into TX queue *** ag71xx_hard_start_xmit() eth0: packet injected into TX queue ... WARNING: CPU: 0 PID: 0 at net/sched/sch_generic.c:320 dev_watchdog+0x164/0x274 So I've looked at ag71xx_stop() in ar71xx, added the missing bits to ath79 and fixed this issue. 1. openwrt/openwrt#1635 (comment) Signed-off-by: Petr Štetiar <ynezz@true.cz> [move ag->link before ag71xx_hw_disable to retain ordering as original] Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Note that my f2fs issues are unrelated to this pull request. This works fine. |
Does USB work in full speed? |
On my C7v2, I never saw the not running at full speed message. |
I've just merged this to my https://git.openwrt.org/?p=openwrt/staging/ynezz.git;a=shortlog;h=refs/heads/staging tree, will try to build and run test it again, then push to master once complete. Thanks! |
CONFIG_CC_HAS_STACKPROTECTOR_NONE=y | ||
CONFIG_CC_IS_GCC=y | ||
CONFIG_CEVT_R4K=y | ||
CONFIG_CLANG_VERSION=0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ynezz
Already defined in GENERIC config
CONFIG_ATH79_WDT=y | ||
CONFIG_CC_HAS_SANCOV_TRACE_PC=y | ||
CONFIG_CC_HAS_STACKPROTECTOR_NONE=y | ||
CONFIG_CC_IS_GCC=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ynezz
Already defined in GENERIC config
CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y | ||
CONFIG_ATH79=y | ||
CONFIG_ATH79_WDT=y | ||
CONFIG_CC_HAS_SANCOV_TRACE_PC=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ynezz
Already defined in GENERIC config
CONFIG_ATH79=y | ||
CONFIG_ATH79_WDT=y | ||
CONFIG_CC_HAS_SANCOV_TRACE_PC=y | ||
CONFIG_CC_HAS_STACKPROTECTOR_NONE=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ynezz
Already defined in GENERIC config
CONFIG_HAVE_ARCH_KGDB=y | ||
CONFIG_HAVE_ARCH_SECCOMP_FILTER=y | ||
CONFIG_HAVE_ARCH_TRACEHOOK=y | ||
CONFIG_HAVE_CBPF_JIT=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ynezz
Is this something we should globally enable? Inconsistenly in the tree
CONFIG_HAVE_FUNCTION_GRAPH_TRACER=y | ||
CONFIG_HAVE_FUNCTION_TRACER=y | ||
CONFIG_HAVE_GENERIC_DMA_COHERENT=y | ||
CONFIG_HAVE_IDE=y |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ynezz
Not needed on this platform?
# CONFIG_PHY_AR7200_USB is not set | ||
# CONFIG_PHY_ATH79_USB is not set | ||
CONFIG_PINCTRL=y | ||
CONFIG_PLUGIN_HOSTCC="" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ynezz
Already defined in GENERIC config
There are probably more duplicates which should be removed. |
I've just run diff --git a/target/linux/ath79/config-4.19 b/target/linux/ath79/config-4.19
index 6545476773..6cdbb968c3 100644
--- a/target/linux/ath79/config-4.19
+++ b/target/linux/ath79/config-4.19
@@ -20,11 +20,7 @@ CONFIG_ARCH_USE_QUEUED_SPINLOCKS=y
CONFIG_ARCH_WANT_IPC_PARSE_VERSION=y
CONFIG_ATH79=y
CONFIG_ATH79_WDT=y
-CONFIG_CC_HAS_SANCOV_TRACE_PC=y
-CONFIG_CC_HAS_STACKPROTECTOR_NONE=y
-CONFIG_CC_IS_GCC=y
CONFIG_CEVT_R4K=y
-CONFIG_CLANG_VERSION=0
CONFIG_CLKDEV_LOOKUP=y
CONFIG_CLONE_BACKWARDS=y
CONFIG_CMDLINE="rootfstype=squashfs,jffs2"
@@ -58,7 +54,6 @@ CONFIG_DTC=y
CONFIG_EARLY_PRINTK=y
CONFIG_ETHERNET_PACKET_MANGLE=y
CONFIG_FIXED_PHY=y
-CONFIG_GCC_VERSION=70400
CONFIG_GENERIC_ATOMIC64=y
CONFIG_GENERIC_CLOCKEVENTS=y
CONFIG_GENERIC_CMOS_UPDATE=y
@@ -123,7 +118,6 @@ CONFIG_HAVE_OPROFILE=y
CONFIG_HAVE_PERF_EVENTS=y
CONFIG_HAVE_REGS_AND_STACK_ACCESS_API=y
CONFIG_HAVE_RSEQ=y
-CONFIG_HAVE_STACKPROTECTOR=y
CONFIG_HAVE_SYSCALL_TRACEPOINTS=y
CONFIG_HAVE_VIRT_CPU_ACCOUNTING_GEN=y
CONFIG_HW_HAS_PCI=y
@@ -149,6 +143,7 @@ CONFIG_MIGRATION=y
CONFIG_MIPS=y
CONFIG_MIPS_ASID_BITS=8
CONFIG_MIPS_ASID_SHIFT=0
+CONFIG_MIPS_CBPF_JIT=y
CONFIG_MIPS_CLOCK_VSYSCALL=y
# CONFIG_MIPS_CMDLINE_BUILTIN_EXTEND is not set
# CONFIG_MIPS_CMDLINE_DTB_EXTEND is not set
@@ -197,7 +192,6 @@ CONFIG_PHYLIB=y
# CONFIG_PHY_AR7200_USB is not set
# CONFIG_PHY_ATH79_USB is not set
CONFIG_PINCTRL=y
-CONFIG_PLUGIN_HOSTCC=""
CONFIG_RATIONAL=y
CONFIG_REGMAP=y
CONFIG_REGMAP_MMIO=y |
That looks better, IDE can most likely be dropped since I can't find any supported devices that uses it. Should reduce the kernel size slightly. Not sure why KVM is enabled either? Not sure about the CBPF stuff however |
@dizzy I don't want to delay merging of this anymore. It works for quite a few of us, so it's good enough to start testing/fixing, and once it hits git repository, I'm sure, that it gets more attention as not everybody is following GitHub, but a lot of people seems to follow git repository very well, as I've noticed very fast feedback loop(that's very good IMHO) to some of my recent merged PRs.
I think, that you simply can't override HAVE_IDE and HAVE_KVM without patching the kernel anyway. |
I have tested this on my Archer C7v2. Everything works fine. The only issues that I see is lower iperf speed on ethernet. I believe this is related to the net struct rework that I tried to backport to 4.14 a while ago. Introduced in 4.17. The f2fs issue mentioned above is unrelated. f2fs is unstable on both big and little endian. I've abandoned it on everything I own (except phones, which is the only place that it gets tested). |
This PR adds linux 4.19 support for ath79.
tested on Winchannel WB2000 (AR9344+AR9382+AR8035).
modifications to ag71xx are tested on 4.14 with the same router.
edit: @mamarley has bumped 910-unaligned_access_hacks.patch and I've included his work here.
edit: I did some comparison between the two usb phy drivers and I'm not sure about what the missing phy_provider is for. Since the usb and phy subsystem is out of my knowledge, I'd like to keep using the version in 4.14 and leave the upstream one untouched.