Skip to content
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

ipq806x: adds kernel 4.19 support #2472

Closed
wants to merge 24 commits into from
Closed

Conversation

Ansuel
Copy link
Member

@Ansuel Ansuel commented Oct 6, 2019

99% of the work to port the patch to 4.19 is from @chunkeey
I'm proposing this as from the testing of me and some other 4.19 doesn't look to cause any regression but instead fix cpuidle.

We have long tested this with a r7800 (me) and r7500
Think we should at least push a initial patchset for testing so that we can test this with more userbase.

Some changes are done to usb.mk to reflect use of new qcom dwc3 driver instead of the generic one.
This is the only way i found to use both the driver in the ipq806x Makefile.

Based on https://git.openwrt.org/?p=openwrt/staging/chunkeey.git;a=commit;h=c096b58311b52068cfa90d437d1bcfaf7fcd0d2e

Fixed broken tsens driver
Fixed bootloop on ipq8065 soc with CPU_IDLE enabled

Signed-off-by: Ansuel Smith ansuelsmth@gmail.com

@Ansuel
Copy link
Member Author

Ansuel commented Oct 8, 2019

@pkgadd if you have other comment just tell me

@ynezz ynezz added the target/ipq806x pull request/issue for ipq806x target label Oct 9, 2019
@facboy
Copy link

facboy commented Oct 10, 2019

does this just copy over the clk patchset from 4.14 (0049-0056)? because it doesn't work that well there, and it appears to not work properly here either :(.

@pkgadd
Copy link
Contributor

pkgadd commented Oct 11, 2019

I've been running this revised pull request on my ZyXEL NBG6817/ IPQ8065 for the last two days (kernel 4.19.78) - it seems to be fine (including USB, but I haven't checked this in detail). Thanks a lot for pushing this forward.

@Ansuel
Copy link
Member Author

Ansuel commented Oct 11, 2019

@facboy saddly yes... as long as it doesn't cause problem we need to keep it this way waiting you for a port :D

@pkgadd we need more test...

@facboy
Copy link

facboy commented Oct 11, 2019

actually bandwidth is lower on this kernel, noticeably so on the mbw test. in the DUMB test it can drop down to 35Mb/s, down from 170-180Mb/s. the other 2 tests are about the same as master 4.14, so no real concern there. i am going to see if porting the patches from linux-next plus the one left over one makes it all magically work.

@Ansuel
Copy link
Member Author

Ansuel commented Oct 11, 2019

i'm here to test what you want @facboy

@facboy
Copy link

facboy commented Oct 11, 2019

after further wandering around linux-next, it looks way too complicated to me and the last patch that actually adds support for krait is AWOL and will not apply cleanly to linux-next either. i'm also not convinced it will do anything for the L2 cache anyway. i think i will try to apply my patch on top of this (leaving the existing patches this time) and see where that gets us.

btw I think those old operating-points-v2 (which you've removed) were for ipq4019 (at 716Mhz) and definitely wrong for ipq806x.

@Ansuel
Copy link
Member Author

Ansuel commented Oct 11, 2019

some guy on the forum was working on them so i think you should ask to him

@Gram1k
Copy link

Gram1k commented Oct 12, 2019

Just applied this PR on R7800 and my unscientific testing with Speedtest® shows consistent 100Mbps increase in both DL/UL from 750Mbps/750Mbps to 850Mbps/850Mbps. Got 1Gbps DL/UL line from ISP.

Appreciate the speed increase. Otherwise looks ok so far.

@Ansuel
Copy link
Member Author

Ansuel commented Oct 25, 2019

Any news on this ? On forum we have plenty of positive feedback from 4 different type of router

@Gram1k
Copy link

Gram1k commented Oct 26, 2019

For my pretty standard use case it's been working very well ever since installation and the logs are clean.

root@R7800:/# uname -a && uptime
Linux R7800 4.19.78 #0 SMP Fri Oct 11 08:37:08 2019 armv7l GNU/Linux
12:29:49 up 13 days, 14:23, load average: 0.01, 0.07, 0.07

@huaracheguarache
Copy link
Contributor

I have been running this with the latest master commits applied on top for the past day or so without any issues. USB works as well, but I have not really tested in detail. @Ansuel here is the bootlog if you want to take a look: https://gist.github.com/huaracheguarache/d4e90df68fb00f95ff99b645d4486609

@ddimension
Copy link

I also did several tests on the 4.19 ipq806x (NBG6817). I noticed that VPN throuput (IPsec Performance) dropped to 30% with exactly the same config (kernel and openwrt), kernel crypto and arm crypto stuff tested (enabled in kconfig).
Also the whole system feels a bit slowier (execution time of binaries). Timers (clock, ddr) in dts have been compared, also checked in the running system. I'm a fan of 419, but this needs be solved before and I have no clue where to look. Any ideas?

@Ansuel
Copy link
Member Author

Ansuel commented Nov 1, 2019 via email

@ddimension
Copy link

Could you give me a hint where to start searching? I have access to multiple NBG6817.
Nevertheless thank you for this patch!

I think the slow down I related to cpu and cache problems and not on the kernel Il Ven 1 Nov 2019, 10:24 ddimension notifications@github.com ha scritto:

I also did several tests on the 4.19 ipq806x (NBG6817). I noticed that VPN throuput (IPsec Performance) dropped to 30% with exactly the same config (kernel and openwrt), kernel crypto and arm crypto stuff tested (enabled in kconfig). Also the whole system feels a bit slowier (execution time of binaries). Timers (clock, ddr) in dts have been compared, also checked in the running system. I'm a fan of 419, but this needs be solved before and I have no clue where to look. Any ideas? — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#2472?email_source=notifications&email_token=AE2ZMQU2I22G6SZ3AF3VU4TQRPYTLA5CNFSM4I56ADB2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC2NHHQ#issuecomment-548721566>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE2ZMQUWHYC6CJFHX66BDG3QRPYTLANCNFSM4I56ADBQ .

@Ansuel
Copy link
Member Author

Ansuel commented Nov 1, 2019

@facboy s trying to port cache fix to kernel 4.19

@wulfy23
Copy link
Contributor

wulfy23 commented Nov 1, 2019

`
[ 219.417917] ======================================================
[ 219.418447] WARNING: possible circular locking dependency detected
[ 219.424443] 4.19.76 #0 Not tainted
[ 219.430597] ------------------------------------------------------
[ 219.433988] sh/8309 is trying to acquire lock:
[ 219.440152] 0a53be28 (pernet_ops_rwsem){+.+.}, at: register_netdevice_notifier+0x28/0x1e0

[ 220.049966] Possible unsafe locking scenario:
[ 220.049966]
[ 220.061764] CPU0 CPU1
[ 220.067663] ---- ----
[ 220.072176] CPU0 lock(&led_cdev->trigger_lock);
[ 220.076692] CPU1 lock(triggers_list_lock);
[ 220.081207] CPU1 lock(&led_cdev->trigger_lock);
[ 220.087545] CPU0 lock(pernet_ops_rwsem);
[ 220.094224]
[ 220.094224] *** DEADLOCK ***`

@Ansuel
Copy link
Member Author

Ansuel commented Nov 1, 2019

@wulfy23 are you sure this is related to this target?

@wulfy23
Copy link
Contributor

wulfy23 commented Nov 3, 2019

Yes. Likely not directly related to your patchset.
Like a belly button, better in than out... ( no offense anyone )

@aon3ko
Copy link

aon3ko commented Nov 15, 2019

[35751.683501] ------------[ cut here ]------------
[35751.683657] WARNING: CPU: 0 PID: 0 at target-arm_cortex-a15+neon-vfpv4_musl_eabi/linux-ipq806x_generic/ath10k-ct-2019-11-07-080cd781/ath10k-5.4/txrx.c:120 ath10k_txrx_tx_unref+0x494/0x68c [ath10k_core]
[35751.687324] Invalid VHT rate, nss: 3  hw_rate: 15 ratecode: 255
[35751.705079] Modules linked in: pppoe ppp_async iptable_nat ipt_MASQUERADE ath10k_pci ath10k_core ath xt_state xt_nat xt_conntrack xt_REDIRECT xt_FLOWOFFLOAD xt_CT rndis_host qmi_wwan pppox ppp_generic nf_nat_ipv4 nf_nat nf_flow_table_hw nf_flow_table nf_conntrack_rtcache nf_conntrack mac80211 ipt_REJECT cfg80211 cdc_ether xt_time xt_tcpudp xt_socket xt_multiport xt_mark xt_mac xt_limit xt_comment xt_TPROXY xt_TCPMSS xt_LOG wireguard usbnet slhc nf_tproxy_ipv6 nf_tproxy_ipv4 nf_socket_ipv6 nf_socket_ipv4 nf_reject_ipv4 nf_log_ipv4 nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_filter ip_tables crc_ccitt compat cdc_wdm tcp_bbr xt_set ip_set_list_set ip_set_hash_netportnet ip_set_hash_netport ip_set_hash_netnet ip_set_hash_netiface ip_set_hash_net ip_set_hash_mac ip_set_hash_ipportnet ip_set_hash_ipportip
[35751.760170]  ip_set_hash_ipport ip_set_hash_ipmark ip_set_hash_ip ip_set_bitmap_port ip_set_bitmap_ipmac ip_set_bitmap_ip ip_set nfnetlink nf_log_ipv6 nf_log_common ip6table_mangle ip6table_filter ip6_tables ip6t_REJECT x_tables nf_reject_ipv6 msdos ip6_udp_tunnel udp_tunnel vfat fat cifs nls_utf8 nls_iso8859_1 nls_cp437 sha512_generic seqiv md5 md4 ecb des_generic ctr cmac ccm arc4 leds_gpio dwc3 dwc3_qcom ahci sd_mod ahci_platform libahci_platform libahci libata scsi_mod gpio_button_hotplug f2fs ext4 mbcache jbd2 exfat crc32c_generic crc32_generic
[35751.808743] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.19.82 #0
[35751.830855] Hardware name: Generic DT based system
[35751.837129] [<c030f0f4>] (unwind_backtrace) from [<c030b590>] (show_stack+0x14/0x20)
[35751.841727] [<c030b590>] (show_stack) from [<c082d660>] (dump_stack+0x84/0x98)
[35751.849630] [<c082d660>] (dump_stack) from [<c031d860>] (__warn+0xd4/0xf0)
[35751.856651] [<c031d860>] (__warn) from [<c031d4f4>] (warn_slowpath_fmt+0x34/0x4c)
[35751.863576] [<c031d4f4>] (warn_slowpath_fmt) from [<bf6c35d0>] (ath10k_txrx_tx_unref+0x494/0x68c [ath10k_core])
[35751.871247] [<bf6c35d0>] (ath10k_txrx_tx_unref [ath10k_core]) from [<bf6bca34>] (ath10k_htt_t2h_msg_handler+0x670/0x10f8 [ath10k_core])
[35751.881039] [<bf6bca34>] (ath10k_htt_t2h_msg_handler [ath10k_core]) from [<bf7182a0>] (ath10k_pci_htt_rx_cb+0x1d0/0x230 [ath10k_pci])
[35751.893212] [<bf7182a0>] (ath10k_pci_htt_rx_cb [ath10k_pci]) from [<bf6dde20>] (ath10k_ce_per_engine_service+0xa0/0x114 [ath10k_core])
[35751.905388] [<bf6dde20>] (ath10k_ce_per_engine_service [ath10k_core]) from [<bf6ddf0c>] (ath10k_ce_per_engine_service_any+0x78/0xb4 [ath10k_core])
[35751.917320] [<bf6ddf0c>] (ath10k_ce_per_engine_service_any [ath10k_core]) from [<bf71a93c>] (ath10k_pci_napi_poll+0x80/0x134 [ath10k_pci])
[35751.930376] [<bf71a93c>] (ath10k_pci_napi_poll [ath10k_pci]) from [<c06ff85c>] (net_rx_action+0x144/0x31c)
[35751.942769] [<c06ff85c>] (net_rx_action) from [<c03021b0>] (__do_softirq+0xc8/0x248)
[35751.952400] [<c03021b0>] (__do_softirq) from [<c0321ab8>] (irq_exit+0xa0/0x108)
[35751.960304] [<c0321ab8>] (irq_exit) from [<c03642b8>] (__handle_domain_irq+0xa8/0xc8)
[35751.967331] [<c03642b8>] (__handle_domain_irq) from [<c056f0f8>] (gic_handle_irq+0x6c/0xb8)
[35751.975314] [<c056f0f8>] (gic_handle_irq) from [<c0301a0c>] (__irq_svc+0x6c/0x90)
[35751.983464] Exception stack(0xc0b01f08 to 0xc0b01f50)
[35751.991121] 1f00:                   00000000 00002084 1cf55000 dd992940 c0b00000 c0b04c6c
[35751.996165] 1f20: 00002084 00002084 00000000 dd7daa00 162df720 166464e0 f9d33120 c0b01f58
[35752.004311] 1f40: c06a5e24 c06a5c98 20000013 ffffffff
[35752.012476] [<c0301a0c>] (__irq_svc) from [<c06a5c98>] (cpuidle_enter_state+0x17c/0x334)
[35752.017516] [<c06a5c98>] (cpuidle_enter_state) from [<c0347564>] (do_idle+0x190/0x220)
[35752.025664] [<c0347564>] (do_idle) from [<c0347868>] (cpu_startup_entry+0x1c/0x20)
[35752.033391] [<c0347868>] (cpu_startup_entry) from [<c0a00d90>] (start_kernel+0x480/0x490)
[35752.041076] ---[ end trace aef359e8427a8b9c ]---

just provide some information, maybe its just ath10k-ct problem. @hauke

@ynezz
Copy link
Member

ynezz commented Nov 28, 2019

@chunkeey What about this? :-) I can help merging it in the current state if you don't have time for this currently and it can be polished later (if needed at all), right?

@ynezz
Copy link
Member

ynezz commented Nov 28, 2019

What is needed from my point of view in order to merge it if @chunkeey is not planning to do it himself:

  • split that one big commit into few smaller ones
    • one for copy of the files from the 4.14 to 4.19
    • second for updating the kernel config
    • third for refreshing the patches
    • any other commit(s) for added file(s) (if needed at all)
  • proper authorship/credits
    • add @chunkeey From: and Signed-off-by: to every commit
    • keep your Signed-off-by: as well

Ansuel and others added 16 commits December 16, 2019 20:29
Set qcom,apq8064-saw2-v1.1-cpu as regulator to make cpuidle work.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Spc is disabled in ipq8065 board as it does cause cpu lockup
(probably caused by wrong register being set)

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Adds missing gpio and gsbi declaration.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Increase drive-strength from
https://lore.kernel.org/patchwork/patch/626885/

2mA drive strength is not enough when we connect multiple i2c devices
on the bus with different pull up resistors.

This issue was detected when multiple i2c devices
connected on the other side of level shifters on Linaro sensor board.
Maxing up to 16mA made i2c much stable.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Add some tags for nand and sata structure to easily
reference them in other dts.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Add missing watchdog to list of compatible timers

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Add missing wifi compatible definition for r7800 device.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
There is warning with "property has invalid length (4 bytes)"
related to nand definition. Set size-cells to zero to fix this.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Reorganize dts to use tags from ipq8064 dtsi

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
From documentation
https://www.kernel.org/doc/Documentation/devicetree/bindings/chosen.txt
should be just stdout-path

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Improve rediability of gpio mdio list. No functional change.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Added patch:

 - 063-3 Fix tsense shared memory problem

Recent changes in ioremap_resource function are causing fails for the
memory areas which are already mapped. This changes are causing tsense
driver failures during initialization:

  qcom-tsens 900000.thermal-sensor: tsens init failed

So this patch uses simple ioremap in order to use this shared memory
space.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[commit subject and desciption facelitf]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
- usb-dwc3-of-simple is not used anymore as we have qcom dedicated driver
- usb-phy-qcom-dwc3 is not dependent of dwc3-of-simple

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Voltage tolerance is accounted per core, not per cpu, so add
missing DT entry.

Signed-off-by: Pavel Kubelun <be.dissent@gmail.com>
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
- Use new dwc3-qcom usb driver.
- Drop dwc3-of-simple as we have a dedicated driver now.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[split into separate commit, commit subject facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
It has been used by several people for some time already and feedback
has been mostly positive.

Ref: openwrt#2472
Tested-by: Hannu Nyman <hannu.nyman@iki.fi> [ipq8065, R7800]
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [ipq8065, NBG6817]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[separate commit, commit subject and description facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
@Ansuel Ansuel force-pushed the ipq4.19 branch 3 times, most recently from 719a576 to 467e3be Compare December 16, 2019 19:35
@ynezz
Copy link
Member

ynezz commented Dec 19, 2019

Thanks! Pulled into my staging tree at https://git.openwrt.org/openwrt/staging/ynezz.git

@ynezz ynezz closed this Dec 19, 2019
@ynezz
Copy link
Member

ynezz commented Dec 19, 2019

Any news about this?

@Ansuel Thank you for your work and patience! :-)

@Ansuel
Copy link
Member Author

Ansuel commented Dec 19, 2019 via email

jow- pushed a commit that referenced this pull request Dec 19, 2019
It has been used by several people for some time already and feedback
has been mostly positive.

Ref: #2472
Tested-by: Hannu Nyman <hannu.nyman@iki.fi> [ipq8065, R7800]
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [ipq8065, NBG6817]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[separate commit, commit subject and description facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
jollaman999 pushed a commit to jollaman999/openwrt that referenced this pull request Dec 28, 2019
It has been used by several people for some time already and feedback
has been mostly positive.

Ref: openwrt/openwrt#2472
Tested-by: Hannu Nyman <hannu.nyman@iki.fi> [ipq8065, R7800]
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de> [ipq8065, NBG6817]
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
[separate commit, commit subject and description facelift]
Signed-off-by: Petr Štetiar <ynezz@true.cz>
@Ansuel Ansuel deleted the ipq4.19 branch April 15, 2020 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
target/ipq806x pull request/issue for ipq806x target
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet