Re: Failed boot at drm_vblank in arm64/aarch64 on PBP

From: Jesper Schmitz Mouridsen <jsm_at_FreeBSD.org>
Date: Tue, 25 Jan 2022 18:45:05 UTC

On 25.01.2022 03.15, KIRIYAMA Kazuhiko wrote:
> Hi, all
> 
> I've re-made boot image for Pinebook Pro (PBP) of
> 14.0-CURRENT n252589-ece746877783 which is made by
> GENERIC-DRM kernel for Panfrost driver [1] :
> 
> First `git subtree add' to 14.0-CURRENT (f72926eab00c) in src server :
> 
> root@vm:/ds/src/freebsd/current/14.0/f72926eab00c.generic_drm # git checkout f72926eab00c
> root@vm:/ds/src/freebsd/current/14.0/f72926eab00c.generic_drm # git remote add drm-subtree https://github.com/jsm222/drm-subtree.git
> root@vm:/ds/src/freebsd/current/14.0/f72926eab00c.generic_drm # git subtree add --prefix sys/dev/drm/ drm-subtree pinebookpro-test
> root@vm:/ds/src/freebsd/current/14.0/f72926eab00c.generic_drm # git apply sys/dev/drm/extra_patches/0001-Hook-DRM-to-the-build.patch
> root@vm:/ds/src/freebsd/current/14.0/f72926eab00c.generic_drm # git apply sys/dev/drm/extra_patches/0002-Add-GENERIC-DRM-for-armv7.patch
> root@vm:/ds/src/freebsd/current/14.0/f72926eab00c.generic_drm # git apply sys/dev/drm/extra_patches/0003-drm-Add-rockchip-and-bridges-into-GENERIC-DRM.patch
> root@vm:/ds/src/freebsd/current/14.0/f72926eab00c.generic_drm # git apply sys/dev/drm/pbp-kernel-extra-patches/gicv3_its.c-patch
> root@vm:/ds/src/freebsd/current/14.0/f72926eab00c.generic_drm # git apply sys/dev/drm/pbp-kernel-extra-patches/mixer.c.patch
> root@vm:/ds/src/freebsd/current/14.0/f72926eab00c.generic_drm # git apply sys/dev/drm/pbp-kernel-extra-patches/sys_dev_iicbus_es8316.c
> root@vm:/ds/src/freebsd/current/14.0/f72926eab00c.generic_drm # git apply sys/dev/drm/pbp-kernel-extra-patches/GENERIC-DRM.patch
> root@vm:/ds/src/freebsd/current/14.0/f72926eab00c.generic_drm # git apply sys/dev/drm/pbp-kernel-extra-patches/sys_modules_dtb_rockchip_Makefile.patch
> root@vm:/ds/src/freebsd/current/14.0/f72926eab00c.generic_drm # git apply sys/dev/drm/pbp-kernel-extra-patches/mmc.c.patch
> root@vm:/ds/src/freebsd/current/14.0/f72926eab00c.generic_drm # git rev-parse --verify --short HEAD
> ece746877783
> root@vm:/ds/src/freebsd/current/14.0/f72926eab00c.generic_drm # cd ..
> root@vm:/ds/src/freebsd/current/14.0 # mv f72926eab00c.generic_drm ece746877783.generic_drm
> 
> and then build GENERIC-DRM kernel and boot image on
> 14.0-CURRENT VM :
>   
> # cd /usr/src
> # make buildworld TARGET=arm64
> # make buildkernel TARGET=arm64 KERNCONF=GENERIC-DRM
> # cd /usr/src/release
> # make clean memstick.img TARGET=arm64 TARGET_ARCH=aarch64 KERNCONF=GENERIC-DRM
> 
> Then boot from it. Failed :
> 
> ---<<BOOT>>---
> GDB: debug ports: uart
> GDB: current port: uart
> KDB: debugger backends: ddb gdb
> KDB: current backend: ddb
> WARNING: Cannot find freebsd,dts-version property, cannot check DTB compliance
> Copyright (c) 1992-2022 The FreeBSD Project.
> Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
>          The Regents of the University of California. All rights reserved.
> FreeBSD is a registered trademark of The FreeBSD Foundation.
> FreeBSD 14.0-CURRENT #0 n252589-ece746877783-dirty: Tue Jan 25 03:42:31 JST 2022
>      root@tbedfc:/usr/obj/usr/src/arm64.aarch64/sys/GENERIC-DRM arm64
> FreeBSD clang version 13.0.0 (git@github.com:llvm/llvm-project.git llvmorg-13.0.0-0-gd7b669b3a303)
> VT(efifb): resolution 1920x1080
> module firmware already present!
> real memory  = 4150083584 (3957 MB)
> avail memory = 4022452224 (3836 MB)
> Starting CPU 1 (1)
> Starting CPU 2 (2)
> Starting CPU 3 (3)
> Starting CPU 4 (100)
> Starting CPU 5 (101)
> FreeBSD/SMP: Multiprocessor System Detected: 6 CPUs
> arc4random: WARNING: initial seeding bypassed the cryptographic random device because it was not yet seeded and the knob 'bypass_before_seeding' was enabled.
> random: entropy device external interface
> MAP f3f10000 mode 2 pages 4
> MAP f3f15000 mode 2 pages 4
> MAP f6f30000 mode 2 pages 16
> kbd0 at kbdmux0
> ofwbus0: <Open Firmware Device Tree>
> clk_fixed0: <Fixed clock> on ofwbus0
> simplebus0: <Flattened device tree simple bus> on ofwbus0
> rk_grf0: <RockChip General Register Files> mem 0xff320000-0xff320fff on ofwbus0
> rk3399_pmucru0: <Rockchip RK3399 PMU Clock and Reset Unit> mem 0xff750000-0xff750fff on ofwbus0
> rk3399_cru0: <Rockchip RK3399 Clock and Reset Unit> mem 0xff760000-0xff760fff on ofwbus0
> rk_grf1: <RockChip General Register Files> mem 0xff770000-0xff77ffff on ofwbus0
> regfix0: <Fixed Regulator> on ofwbus0
> regfix1: <Fixed Regulator> on ofwbus0
> regfix2: <Fixed Regulator> on ofwbus0
> regfix3: <Fixed Regulator> on ofwbus0
> regfix4: <Fixed Regulator> on ofwbus0
> regfix5: <Fixed Regulator> on ofwbus0
> regfix6: <Fixed Regulator> on ofwbus0
> regfix7: <Fixed Regulator> on ofwbus0
> regfix8: <Fixed Regulator> on ofwbus0
> regfix9: <Fixed Regulator> on ofwbus0
> regfix10: <Fixed Regulator> on ofwbus0
> regfix11: <Fixed Regulator> on ofwbus0
> simple_mfd0: <Simple MFD (Multi-Functions Device)> mem 0xff310000-0xff310fff on ofwbus0
> psci0: <ARM Power State Co-ordination Interface Driver> on ofwbus0
> rk_drm0: <Rockchip Display Subsystem> on ofwbus0
> gic0: <ARM Generic Interrupt Controller v3.0> mem 0xfee00000-0xfee0ffff,0xfef00000-0xfefbffff,0xfff00000-0xfff0ffff,0xfff10000-0xfff1ffff,0xfff20000-0xfff2ffff irq 18 on ofwbus0
> its0: <ARM GIC Interrupt Translation Service> mem 0xfee20000-0xfee3ffff on gic0
> rk_iodomain0: <RockChip IO Voltage Domain> mem 0-0xff31ffff,0-0xfff on rk_grf0
> rk_iodomain1: <RockChip IO Voltage Domain> mem 0-0xff76ffff,0-0xffff on rk_grf1
> rk_pinctrl0: <RockChip Pinctrl controller> on ofwbus0
> gpio0: <RockChip GPIO Bank controller> mem 0xff720000-0xff7200ff irq 71 on rk_pinctrl0
> gpiobus0: <OFW GPIO bus> on gpio0
> gpio1: <RockChip GPIO Bank controller> mem 0xff730000-0xff7300ff irq 72 on rk_pinctrl0
> gpiobus1: <OFW GPIO bus> on gpio1
> gpio2: <RockChip GPIO Bank controller> mem 0xff780000-0xff7800ff irq 73 on rk_pinctrl0
> gpiobus2: <OFW GPIO bus> on gpio2
> gpio3: <RockChip GPIO Bank controller> mem 0xff788000-0xff7880ff irq 74 on rk_pinctrl0
> gpiobus3: <OFW GPIO bus> on gpio3
> gpio4: <RockChip GPIO Bank controller> mem 0xff790000-0xff7900ff irq 75 on rk_pinctrl0
> gpiobus4: <OFW GPIO bus> on gpio4
> rk_i2c0: <RockChip I2C> mem 0xff110000-0xff110fff irq 20 on ofwbus0
> iicbus0: <OFW I2C bus> on rk_i2c0
> rk_i2c1: <RockChip I2C> mem 0xff130000-0xff130fff irq 22 on ofwbus0
> iicbus1: <OFW I2C bus> on rk_i2c1
> rk_i2c2: <RockChip I2C> mem 0xff3c0000-0xff3c0fff irq 38 on ofwbus0
> iicbus2: <OFW I2C bus> on rk_i2c2
> fan53555_pmic0: <SYR827 PMIC> at addr 0x80 on iicbus2
> fan53555_pmic1: <SYR828 PMIC> at addr 0x82 on iicbus2
> rk_i2c3: <RockChip I2C> mem 0xff3d0000-0xff3d0fff irq 39 on ofwbus0
> iicbus3: <OFW I2C bus> on rk_i2c3
> rk808_pmu0: <RockChip RK808 PMIC> at addr 0x36 irq 76 on iicbus2
> rk_vop0: <Rockchip RK3399 Visual Output Processor> mem 0xff8f0000-0xff8f3efb irq 53 on ofwbus0
> rk_vop0: VOP version: 3068896
> generic_timer0: <ARMv8 Generic Timer> irq 2,3,4,5 on ofwbus0
> Timecounter "ARM MPCore Timecounter" frequency 24000000 Hz quality 1000
> Event timer "ARM MPCore Eventtimer" frequency 24000000 Hz quality 1000
> rk_tsadc0: <RockChip temperature sensors> mem 0xff260000-0xff2600ff irq 35 on ofwbus0
> mmc_pwrseq0: <MMC Simple Power sequence> on ofwbus0
> rk_edp0: <RockChip edp> mem 0xff970000-0xff977fff irq 62 on ofwbus0
> rk_usb2phy0: <Rockchip RK3399 USB2PHY> mem 0-0xff76ffff,0-0xffff on rk_grf1
> rk_usb2phy1: <Rockchip RK3399 USB2PHY> mem 0-0xff76ffff,0-0xffff on rk_grf1
> rk_emmcphy0: <Rockchip RK3399 eMMC PHY> mem 0-0xff76ffff,0-0xffff on rk_grf1
> rk_pcie_phy0: <Rockchip RK3399 PCIe PHY> mem 0-0xff76ffff,0-0xffff on rk_grf1
> rk_typec_phy0: <Rockchip RK3399 PHY TYPEC> mem 0xff7c0000-0xff7fffff on ofwbus0
> rk_typec_phy1: <Rockchip RK3399 PHY TYPEC> mem 0xff800000-0xff83ffff on ofwbus0
> cpulist0: <Open Firmware CPU Group> on ofwbus0
> cpu0: <Open Firmware CPU> on cpulist0
> cpufreq_dt0: <Generic cpufreq driver> on cpu0
> cpufreq_dt0: Found cpu-supply
> cpu1: <Open Firmware CPU> on cpulist0
> cpufreq_dt1: <Generic cpufreq driver> on cpu1
> cpufreq_dt1: Found cpu-supply
> cpu2: <Open Firmware CPU> on cpulist0
> cpufreq_dt2: <Generic cpufreq driver> on cpu2
> cpufreq_dt2: Found cpu-supply
> cpu3: <Open Firmware CPU> on cpulist0
> cpufreq_dt3: <Generic cpufreq driver> on cpu3
> cpufreq_dt3: Found cpu-supply
> cpu4: <Open Firmware CPU> on cpulist0
> cpufreq_dt4: <Generic cpufreq driver> on cpu4
> cpufreq_dt4: Found cpu-supply
> cpu5: <Open Firmware CPU> on cpulist0
> cpufreq_dt5: <Generic cpufreq driver> on cpu5
> cpufreq_dt5: Found cpu-supply
> pmu0: <Performance Monitoring Unit> irq 0 on ofwbus0
> pmu1: <Performance Monitoring Unit> irq 1 on ofwbus0
> pcib0: <Rockchip PCIe controller> mem 0xf8000000-0xf9ffffff,0xfd000000-0xfdffffff irq 6,7,8 on ofwbus0
> pcib0: Gen1 link training timeouted: 0x00080001.
> pci0: <OFW PCI bus> on pcib0
> pcib1: <PCI-PCI bridge> at device 0.0 on pci0
> pcib0: failed to reserve resource for pcib1
> pcib1: failed to allocate initial memory window: 0-0xfffff
> pci1: <PCI bus> on pcib1
> rockchip_dwmmc0: <Synopsys DesignWare Mobile Storage Host Controller (RockChip)> mem 0xfe310000-0xfe313fff irq 10 on ofwbus0
> rockchip_dwmmc0: Hardware version ID is 270a
> rockchip_dwmmc1: <Synopsys DesignWare Mobile Storage Host Controller (RockChip)> mem 0xfe320000-0xfe323fff irq 11 on ofwbus0
> rockchip_dwmmc1: Hardware version ID is 270a
> mmc0: <MMC/SD bus> on rockchip_dwmmc1
> sdhci_fdt0: <Rockchip RK3399 fdt SDHCI controller> mem 0xfe330000-0xfe33ffff irq 12 on ofwbus0
> rk_emmcphy0: got emmcclk clock
> sdhci_fdt0-slot0: Hardware doesn't specify timeout clock frequency, setting BROKEN_TIMEOUT quirk.
> sdhci_fdt0: 1 slot(s) allocated
> mmc1: <MMC/SD bus> on sdhci_fdt0
> ehci0: <Generic EHCI Controller> mem 0xfe380000-0xfe39ffff irq 13 on ofwbus0
> usbus0: EHCI version 1.0
> usbus0 on ehci0
> ohci0: <Generic OHCI Controller> mem 0xfe3a0000-0xfe3bffff irq 14 on ofwbus0
> usbus1 on ohci0
> ehci1: <Generic EHCI Controller> mem 0xfe3c0000-0xfe3dffff irq 15 on ofwbus0
> usbus2: EHCI version 1.0
> usbus2 on ehci1
> ohci1: <Generic OHCI Controller> mem 0xfe3e0000-0xfe3fffff irq 16 on ofwbus0
> usbus3 on ohci1
> rk_dwc30: <Rockchip RK3399 DWC3> on ofwbus0
> xhci0: <Synopsys Designware DWC3> mem 0xfe800000-0xfe8fffff irq 77 on rk_dwc30
> xhci0: 64 bytes context size, 32-bit DMA
> usbus4: trying to attach
> usbus4 on xhci0
> rk_dwc31: <Rockchip RK3399 DWC3> on ofwbus0
> xhci1: <Synopsys Designware DWC3> mem 0xfe900000-0xfe9fffff irq 78 on rk_dwc31
> xhci1: 64 bytes context size, 32-bit DMA
> usbus5: trying to attach
> usbus5 on xhci1
> es8316codec0: <Everest Semi ES8316 CODEC> at addr 0x22 on iicbus0
> iic0: <I2C generic I/O> on iicbus0
> iic1: <I2C generic I/O> on iicbus1
> uart0: <Non-standard ns8250 class UART with FIFOs> mem 0xff180000-0xff1800ff irq 26 on ofwbus0
> uart0: debug port (-1,n,8,1)
> uart1: <16750 or compatible> mem 0xff1a0000-0xff1a00ff irq 28 on ofwbus0
> uart1: console (1500000,n,8,1)
> spi0: <Rockchip SPI> mem 0xff1d0000-0xff1d0fff irq 31 on ofwbus0
> spibus0: <OFW SPI bus> on spi0
> spibus0: <unknown card> at cs 0 mode 0
> iic2: <I2C generic I/O> on iicbus2
> iicbus3: <unknown card> at addr 0x44
> iic3: <I2C generic I/O> on iicbus3
> pwm0: <Rockchip PWM> mem 0xff420000-0xff42000f on ofwbus0
> pwmbus0: <OFW PWM bus> on pwm0
> pwmc0: <PWM Control> channel 0 on pwmbus0
> pwm1: <Rockchip PWM> mem 0xff420020-0xff42002f on ofwbus0
> pwmbus1: <OFW PWM bus> on pwm1
> pwmc1: <PWM Control> channel 0 on pwmbus1
> i2s0: <Rockchip I2S> mem 0xff890000-0xff890fff irq 51 on ofwbus0
> Cannot set frequency for clk: clkin_i2s, error: 34
> Cannot set frequency for clk: xin24m, error: 34
> pcm0: <simple-audio-card> on ofwbus0
> gpioc0: <GPIO controller> on gpio0
> gpioc1: <GPIO controller> on gpio1
> gpioc2: <GPIO controller> on gpio2
> gpioc3: <GPIO controller> on gpio3
> gpioc4: <GPIO controller> on gpio4
> rk_edp_panel0: <RockChip lcd panel> on ofwbus0
> gpioled0: <GPIO LEDs> on ofwbus0
> pcm1: <simple-audio-card> on ofwbus0
> simpleamp0: <Simple Amplifier> on ofwbus0
> armv8crypto0: <AES-CBC,AES-XTS,AES-GCM>
> Timecounters tick every 1.000 msec
> usbus0: 480Mbps High Speed USB v2.0
> usbus1: 12Mbps Full Speed USB v1.0
> usbus2: 480Mbps High Speed USB v2.0
> usbus3: 12Mbps Full Speed USB v1.0
> usbus4: 5.0Gbps Super Speed USB v3.0
> usbus5: 5.0Gbps Super Speed USB v3.0
> rk_drm0: port found
> <6>[drm] Connector eDP-1: get mode from tunables:
> <6>[drm]   - kern.vt.fb.modes.eDP-1
> <6>[drm]   - kern.vt.fb.default_mode
> rk_drm0: Cannot find port with phandle 10
> rk_drm_fb_preinit
> <6>[drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
> <6>[drm] No driver support for vblank timestamp query.
> WARNING: Device "fb" is Giant locked and may be deleted before FreeBSD 14.0.
> VT: Replacing driver "efifb" with new "fb".
> <6>[drm] Initialized rockchip 1.0.0 20201113 for rk_drm on minor 0
> rk808_pmu0: registered as a time-of-day clock, resolution 1.000000s
> ugen3.1: <Generic OHCI root HUB> at usbus3
> uhub0 on usbus3
> uhub0: <Generic OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus3
> ugen2.1: <Generic EHCI root HUB> at usbus2
> uhub1 on usbus2
> uhub1: <Generic EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus2
> ugen1.1: <Generic OHCI root HUB> at usbus1
> uhub2 on usbus1
> uhub2: <Generic OHCI root HUB, class 9/0, rev 1.00/1.00, addr 1> on usbus1
> ugen5.1: <Synopsys XHCI root HUB> at usbus5
> uhub3 on usbus5
> uhub3: <Synopsys XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus5
> ugen4.1: <Synopsys XHCI root HUB> at usbus4
> uhub4 on usbus4
> uhub4: <Synopsys XHCI root HUB, class 9/0, rev 3.00/1.00, addr 1> on usbus4
> ugen0.1: <Generic EHCI root HUB> at usbus0
> uhub5 on usbus0
> uhub5: <Generic EHCI root HUB, class 9/0, rev 2.00/1.00, addr 1> on usbus0
> mmcsd0: 8GB <SDHC SA08G 4.3 SN 3177653E MFG 01/2020 by 2 TM> at mmc0 20.0MHz/4bit/1016-block
> WARNING cur_vblank != vblank->last failed at /usr/src/sys/dev/drm/core/drm_vblank.c:279
> Fatal data abort:
>    x0: ffffa0000091f498
>    x1:                0
>    x2:               a8
>    x3:              102
>    x4:              102
>    x5: ffff00009a845990GEOM: mmcsd0: the secondary GPT header is not in the last LBA.
>   (_end + 9976a990)
>    x6:                0
>    x7:              501
>    x8: ffffa00000d5f000
>    x9:                2
>   x10:                2
>   x11:                0
>   x12:                0
>   x13:                0
>   x14:                0
>   x15:               10
>   x16:              400
>   x17:                0
>   x18: ffff00009a845810 (_end + 9976a810)
>   x19: ffffa00000d5b600
>   x20: ffffa0000091f498
>   x21:              102
>   x22:                2
>   x23: ffff000000f10b30 (proc0 + 0)
>   x24: ffff000000cb5000 (sdta_vfs_vop_vop_spare1_return0 + 0)
>   x25: ffff000000cb5000 (sdta_vfs_vop_vop_spare1_return0 + 0)
>   x26: ffff000000cb5000 (sdta_vfs_vop_vop_spare1_return0 + 0)
>   x27: ffff000000cb5000 (sdta_vfs_vop_vop_spare1_return0 + 0)
>   x28:                0
>   x29: ffff00009a845810 (_end + 9976a810)
>    sp: ffff00009a845810
>    lr: ffff0000007080e8 (linux_alloc_current + 58)
>   elr: ffff000000708360 (linux_alloc_current + 2d0)
> spsr:         60000045
>   far:                e
>   esr:         96000004
> WARNING !list_empty(&lock->head) failed at /usr/src/sys/dev/drm/core/drm_modeset_lock.c:268
> WARNING !list_empty(&lock->head) failed at /usr/src/sys/dev/drm/core/drm_modeset_lock.c:268
> WARNING !list_empty(&lock->head) failed at /usr/src/sys/dev/drm/core/drm_modeset_lock.c:268
> WARNING !list_empty(&lock->head) failed at /usr/src/sys/dev/drm/core/drm_modeset_lock.c:268
> WARNING !list_empty(&lock->head) failed at /usr/src/sys/dev/drm/core/drm_modeset_lock.c:268
> WARNING !drm_modeset_is_locked(&crtc->mutex) failed at /usr/src/sys/dev/drm/core/drm_atomic_helper.c:615
> WARNING !drm_modeset_is_locked(&dev->mode_config.connection_mutex) failed at /usr/src/sys/dev/drm/core/drm_atomic_helper.c:660
> WARNING !drm_modeset_is_locked(&plane->mutex) failed at /usr/src/sys/dev/drm/core/drm_atomic_helper.c:865
> WARNING !drm_modeset_is_locked(&plane->mutex) failed at /usr/src/sys/dev/drm/core/drm_atomic_helper.c:865
> <3>[drm: 0xffff00000090f048] *ERROR* [CRTC:33:crtc-0] hw_done timed out
> <3>[drm: 0xffff00000090f074] *ERROR* [CRTC:33:crtc-0] flip_done timed out
> <3>[drm: 0xffff00000090f0fc] *ERROR* [CONNECTOR:35:eDP-1] hw_done timed out
> <3>[drm: 0xffff00000090f128] *ERROR* [CONNECTOR:35:eDP-1] flip_done timed out
> <3>[drm: 0xffff00000090f1b8] *ERROR* [PLANE:31:plane-0] hw_done timed out
> <3>[drm: 0xffff00000090f1e4] *ERROR* [PLANE:31:plane-0] flip_done timed out
> <3>[drm: 0xffff00000090f1b8] *ERROR* [PLANE:32:plane-1] hw_done timed out
> <3>[drm: 0xffff00000090f1e4] *ERROR* [PLANE:32:plane-1] flip_done timed out
> [CRTC:33:crtc-0] vblank wait timed out
> 
> Is there any suggetions ?
> 
I am currently building a newer image to try to reproduce, in the mean 
time did you try my prebuild image here
http://build.schmitz.computer/build/pbp/FreeBSD-14.0-CURRENT-arm64-aarch64-PINEBOOKPRO.img.xz 
?

Thanks
/jsm

> Best regards
> 
> [1] https://github.com/jsm222/drm-subtree
> ---
> Kazuhiko Kiriyama <kiri@truefc.org>
> 
> 
> 
> 
> 
> 
>