powersaving jam of flipping frames bug, which causes jammed display and flipping frames.
powersaving jam of flipping frames bug, which causes jammed display and flipping frames.
device: pinephone 3GB variant, mali 400, this was tested on 1.2b hardware version.
os: manjaro
[root@manjaro-arm ~]# pacman -Si mesa
Repository : extra
Name : mesa
Version : 22.3.5-0.2
Description : An open-source implementation of the OpenGL specification
Architecture : aarch64
URL : https://www.mesa3d.org/
Licenses : custom
Groups : None
Provides : mesa-libgl opengl-driver
Depends On : libdrm wayland libxxf86vm libxdamage libxshmfence libelf libomxil-bellagio libunwind llvm-libs lm_sensors libglvnd zstd vulkan-icd-loader libsensors.so=5-64 libexpat.so=1-64
libvulkan.so
Optional Deps : opengl-man-pages: for the OpenGL API man pages
mesa-vdpau: for accelerated video playback
libva-mesa-driver: for accelerated video playback
Conflicts With : mesa-libgl
Replaces : mesa-libgl
Download Size : 21.97 MiB
Installed Size : 59.49 MiB
Packager : Philip Müller <philm@manjaro.org>
Build Date : Tue 14 Feb 2023 04:31:25 PM UTC
Validated By : MD5 Sum SHA-256 Sum Signature
[root@manjaro-arm ~]# pacman -Si linux-pinephone
Repository : core
Name : linux-pinephone
Version : 6.1.9-2
Description : The Linux Kernel and modules - PinePhone Kernel (Megi)
Architecture : aarch64
URL : https://github.com/megous/linux/releases/tag/orange-pi-6.1-20230201-2322
Licenses : GPL2
Groups : None
Provides : kernel26 linux=6.1.9
Depends On : coreutils kmod mkinitcpio>=0.7 rtl8723bt-firmware anx7688-firmware ov5640-firmware
Optional Deps : crda: to set the correct wireless channels of your country
rtl8723bt-firmware-megi: for Pinephone Bluetooth
ov5640-firmware: for Pinephone Camera
uboot-pinephone: Firmware for Pinephone
Conflicts With : linux
Replaces : linux-armv8-rc
Download Size : 22.64 MiB
Installed Size : 35.39 MiB
Packager : Manjaro Build Server <build@manjaro.org>
Build Date : Mon 13 Feb 2023 07:37:58 AM UTC
Validated By : MD5 Sum SHA-256 Sum Signature
[root@manjaro-arm ~]#
[root@manjaro-arm ~]# inxi -GSC -xx
System:
Host: manjaro-arm Kernel: 6.1.9-2-MANJARO-ARM arch: aarch64 bits: 64 compiler: gcc v: 12.1.0
Console: pty pts/1 Distro: Manjaro ARM base: Arch Linux
CPU:
Info: quad core model: N/A variant: cortex-a53 bits: 64 type: MCP arch: ARMv8 rev: 4
Speed (MHz): avg: 1152 min/max: 648/1152 cores: 1: 1152 2: 1152 3: 1152 4: 1152 bogomips: N/A
Features: Use -f option to see features
Graphics:
Device-1: sun50i-a64-mali driver: lima v: kernel bus-ID: N/A chip-ID: allwinner:1c40000
Device-2: sun50i-a64-dw-hdmi driver: sun8i_dw_hdmi v: N/A bus-ID: N/A
chip-ID: allwinner:1ee0000
Device-3: sun50i-a64-display-engine driver: sun4i_drm v: N/A bus-ID: N/A
chip-ID: allwinner:display-engine
Device-4: sun9i-a80-hdmi-audio driver: N/A bus-ID: N/A chip-ID: allwinner:sound_hdmi
Display: server: X.org v: 1.21.1.7 with: Xwayland v: 22.1.8 compositor: phoc driver: N/A
note: X driver n/a tty: 213x52
Monitor-1: DSI-1 size-res: N/A in console
API: OpenGL Message: GL data unavailable in console for root.
[root@manjaro-arm ~]#
some logs, logs are full of this, so it is cut. i didn't find "lima job timeout" this time.
[10136.669145] ------------[ cut here ]------------
[10136.669170] WARNING: CPU: 0 PID: 0 at drivers/gpu/drm/lima/lima_devfreq.c:205 lima_devfreq_record_idle+0xa0/0xb0
[10136.669212] Modules linked in: option qmi_wwan usb_wwan cdc_wdm usbserial usbnet rfcomm bnep ov5640 gc2145 hci_uart snd_soc_simple_card snd_soc_simple_card_utils btrtl st_magn_spi btbcm st_sensors_spi st_magn_i2c bluetooth 8723cs(C) zram st_magn inv_mpu6050_i2c st_sensors_i2c inv_mpu6050 st_sensors zsmalloc panel_sitronix_st7703 industrialio_triggered_buffer ecdh_generic kfifo_buf ecc stk3310 sun50i_codec_analog sun8i_adda_pr_regmap anx7688 sunxi sun4i_i2s sun8i_a33_mbus typec sun8i_codec phy_generic snd_soc_ec25 snd_soc_simple_amplifier snd_soc_bt_sco leds_sgm3140 snd_soc_core display_connector i2c_gpio snd_pcm_dmaengine snd_pcm snd_timer snd soundcore cfg80211 rfkill nls_iso8859_1 pinephone_keyboard sun4i_lradc_keys
[10136.669433] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G WC 6.1.9-2-MANJARO-ARM #1
[10136.669443] Hardware name: Pine64 PinePhone (1.2) (DT)
[10136.669449] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[10136.669459] pc : lima_devfreq_record_idle+0xa0/0xb0
[10136.669472] lr : lima_devfreq_record_idle+0x34/0xb0
[10136.669482] sp : ffff800008003e70
[10136.669486] x29: ffff800008003e70 x28: ffff8000091a2f80 x27: ffff800008ebc130
[10136.669501] x26: ffff8000091a2f80 x25: 0000000000000000 x24: 0000000000000000
[10136.669515] x23: ffff000003aafe00 x22: 0000000000000018 x21: ffff000002a8da24
[10136.669529] x20: 00000000000000c0 x19: ffff000002a8d9f0 x18: ffff0000055a9df0
[10136.669543] x17: ffff8000b6954000 x16: ffff800008004000 x15: 0000000000004000
[10136.669557] x14: 000000000000013e x13: 000000000000013e x12: ffff800009199a88
[10136.669571] x11: 0000000000000001 x10: 0000000000000000 x9 : 0000000000000003
[10136.669585] x8 : ffff000003c63da8 x7 : ffff000003c63db8 x6 : 00000038ab999238
[10136.669599] x5 : 00ffffffffffffff x4 : 000984afdbfc383d x3 : 00000938228ee3ea
[10136.669613] x2 : 00000000ffffffff x1 : fffff6c7e07431ce x0 : 00000000030436f2
[10136.669628] Call trace:
[10136.669634] lima_devfreq_record_idle+0xa0/0xb0
[10136.669646] lima_sched_pipe_task_done+0x5c/0xb0
[10136.669656] lima_gp_irq_handler+0xa8/0x120
[10136.669666] __handle_irq_event_percpu+0x48/0x160
[10136.669679] handle_irq_event+0x4c/0xc0
[10136.669686] handle_fasteoi_irq+0xa4/0x1a0
[10136.669697] generic_handle_domain_irq+0x2c/0x4c
[10136.669711] gic_handle_irq+0x44/0xc0
[10136.669724] call_on_irq_stack+0x2c/0x5c
[10136.669736] do_interrupt_handler+0x80/0x84
[10136.669747] el1_interrupt+0x34/0x6c
[10136.669760] el1h_64_irq_handler+0x18/0x2c
[10136.669770] el1h_64_irq+0x64/0x68
[10136.669777] arch_cpu_idle+0x18/0x2c
[10136.669788] default_idle_call+0x30/0x6c
[10136.669798] do_idle+0x244/0x2c0
[10136.669810] cpu_startup_entry+0x24/0x30
[10136.669819] kernel_init+0x0/0x12c
[10136.669829] arch_post_acpi_subsys_init+0x0/0x18
[10136.669843] start_kernel+0x658/0x698
[10136.669853] __primary_switched+0xb4/0xbc
[10136.669864] ---[ end trace 0000000000000000 ]---
[10136.674721] ------------[ cut here ]------------
[10136.674743] WARNING: CPU: 0 PID: 0 at drivers/gpu/drm/lima/lima_devfreq.c:205 lima_devfreq_record_idle+0xa0/0xb0
[10136.674775] Modules linked in: option qmi_wwan usb_wwan cdc_wdm usbserial usbnet rfcomm bnep ov5640 gc2145 hci_uart snd_soc_simple_card snd_soc_simple_card_utils btrtl st_magn_spi btbcm st_sensors_spi st_magn_i2c bluetooth 8723cs(C) zram st_magn inv_mpu6050_i2c st_sensors_i2c inv_mpu6050 st_sensors zsmalloc panel_sitronix_st7703 industrialio_triggered_buffer ecdh_generic kfifo_buf ecc stk3310 sun50i_codec_analog sun8i_adda_pr_regmap anx7688 sunxi sun4i_i2s sun8i_a33_mbus typec sun8i_codec phy_generic snd_soc_ec25 snd_soc_simple_amplifier snd_soc_bt_sco leds_sgm3140 snd_soc_core display_connector i2c_gpio snd_pcm_dmaengine snd_pcm snd_timer snd soundcore cfg80211 rfkill nls_iso8859_1 pinephone_keyboard sun4i_lradc_keys
[10136.674994] CPU: 0 PID: 0 Comm: swapper/0 Tainted: G WC 6.1.9-2-MANJARO-ARM #1
[10136.675005] Hardware name: Pine64 PinePhone (1.2) (DT)
[10136.675011] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[10136.675021] pc : lima_devfreq_record_idle+0xa0/0xb0
[10136.675032] lr : lima_devfreq_record_idle+0x34/0xb0
[10136.675042] sp : ffff800008003e90
[10136.675047] x29: ffff800008003e90 x28: ffff8000091a2f80 x27: ffff800008ebc130
[10136.675062] x26: ffff8000091a2f80 x25: 0000000000000000 x24: 0000000000000000
[10136.675076] x23: ffff000003aae000 x22: 0000000000000019 x21: ffff000002a8da24
[10136.675090] x20: 00000000000000c0 x19: ffff000002a8d9f0 x18: 0000000000000000
[10136.675103] x17: ffff8000b6954000 x16: ffff800008004000 x15: 0000000000004000
[10136.675118] x14: 0000000000000127 x13: 0000000000000127 x12: ffff800009199a88
[10136.675131] x11: 0000000000001028 x10: 0000000000001020 x9 : 0000000000001fff
[10136.675145] x8 : 000000000000100c x7 : 0000000000000080 x6 : 00000038ab9c8038
[10136.675159] x5 : 00ffffffffffffff x4 : 0009fec200d9b83d x3 : 0000093822e38ed2
[10136.675172] x2 : 00000000ffffffff x1 : fffff6c7dd1c712e x0 : 000000000001542c
[10136.675187] Call trace:
[10136.675192] lima_devfreq_record_idle+0xa0/0xb0
[10136.675204] lima_sched_pipe_task_done+0x5c/0xb0
[10136.675214] lima_pp_irq_handler+0xb0/0xbc
[10136.675224] __handle_irq_event_percpu+0x48/0x160
[10136.675235] handle_irq_event+0x4c/0xc0
[10136.675243] handle_fasteoi_irq+0xa4/0x1a0
[10136.675253] generic_handle_domain_irq+0x2c/0x4c
[10136.675269] gic_handle_irq+0x44/0xc0
[10136.675281] call_on_irq_stack+0x2c/0x5c
[10136.675291] do_interrupt_handler+0x80/0x84
[10136.675302] el1_interrupt+0x34/0x6c
[10136.675314] el1h_64_irq_handler+0x18/0x2c
[10136.675323] el1h_64_irq+0x64/0x68
[10136.675331] arch_cpu_idle+0x18/0x2c
[10136.675342] default_idle_call+0x30/0x6c
[10136.675351] do_idle+0x244/0x2c0
[10136.675362] cpu_startup_entry+0x24/0x30
[10136.675372] kernel_init+0x0/0x12c
[10136.675382] arch_post_acpi_subsys_init+0x0/0x18
[10136.675395] start_kernel+0x658/0x698
[10136.675405] __primary_switched+0xb4/0xbc
[10136.675416] ---[ end trace 0000000000000000 ]---
this bug happens randomly with normal settings (see workaround), maybe once a week. adjusting gpu powersaving settings this can be avoided. this bug is difficult to replicate. all pinephones are affected what i know, and practically all gnu/linux distributions are affected. both plasma and phosh are affected, sxmo is not tested.
how to replicate:
do something simple on screen without screen saving options and similar. then run some heavy cpu and networking activity in a background. in mobiledata bug is more likely, in wifi bug is less likely. usb networking dongle could be used. testing may take hours, at least more than minutes.
# displays something simple on a screen
while true
do echo -n " a b c d e f g h i j k l m n o p q r s t u v w x y z "
#echo -n " a b c d e f g h i j k l m n o p q r s t u v w x y z 0 1 2 3 4 5 6 7 8 9 - * ^ & + # $ % ; < > / \ | _ ! . , "
sleep 0.5
done
# this wastes cpu and networking resources
for repe in `seq 1 4`
do for rep in `seq 1 \`seq 1 4 |shuf -n 1\``
do for rep2 in `seq 1 \`seq 1 4 |shuf -n 1\``
do wget --timeout=10 http://location-of-files/file-1M-${rep2}${rep}.dd &
dd if=/dev/urandom of=/dev/null bs=1M count=999 &
done
done
wait
#sleep 0.5
rm file*
done
related bug #8410 (closed) . this bug has some differences.
https://forum.pine64.org/showthread.php?tid=17771&highlight=flipping+frames
workaround:
# udev rule. this prevent flipping frames bug
# example file location /lib/udev/rules.d/98-preventflippingbug.rules
# powersaving part
KERNEL=="1c40000.gpu", SUBSYSTEM=="platform", DRIVER=="lima", ATTR{power/autosuspend_delay_ms}="-1"
KERNEL=="1c40000.gpu", SUBSYSTEM=="platform", DRIVER=="lima", ATTR{power/control}="on"
# frequency part, may not be needed
KERNEL=="1c40000.gpu", SUBSYSTEM=="devfreq", ATTR{min_freq}="432000000"
KERNEL=="1c40000.gpu", SUBSYSTEM=="devfreq", ATTR{max_freq}="432000000"