4.16 kernel issues

Hi,

i’ve started work on kernel 4.16 and got some strange messages…maybe anybody can explain me why the happen:

main Problem is the kernel-oops near uart-access:

[    8.572162] [<c04672b0>] (serial8250_clear_fifos.part.1) from [<c04690c0>] (serial8250_do_startup+0x368/0x804)                                               
[    8.582099] [<c04690c0>] (serial8250_do_startup) from [<c0469588>] (serial8250_startup+0x2c/0x30)                                                            
[    8.590917] [<c0469588>] (serial8250_startup) from [<c0464364>] (uart_startup.part.4+0x70/0x138)                                                             
[ 8.599649] [<c0464364>] (uart_startup.part.4) from [<c0464ad4>] (uart_ioctl+0x644/0xb00)

but there are some message above try to read some dts-options. maybe there are fixes available…

why didn’t you try the tree, it is based on 4.16 rc5

i want to use a tree not based on a rc :slight_smile: so i changed existing branch to use the 4.16.1 and upgraded to 4.16.3, added config, build-script and swapped mmc (to make sure mmc0 is sd-card like in all r2-images)

If you want that, you can pop all patches Sean provides for 4.16 rc5 and push into 4.16.x stable tree.

i guess it should be smooth for bring up a new kernel.

do you know where 4.16-patches start? in the patches from https://patchwork.kernel.org/project/linux-mediatek/list/?submitter=169671 there is no hint if it is done for 4.15, 4.16 or 4.17

why not use

git log --oneline --grep=“mediatek.com” v4.17-rc1…v4.16-rc1

result tells me that

c9e97a1 mm: initialize pages on demand during boot
3a2d7fa mm: disable interrupts while initializing deferred pages
18bd594 net: dsa: mt7530: Use NULL instead of plain integer
648a957 media: vcodec: fix error return value from mtk_jpeg_clk_init()
3fc990a rtc: mt7622: fix module autoloading for OF platform drivers
097ccca mtd: nand: Fix some function description mismatches in core.c
c77a931 mtd: Fix some function description mismatches in mtdcore.c
de24047 ASoC: mediatek: remove "simple-mfd" in the example
04c0a4e pwm: mediatek: Improve precision in rate calculation
f361787 pwm: mediatek: Remove redundant MODULE_ALIAS entries
360cc03 pwm: mediatek: Fix up PWM4 and PWM5 malfunction on MT7623
e10734e dmaengine: mediatek: update MAINTAINERS entry with MediaTek DMA driver
548c459 dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC
33f32c0 dt-bindings: dmaengine: Add MediaTek High-Speed DMA controller bindings
3c82b372 net: dsa: mt7530: fix module autoloading for OF platform drivers
1c82c9e net: dsa: mt7530: remove redundant MODULE_ALIAS entries
e6c462d pinctrl: mtk: fix check warnings.
6af8df4c pintcrl: mtk: support bias-disable of generic and special pins simultaneously
8670710 pinctrl: add mt2712 pinctrl driver
29bca25 usb: skip phys initialization of shared hcd
70ca608 iommu/mediatek: Fix protect memory setting
b572f63 clk: mediatek: add audsys support for MT2701
037b211 clk: mediatek: add devm_of_platform_populate() for MT7622 audsys
f72595c clk: mediatek: update clock driver of MT2712
8465baa dt-bindings: clock: add clocks for MT2712
9cb1250 dt-bindings: clock: mediatek: add audsys support for MT2701
2817a92 dt-bindings: clock: mediatek: update audsys documentation to adapt MFD device
936ceb1 clk: mediatek: update missing clock data for MT7622 audsys
89cd7ae clk: mediatek: fix PWM clock source by adding a fixed-factor clock
55a5fca dt-bindings: clock: mediatek: add binding for fixed-factor clock axisel_d4
5f59955 arm64: dts: mt2712: Add auxadc device node.
c10a98c arm: dts: mt7623: add PCIe related nodes
9f99712 soc: mediatek: update power domain data of MT2712
1390515 dt-bindings: soc: update MT2712 power dt-bindings
58b3696 arm: dts: mt7623: use - instead of _ in DT node name
f59c89d arm: dts: mt7623: remove useless property pinctrl-names at node [email protected]
8e908df arm: dts: mt7623: add related clock properties to cpu[1-3] nodes
cc2f652 arm: dts: mt7623: enable three available UARTs on bananapi-r2
528a97e arm: dts: mt7623: fix the regulators mmc should use on bananapi-r2
2c97fa2 dt-bindings: clock: mediatek: add missing required #reset-cells
c55fbcb dt-bindings: phy-mtk-tphy: add properties for U2 slew rate calibrate
8833ebf4 phy: phy-mtk-tphy: add configurable parameters for slew rate calibrate
4036325 phy: phy-mtk-tphy: keep default value of mcu_bus_ck_gate_en
0629a01 arm: dts: mt7623: fix USB initialization fails on bananapi-r2
3f4a972 dt-bindings: arm: mediatek: add support for more mt7623 reference boards
73ce2ce soc: mediatek: fix the mistaken pointer accessed when subdomains are added
c932ba8 soc: mediatek: add SCPSYS power domain driver for MediaTek MT7623A SoC
c59c9c8 soc: mediatek: avoid hardcoded value with bus_prot_mask
0c1a2c1 dt-bindings: soc: add header files required for MT7623A SCPSYS dt-binding
b6853f8 dt-bindings: soc: add SCPSYS binding for MT7623 and MT7623A SoC
2c002a3 arm64: dts: mt7622: add mmc related device nodes
0f12d5b arm64: dts: mt7622: add usb device nodes
a39251ee arm64: dts: mt7622: add SATA device nodes
26907b5 arm64: dts: mt7622: add PCIe device nodes
5f599b3 arm64: dts: mt7622: add ethernet device nodes
23beb1a arm64: dts: mt7622: add flash related device nodes
ae457b7 arm64: dts: mt7622: add SoC and peripheral related device nodes
13f36c3 arm64: dts: mt7622: turn uart0 clock to real ones
a5a80f7 arm64: dts: mt7622: add cpufreq related device nodes
c4ff2ad arm64: dts: mt7622: add PMIC MT6380 related nodes
3725ba3 arm64: dts: mt7622: add pinctrl related device nodes
925bd27 arm64: dts: mt7622: add power domain controller device nodes
d716788 arm64: dts: mt7622: add clock controller device nodes
6ae9f50 usb: host: xhci-mtk: remove custom USB PHY handling
178a0bc usb: core: hcd: integrate the PHY wrapper into the HCD core
07dbff0 usb: core: add a wrapper for the USB PHYs on the HCD
81af63a drm: Don't pass clip to drm_atomic_helper_check_plane_state()
966580a mmc: mediatek: add support for MT7622 SoC
df1d7c8 mmc: dt-bindings: add support for MT7622 SoC
536836d dt-bindings: pinctrl: mediatek: add bindings for I2C2 and SPI2 on MT7623
fc47171 dt-bindings: pinctrl: mediatek: use - instead of _ in examples
af7b9b7 dt-bindings: PCI: MediaTek: fix dtc warnings
cb8bd2f cpufreq: mediatek: Convert pr_warn() to pr_debug()
af1da68 dma-debug: fix memory leak in debug_dma_alloc_coherent
f3e827d iommu/mediatek: Move attach_device after iommu-group is ready for M4Uv1
f1b5bf0 ASoC: mt2701/mt8173: replace platform to component
bd6120d drm/mediatek: Use drm_mode_get_hv_timing() to populate plane clip rectangle
1 Like

which git-repo do you use? i previously looked only on the patchwork-page and downloaded single patches

linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

ok, fixed up…4.16 is booting without panic/oops now. uart only had to be enabled (and moved for debug-output)

I’m also trying out the 4.16.7 kernel but I’m havin issues with the devices on the USB bus. I have the following error message in the dmesg

[    4.377387] xhci-mtk 1a1c0000.usb: fail to get sys_ck
[    4.382762] xhci-mtk 1a240000.usb: fail to get sys_ck
[    4.693757] xhci-mtk 1a1c0000.usb: fail to get sys_ck
[    4.700020] xhci-mtk 1a240000.usb: fail to get sys_ck
[    4.728951] xhci-mtk 1a1c0000.usb: fail to get sys_ck
[    4.740564] xhci-mtk 1a240000.usb: fail to get sys_ck
[    4.784266] xhci-mtk 1a1c0000.usb: fail to get sys_ck
[    4.791475] xhci-mtk 1a240000.usb: fail to get sys_ck
[   10.710643] xhci-mtk 1a1c0000.usb: fail to get sys_ck
[   10.711321] xhci-mtk 1a240000.usb: fail to get sys_ck
[   10.713828] xhci-mtk 1a1c0000.usb: fail to get sys_ck
[   10.714440] xhci-mtk 1a240000.usb: fail to get sys_ck
[   10.774766] xhci-mtk 1a1c0000.usb: fail to get sys_ck
[   10.775275] xhci-mtk 1a240000.usb: fail to get sys_ck

I noticed it because there the network devices (wan, lan) are not shown:

$ ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ether 7a:c1:92:fa:3d:78 brd ff:ff:ff:ff:ff:ff
3: [email protected]: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/ipip 0.0.0.0 brd 0.0.0.0
4: [email protected]: <NOARP> mtu 1480 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
5: [email protected]: <NOARP> mtu 1452 qdisc noop state DOWN mode DEFAULT group default qlen 1000
    link/tunnel6 :: brd ::

Any idea what the fail to get sys_ck error means?

Do you use my repo (4.16-main)?

I have no tested usb in 4.16 yet…ck sounds like clock,maybe something in dts(i) is wrong

Have you tried “ip a”? “ip link show” shows only interfaces which are configured an “up”

same output :confused:

$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 brd 127.255.255.255 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: bond0: <BROADCAST,MULTICAST,MASTER> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 7a:c1:92:fa:3d:78 brd ff:ff:ff:ff:ff:ff
3: [email protected]: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/ipip 0.0.0.0 brd 0.0.0.0
4: [email protected]: <NOARP> mtu 1480 qdisc noop state DOWN group default qlen 1000
    link/sit 0.0.0.0 brd 0.0.0.0
5: [email protected]: <NOARP> mtu 1452 qdisc noop state DOWN group default qlen 1000
    link/tunnel6 :: brd ::

As far as I know ip link shows all devices, no matter if they are up, down, connected or disconnected.

No, I tried the Vanilla Linux Kernel with the default config (mt7623n_evb_bpi_defconfig) from the BPI-R2-bsp archive). I now used your repository and the origin/4.16-main branch and it is working.

In the kernel configuration I used the clocks for mmsys, imgsys, vdecsys, hifsys, ethsys and bdpsys are not selected. I added those, recompiled and hooray, it’s working now :tada:

$ grep COMMON_CLK_MT270 linux-stable/.config                                                                                                                                                                                           
CONFIG_COMMON_CLK_MT2701=y
CONFIG_COMMON_CLK_MT2701_MMSYS=y
CONFIG_COMMON_CLK_MT2701_IMGSYS=y
CONFIG_COMMON_CLK_MT2701_VDECSYS=y
CONFIG_COMMON_CLK_MT2701_HIFSYS=y
CONFIG_COMMON_CLK_MT2701_ETHSYS=y
CONFIG_COMMON_CLK_MT2701_BDPSYS=y

[    4.331736] SCSI Media Changer driver v0.25
[    4.337245] Ethernet Channel Bonding Driver: v3.7.1 (April 27, 2011)
[    4.345241] libphy: Fixed MDIO Bus: probed
[    4.372173] mtk_soc_eth 1b100000.ethernet: chip id = 7623
[    4.377746] libphy: mdio: probed
[    4.381069] mtk_soc_eth 1b100000.ethernet: generated random MAC address 56:ed:43:59:fe:6e
[    4.389768] mtk_soc_eth 1b100000.ethernet: connected mac 0 to PHY at fixed-0:00 [uid=00000000, driver=Generic PHY]
[    4.400465] mtk_soc_eth 1b100000.ethernet eth0: mediatek frame engine at 0xf0de0000, irq 205

Thank you for the help!

Oh and why is the mt7623n_evb_fwu_defconfig not in the mainlaine linux kernel?

Normally, we use multi_v7_defconfig in the mainline for minimum feature support.

There is the same issue as I described above with the multi_v7_defconfig: the clock driver for mmsys, imgsys, vdecsys, hifsys, ethsys and bpdsys are not enabled by default in kernel v4.16.8.

  [*] Clock driver for MediaTek MT2701
  [ ]   Clock driver for MediaTek MT2701 mmsys
  [ ]   Clock driver for MediaTek MT2701 imgsys
  [ ]   Clock driver for MediaTek MT2701 vdecsys
  [ ]   Clock driver for MediaTek MT2701 hifsys
  [ ]   Clock driver for MediaTek MT2701 ethsys
  [ ]   Clock driver for MediaTek MT2701 bdpsys

“Minimum feature support” - that is, you should enable additional config if you’d like.