David Bremner: Hibernate on the pocket reform 13/n
Context
- See hibernate-pocket, hibernate-pocket-2, hibernate-pocket-3,
hibernate-pocket-4,hibernate-pocket-5, hibernate-pocket-6,
hibernate-pocket-7, hibernate-pocket-8, hibernate-pocket-9
hibernate-pocket-10 hibernate-pocket-11 hibernate-pocket-12
Some progress upstream
Recently Sebastian Reichel at Collabora [1] has made a few related commits, apparently inspired in part by my kvetching on this blog.
Disconnecting and reconnecting PCI busses
At some point I noticed error message about the nvme device on
resume. I then learned how to disconnect and reconnect PCI buses in
Linux. I ended up with something like the following. At least the PCI
management seems to work. I can manually disconnect all the PCI busses
and rescan to connect them again on a running system. It presumably
helps that I am not using the nvme device in this system.
set -x
echo platform > /sys/power/pm_test
echo reboot > /sys/power/disk
rmmod mt76x2u
sleep 2
echo 1 tee /sys/bus/pci/devices/0003:30:00.0/remove
sleep 2
echo 1 tee /sys/bus/pci/devices/0004:41:00.0/remove
sleep 2
echo 1 tee /sys/bus/pci/devices/0004:40:00.0/remove
sleep 2
echo LSPCI:
lspci -t
sleep 2
echo disk > /sys/power/state
sleep 2
echo 1 tee /sys/bus/pci/rescan
sleep 2
modprobe mt76x2u
Minimal changes to upstream
With the ongoing work at collabora I decided to try a minimal patch
stack to get the pocket reform to boot. I added the following 3
commits (available from [3]).
09868a4f2eb (HEAD -> reform-patches) copy pocket-reform dts from reform-debian-packages
152e2ae8a193 pocket/panel: sleep fix v3
18f65da9681c add-multi-display-panel-driver
It does indeed boot and seems stable.
$ uname -a
Linux anthia 6.18.0-rc1+ #19 SMP Thu Oct 16 11:32:04 ADT 2025 aarch64 GNU/Linux
Running the hibernation script above I get no output from the lspci,
but seemingly issues with PCI coming back from hibernate:
[ 424.645109] PM: hibernation: Allocated 361823 pages for snapshot
[ 424.647216] PM: hibernation: Allocated 1447292 kbytes in 3.23 seconds (448.07 MB/s)
[ 424.649321] Freezing remaining freezable tasks
[ 424.654767] Freezing remaining freezable tasks completed (elapsed 0.003 seconds)
[ 424.661070] rk_gmac-dwmac fe1b0000.ethernet end0: Link is Down
[ 424.740716] rockchip-dw-pcie a40c00000.pcie: Failed to receive PME_TO_Ack
[ 424.742041] PM: hibernation: hibernation debug: Waiting for 5 second(s).
[ 430.074757] pci 0004:40:00.0: [1d87:3588] type 01 class 0x060400 PCIe Root Port
F F & Zn [ watchdog: CPU4: Watchdog detected hard LOCKUP on cpu 5
[ 456.039004] Modules linked in: xt_CHECKSUM xt_tcpudp nft_chain_nat xt_MASQUERADE nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nft_compat x_tables bridge stp llc nf_tables aes_neon_bs aes_neon_blk ccm dwmac_rk binfmt_misc mt76x2_common mt76x02_usb mt76_usb mt76x02_lib mt76 mac80211 rk805_pwrkey snd_soc_tlv320aic31xx snd_soc_simple_card reform2_lpc(OE) libarc4 rockchip_saradc industrialio_triggered_buffer kfifo_buf industrialio cfg80211 rockchip_thermal rockchip_rng hantro_vpu cdc_acm v4l2_vp9 v4l2_jpeg rockchip_rga rfkill snd_soc_rockchip_i2s_tdm videobuf2_dma_sg v4l2_h264 panthor snd_soc_audio_graph_card drm_gpuvm snd_soc_simple_card_utils drm_exec evdev joydev dm_mod nvme_fabrics efi_pstore configfs nfnetlink autofs4 ext4 crc16 mbcache jbd2 btrfs blake2b_generic xor xor_neon raid6_pq mali_dp snd_soc_meson_axg_toddr snd_soc_meson_axg_fifo snd_soc_meson_codec_glue panfrost drm_shmem_helper gpu_sched ao_cec_g12a meson_vdec(C) videobuf2_dma_contig videobuf2_memops v4l2_mem2mem videobuf2_v4l2 videodev
[ 456.039060] videobuf2_common mc dw_hdmi_i2s_audio meson_drm meson_canvas meson_dw_mipi_dsi meson_dw_hdmi mxsfb mux_mmio panel_edp imx_dcss ti_sn65dsi86 nwl_dsi mux_core pwm_imx27 hid_generic usbhid hid xhci_plat_hcd onboard_usb_dev xhci_hcd nvme nvme_core snd_soc_hdmi_codec snd_soc_core nvme_keyring nvme_auth hkdf snd_pcm_dmaengine snd_pcm snd_timer snd soundcore fan53555 rtc_pcf8523 micrel phy_package stmmac_platform stmmac pcs_xpcs rk808_regulator phylink sdhci_of_dwcmshc mdio_devres dw_mmc_rockchip of_mdio sdhci_pltfm phy_rockchip_usbdp fixed_phy dw_mmc_pltfm fwnode_mdio typec phy_rockchip_naneng_combphy phy_rockchip_samsung_hdptx pwm_rockchip sdhci dwc3 libphy dw_wdt dw_mmc ehci_platform rockchip_dfi mdio_bus cqhci ulpi ohci_platform ehci_hcd udc_core ohci_hcd rockchipdrm phy_rockchip_inno_usb2 usbcore dw_hdmi_qp analogix_dp dw_mipi_dsi cpufreq_dt dw_mipi_dsi2 i2c_rk3x usb_common drm_dp_aux_bus [last unloaded: mt76x2u]
[ 456.039111] Sending NMI from CPU 4 to CPUs 5:
[ 471.942262] page_pool_release_retry() stalled pool shutdown: id 9, 2 inflight 60 sec
[ 532.989611] page_pool_release_retry() stalled pool shutdown: id 9, 2 inflight 121 sec
This does look like some progress, probably thanks to Sebastien. Comparing with the logs in hibernate-pocket-12, the resume process is not bailing out complaining about PHY.
Attempt to reapply PCI reset patches
Following the procedure in hibernate-pocket-12, I attempted to
re-apply the pci reset patches [2]. In particular I followed the hints
output by b4.
Unfortunately there are too many conflicts now for me to sensibly
resolve.
- https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux.git#rockchip-devel
- https://lore.kernel.org/all/20250715-pci-port-reset-v6-0-6f9cce94e7bb@oss.qualcomm.com/#r
- https://salsa.debian.org/bremner/collabora-rockchip-3588#reform-patches
Disconnecting and reconnecting PCI busses
At some point I noticed error message about the nvme device on
resume. I then learned how to disconnect and reconnect PCI buses in
Linux. I ended up with something like the following. At least the PCI
management seems to work. I can manually disconnect all the PCI busses
and rescan to connect them again on a running system. It presumably
helps that I am not using the nvme device in this system.
set -x
echo platform > /sys/power/pm_test
echo reboot > /sys/power/disk
rmmod mt76x2u
sleep 2
echo 1 tee /sys/bus/pci/devices/0003:30:00.0/remove
sleep 2
echo 1 tee /sys/bus/pci/devices/0004:41:00.0/remove
sleep 2
echo 1 tee /sys/bus/pci/devices/0004:40:00.0/remove
sleep 2
echo LSPCI:
lspci -t
sleep 2
echo disk > /sys/power/state
sleep 2
echo 1 tee /sys/bus/pci/rescan
sleep 2
modprobe mt76x2u
Minimal changes to upstream
With the ongoing work at collabora I decided to try a minimal patch
stack to get the pocket reform to boot. I added the following 3
commits (available from [3]).
09868a4f2eb (HEAD -> reform-patches) copy pocket-reform dts from reform-debian-packages
152e2ae8a193 pocket/panel: sleep fix v3
18f65da9681c add-multi-display-panel-driver
It does indeed boot and seems stable.
$ uname -a
Linux anthia 6.18.0-rc1+ #19 SMP Thu Oct 16 11:32:04 ADT 2025 aarch64 GNU/Linux
Running the hibernation script above I get no output from the lspci,
but seemingly issues with PCI coming back from hibernate:
[ 424.645109] PM: hibernation: Allocated 361823 pages for snapshot
[ 424.647216] PM: hibernation: Allocated 1447292 kbytes in 3.23 seconds (448.07 MB/s)
[ 424.649321] Freezing remaining freezable tasks
[ 424.654767] Freezing remaining freezable tasks completed (elapsed 0.003 seconds)
[ 424.661070] rk_gmac-dwmac fe1b0000.ethernet end0: Link is Down
[ 424.740716] rockchip-dw-pcie a40c00000.pcie: Failed to receive PME_TO_Ack
[ 424.742041] PM: hibernation: hibernation debug: Waiting for 5 second(s).
[ 430.074757] pci 0004:40:00.0: [1d87:3588] type 01 class 0x060400 PCIe Root Port
F F & Zn [ watchdog: CPU4: Watchdog detected hard LOCKUP on cpu 5
[ 456.039004] Modules linked in: xt_CHECKSUM xt_tcpudp nft_chain_nat xt_MASQUERADE nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nft_compat x_tables bridge stp llc nf_tables aes_neon_bs aes_neon_blk ccm dwmac_rk binfmt_misc mt76x2_common mt76x02_usb mt76_usb mt76x02_lib mt76 mac80211 rk805_pwrkey snd_soc_tlv320aic31xx snd_soc_simple_card reform2_lpc(OE) libarc4 rockchip_saradc industrialio_triggered_buffer kfifo_buf industrialio cfg80211 rockchip_thermal rockchip_rng hantro_vpu cdc_acm v4l2_vp9 v4l2_jpeg rockchip_rga rfkill snd_soc_rockchip_i2s_tdm videobuf2_dma_sg v4l2_h264 panthor snd_soc_audio_graph_card drm_gpuvm snd_soc_simple_card_utils drm_exec evdev joydev dm_mod nvme_fabrics efi_pstore configfs nfnetlink autofs4 ext4 crc16 mbcache jbd2 btrfs blake2b_generic xor xor_neon raid6_pq mali_dp snd_soc_meson_axg_toddr snd_soc_meson_axg_fifo snd_soc_meson_codec_glue panfrost drm_shmem_helper gpu_sched ao_cec_g12a meson_vdec(C) videobuf2_dma_contig videobuf2_memops v4l2_mem2mem videobuf2_v4l2 videodev
[ 456.039060] videobuf2_common mc dw_hdmi_i2s_audio meson_drm meson_canvas meson_dw_mipi_dsi meson_dw_hdmi mxsfb mux_mmio panel_edp imx_dcss ti_sn65dsi86 nwl_dsi mux_core pwm_imx27 hid_generic usbhid hid xhci_plat_hcd onboard_usb_dev xhci_hcd nvme nvme_core snd_soc_hdmi_codec snd_soc_core nvme_keyring nvme_auth hkdf snd_pcm_dmaengine snd_pcm snd_timer snd soundcore fan53555 rtc_pcf8523 micrel phy_package stmmac_platform stmmac pcs_xpcs rk808_regulator phylink sdhci_of_dwcmshc mdio_devres dw_mmc_rockchip of_mdio sdhci_pltfm phy_rockchip_usbdp fixed_phy dw_mmc_pltfm fwnode_mdio typec phy_rockchip_naneng_combphy phy_rockchip_samsung_hdptx pwm_rockchip sdhci dwc3 libphy dw_wdt dw_mmc ehci_platform rockchip_dfi mdio_bus cqhci ulpi ohci_platform ehci_hcd udc_core ohci_hcd rockchipdrm phy_rockchip_inno_usb2 usbcore dw_hdmi_qp analogix_dp dw_mipi_dsi cpufreq_dt dw_mipi_dsi2 i2c_rk3x usb_common drm_dp_aux_bus [last unloaded: mt76x2u]
[ 456.039111] Sending NMI from CPU 4 to CPUs 5:
[ 471.942262] page_pool_release_retry() stalled pool shutdown: id 9, 2 inflight 60 sec
[ 532.989611] page_pool_release_retry() stalled pool shutdown: id 9, 2 inflight 121 sec
This does look like some progress, probably thanks to Sebastien. Comparing with the logs in hibernate-pocket-12, the resume process is not bailing out complaining about PHY.
Attempt to reapply PCI reset patches
Following the procedure in hibernate-pocket-12, I attempted to
re-apply the pci reset patches [2]. In particular I followed the hints
output by b4.
Unfortunately there are too many conflicts now for me to sensibly
resolve.
- https://gitlab.collabora.com/hardware-enablement/rockchip-3588/linux.git#rockchip-devel
- https://lore.kernel.org/all/20250715-pci-port-reset-v6-0-6f9cce94e7bb@oss.qualcomm.com/#r
- https://salsa.debian.org/bremner/collabora-rockchip-3588#reform-patches
set -x
echo platform > /sys/power/pm_test
echo reboot > /sys/power/disk
rmmod mt76x2u
sleep 2
echo 1 tee /sys/bus/pci/devices/0003:30:00.0/remove
sleep 2
echo 1 tee /sys/bus/pci/devices/0004:41:00.0/remove
sleep 2
echo 1 tee /sys/bus/pci/devices/0004:40:00.0/remove
sleep 2
echo LSPCI:
lspci -t
sleep 2
echo disk > /sys/power/state
sleep 2
echo 1 tee /sys/bus/pci/rescan
sleep 2
modprobe mt76x2u
09868a4f2eb (HEAD -> reform-patches) copy pocket-reform dts from reform-debian-packages
152e2ae8a193 pocket/panel: sleep fix v3
18f65da9681c add-multi-display-panel-driver
$ uname -a
Linux anthia 6.18.0-rc1+ #19 SMP Thu Oct 16 11:32:04 ADT 2025 aarch64 GNU/Linux
[ 424.645109] PM: hibernation: Allocated 361823 pages for snapshot
[ 424.647216] PM: hibernation: Allocated 1447292 kbytes in 3.23 seconds (448.07 MB/s)
[ 424.649321] Freezing remaining freezable tasks
[ 424.654767] Freezing remaining freezable tasks completed (elapsed 0.003 seconds)
[ 424.661070] rk_gmac-dwmac fe1b0000.ethernet end0: Link is Down
[ 424.740716] rockchip-dw-pcie a40c00000.pcie: Failed to receive PME_TO_Ack
[ 424.742041] PM: hibernation: hibernation debug: Waiting for 5 second(s).
[ 430.074757] pci 0004:40:00.0: [1d87:3588] type 01 class 0x060400 PCIe Root Port
F F & Zn [ watchdog: CPU4: Watchdog detected hard LOCKUP on cpu 5
[ 456.039004] Modules linked in: xt_CHECKSUM xt_tcpudp nft_chain_nat xt_MASQUERADE nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nft_compat x_tables bridge stp llc nf_tables aes_neon_bs aes_neon_blk ccm dwmac_rk binfmt_misc mt76x2_common mt76x02_usb mt76_usb mt76x02_lib mt76 mac80211 rk805_pwrkey snd_soc_tlv320aic31xx snd_soc_simple_card reform2_lpc(OE) libarc4 rockchip_saradc industrialio_triggered_buffer kfifo_buf industrialio cfg80211 rockchip_thermal rockchip_rng hantro_vpu cdc_acm v4l2_vp9 v4l2_jpeg rockchip_rga rfkill snd_soc_rockchip_i2s_tdm videobuf2_dma_sg v4l2_h264 panthor snd_soc_audio_graph_card drm_gpuvm snd_soc_simple_card_utils drm_exec evdev joydev dm_mod nvme_fabrics efi_pstore configfs nfnetlink autofs4 ext4 crc16 mbcache jbd2 btrfs blake2b_generic xor xor_neon raid6_pq mali_dp snd_soc_meson_axg_toddr snd_soc_meson_axg_fifo snd_soc_meson_codec_glue panfrost drm_shmem_helper gpu_sched ao_cec_g12a meson_vdec(C) videobuf2_dma_contig videobuf2_memops v4l2_mem2mem videobuf2_v4l2 videodev
[ 456.039060] videobuf2_common mc dw_hdmi_i2s_audio meson_drm meson_canvas meson_dw_mipi_dsi meson_dw_hdmi mxsfb mux_mmio panel_edp imx_dcss ti_sn65dsi86 nwl_dsi mux_core pwm_imx27 hid_generic usbhid hid xhci_plat_hcd onboard_usb_dev xhci_hcd nvme nvme_core snd_soc_hdmi_codec snd_soc_core nvme_keyring nvme_auth hkdf snd_pcm_dmaengine snd_pcm snd_timer snd soundcore fan53555 rtc_pcf8523 micrel phy_package stmmac_platform stmmac pcs_xpcs rk808_regulator phylink sdhci_of_dwcmshc mdio_devres dw_mmc_rockchip of_mdio sdhci_pltfm phy_rockchip_usbdp fixed_phy dw_mmc_pltfm fwnode_mdio typec phy_rockchip_naneng_combphy phy_rockchip_samsung_hdptx pwm_rockchip sdhci dwc3 libphy dw_wdt dw_mmc ehci_platform rockchip_dfi mdio_bus cqhci ulpi ohci_platform ehci_hcd udc_core ohci_hcd rockchipdrm phy_rockchip_inno_usb2 usbcore dw_hdmi_qp analogix_dp dw_mipi_dsi cpufreq_dt dw_mipi_dsi2 i2c_rk3x usb_common drm_dp_aux_bus [last unloaded: mt76x2u]
[ 456.039111] Sending NMI from CPU 4 to CPUs 5:
[ 471.942262] page_pool_release_retry() stalled pool shutdown: id 9, 2 inflight 60 sec
[ 532.989611] page_pool_release_retry() stalled pool shutdown: id 9, 2 inflight 121 sec
PHY.

However, on closer inspection you'll notice that your normal jumper wires don't fit as the Shelly has a connector with 1.27mm (0.05in) pitch and 1mm diameter holes.
Now, there are various tutorials on the Internet how to build a compatible connector using
The first step is to cut the header into 6 pin chunks. Make sure not to cut too close to the 6th pin as the whole thing is rather fragile and you might lose it.
It now fits very well into the Shelly with the longer side of the pins.
Second step is to strip the plastic part of one side of the jumper wires. Those are designed to fit 2.54mm pitch headers and won't work for our use case otherwise.
As the connectors are still too big, even after removing the plastic, the next step is to take some pliers and gently press the connectors until they fit the smaller pins of our header.
Now is the time to put everything together. To avoid short circuiting the pins/connectors, apply some isolation tape while assembling, but not too much as the space is really limited.
And we're done, a wonderful (lol) and working (yay) Shelly 2.5 cable that can be attached to any USB-TTL adapter, like the pictured FTDI clone you get almost everywhere.
Yes, in an ideal world we would have soldered the header to the cable, but I didn't feel like soldering on that limited space. And yes, shrink-wrap might be a good thing too, but again, limited space and with isolation tape you only need one layer between two pins, not two.
Following up on my
What happened in the
As mentioned in 
After fixing some bugs this week, I ve noticed they ve been one per day (on average) so I think I m joining