BH edition does not always wake up from suspend correctly

I've noticed this a few times before, but luckily this time I had the serial connection established and saw some output from the kernel crying in agony ;)

When this happens the display will remain black (a previously established ssh session is still working. In this case a reboot is required (I even had to forcefully shutdown the device by pressing the powerbutton for a few seconds) to get the display working again.

I'm not sure yet how to reliably reproduce this. Maybe this output can give some idea of where the problem is coming from:

[ 6751.802003] Disabling non-boot CPUs ...
[ 6751.806869] CPU1: shutdown
[ 6751.809683] psci: CPU1 killed (polled 0 ms)
[ 6751.820591] CPU2: shutdown
[ 6751.823434] psci: CPU2 killed (polled 0 ms)
[ 6751.834542] CPU3: shutdown
[ 6751.837341] psci: CPU3 killed (polled 0 ms)
[ 6751.848018] Enabling non-boot CPUs ...
[ 6751.852714] Detected VIPT I-cache on CPU1
[ 6751.856786] arch_timer: CPU1: Trapping CNTVCT access
[ 6751.861766] CPU1: Booted secondary processor 0x0000000001 [0x410fd034]
[ 6751.869343] CPU1 is up
[ 6751.872213] Detected VIPT I-cache on CPU2
[ 6751.876258] arch_timer: CPU2: Trapping CNTVCT access
[ 6751.881229] CPU2: Booted secondary processor 0x0000000002 [0x410fd034]
[ 6751.888641] CPU2 is up
[ 6751.891507] Detected VIPT I-cache on CPU3
[ 6751.895551] arch_timer: CPU3: Trapping CNTVCT access
[ 6751.900523] CPU3: Booted secondary processor 0x0000000003 [0x410fd034]
[ 6751.907922] CPU3 is up
[ 6751.911360] sunxi-rsb 1f03400.rsb: RSB running at 3000000 Hz
[ 6753.160366] OOM killer enabled.
[ 6753.163591] Restarting tasks ... 
[ 6753.163733] Unable to handle kernel NULL pointer dereference at virtual address 0000000000000008
[ 6753.175905] Mem abort info:
[ 6753.178768]   ESR = 0x96000044
[ 6753.181875]   EC = 0x25: DABT (current EL), IL = 32 bits
[ 6753.185535] done.
[ 6753.187243]   SET = 0, FnV = 0
[ 6753.192255]   EA = 0, S1PTW = 0
[ 6753.195472] Data abort info:
[ 6753.195484]   ISV = 0, ISS = 0x00000044
[ 6753.195488]   CM = 0, WnR = 1
[ 6753.195497] user pgtable: 4k pages, 48-bit VAs, pgdp=0000000078cd3000
[ 6753.195502] [0000000000000008] pgd=0000000000000000
[ 6753.195513] Internal error: Oops: 96000044 [#1] PREEMPT SMP
[ 6753.195520] Modules linked in: fuse qmi_wwan cdc_wdm option usbnet usb_wwan usbserial rfcomm bnep usb_f_acm u_serial usb_f_ecm g_multi usb_f_mass_storage usb_f_rndis u_ether libcomposite crct10dif_ce hci_uart btrtl 8723cs(C) btbcm snd_soc_simple_card sun6i_csi snd_soc_simple_card_utils st_magn_spi bluetooth st_sensors_spi videobuf2_dma_contig videobuf2_memops st_magn_i2c sun50i_codec_analog st_sensors_i2c videobuf2_v4l2 sun8i_adda_pr_regmap st_magn inv_mpu6050_i2c inv_mpu6050 st_sensors videobuf2_common industrialio_triggered_buffer kfifo_buf ecdh_generic stk3310 ecc cfg80211 rfkill sun8i_codec sun4i_i2s ov5640 v4l2_fwnode snd_soc_simple_amplifier snd_soc_bt_sco snd_soc_ec25 videodev snd_soc_core snd_pcm_dmaengine sun6i_dma mc snd_pcm virt_dma snd_timer snd soundcore ip_tables x_tables ipv6 nf_defrag_ipv6 sunxi phy_generic musb_hdrc udc_core i2c_gpio
[ 6753.297247] CPU: 2 PID: 11811 Comm: kworker/2:3 Tainted: G         C        5.7-pinephone #5.7.0+pinephone3
[ 6753.297254] Hardware name: Pine64 PinePhone Braveheart (1.1) (DT)
[ 6753.297303] Workqueue: events_long h5_btrtl_reprobe_worker [hci_uart]
[ 6753.297316] pstate: 80000005 (Nzcv daif -PAN -UAO)
[ 6753.297498] pc : hci_unregister_dev+0x4c/0x2a0 [bluetooth]
[ 6753.297615] lr : hci_unregister_dev+0x48/0x2a0 [bluetooth]
[ 6753.307318] PM: suspend exit
[ 6753.313331] sp : ffff800011c1bcb0
[ 6753.313337] x29: ffff800011c1bcb0 x28: ffff800010fd7000 
[ 6753.313346] x27: 0000000000000000 x26: ffff80001397bce8 
[ 6753.313355] x25: 0000000000000000 x24: ffff000039779790 
[ 6753.314518] systemd[1]: systemd-journald.service: Main process exited, code=killed, status=6/ABRT
[ 6753.315071] systemd[1]: systemd-journald.service: Failed with result 'watchdog'.
[ 6753.323856] systemd[1]: systemd-journald.service: Scheduled restart job, restart counter is at 1.
[ 6753.324585] x23: ffff00007dba6f00 x22: 0000000000000000 
[ 6753.339244] systemd[1]: Stopping Flush Journal to Persistent Storage...
[ 6753.341729] x21: ffff800008f7c0b0 x20: ffff800008dc5098 
[ 6753.341739] x19: ffff00007a8d8000 x18: 0000000000000010 
[ 6753.341747] x17: 0000000000000000 x16: 0000000000000001 
[ 6753.341755] x15: 0000000000000004 x14: 0000000000000132 
[ 6753.341763] x13: 0000000000000000 x12: 0000000000000030 
[ 6753.341782] x11: 0000000000000030 x10: 0101010101010101 
[ 6753.361124] systemd[1]: systemd-suspend.service: Succeeded.
[ 6753.366545] x9 : 6cff716475687163 x8 : 7f7f7f7f7f7f7f7f 
[ 6753.366554] x7 : 0000000000000001 x6 : 0000000000000001 
[ 6753.366562] x5 : ffff800011c1c000 x4 : ffff800008d4daf0 
[ 6753.366569] x3 : 0000000000000000 x2 : 0000000000000000 
[ 6753.366576] x1 : 0000000000000000 x0 : 0000000000000000 
[ 6753.366592] Call trace:
[ 6753.394635] systemd[1]: Finished Suspend.
[ 6753.394893]  hci_unregister_dev+0x4c/0x2a0 [bluetooth]
[ 6753.428028] systemd[1]: systemd-journal-flush.service: Succeeded.
[ 6753.432152]  hci_uart_unregister_device+0x44/0x80 [hci_uart]
[ 6753.432176]  h5_serdev_remove+0x14/0x20 [hci_uart]
[ 6753.432194]  serdev_drv_remove+0x24/0x48
[ 6753.432216]  device_release_driver_internal+0xfc/0x1d0
[ 6753.450897] systemd[1]: Stopped Flush Journal to Persistent Storage.
[ 6753.453425]  device_driver_detach+0x18/0x28
[ 6753.453432]  device_reprobe+0x20/0x40
[ 6753.453468]  h5_btrtl_reprobe_worker+0x20/0x78 [hci_uart]
[ 6753.453487]  process_one_work+0x1bc/0x338
[ 6753.462885] systemd[1]: Stopped target Sleep.
[ 6753.465250]  worker_thread+0x4c/0x428
[ 6753.471549] systemd[1]: Reached target Suspend.
[ 6753.476465]  kthread+0x110/0x148
[ 6753.476474]  ret_from_fork+0x10/0x1c
[ 6753.476491] Code: aa1403e0 79408276 95f2bb9f a9400662 (f9000441) 
[ 6753.476502] ---[ end trace 6f5b994dd2a5ecc8 ]---
[ 6753.476650] note: kworker/2:3[11811] exited with preempt_count 1
[ 6753.483820] systemd[1]: Stopped Journal Service.
[ 6753.573866] systemd[1]: Starting Journal Service...
[ 6753.583829] systemd[1]: Stopped target Suspend.
[ 6753.649248] systemd[1]: Condition check resulted in Load Kernel Module drm being skipped.
[ 6754.919790] systemd-journald[11865]: File /var/log/journal/c179591a86f94240aea9ef85bc3d4fdf/system.journal corrupted or uncleanly shut down, renaming and replacing.
[ 6755.274103] systemd[1]: Started Journal Service.
[ 6755.343482] systemd-journald[11865]: Received client request to flush runtime journal.
Edited by Arnaud Ferraris