Skip to content

Fix suspend issues for SANTINO-LT

These two patches fix suspend issues on SANTINO-LT boards.

First - there was a deadlock in network PHY driver. A "fix" from mainline 6.7.0 was adopted.

Deadlock log GFMM03488724 login: root
root@GFMM03488724:~# ./suspend.sh
+ echo N
+ echo 8
+ echo enabled
+ echo mem
[ 42.810554] PM: suspend entry (deep)
[ 42.847509] Filesystems sync: 0.033 seconds
[ 64.489356] Freezing user space processes ...
[ 64.499235] cfg80211: failed to load regulatory.db
[ 64.502370] (elapsed 0.012 seconds) done.
[ 64.513527] OOM killer disabled.
[ 64.517062] Freezing remaining freezable tasks ... (elapsed 0.003 seconds) done.
[ 65.129342] fec 2188000.ethernet eth0: Link is Down
[ 65.152728] PM: suspend devices took 0.620 seconds
[ 65.164718] fec 2188000.ethernet eth0: MDIO read timeout
[ 65.172446] ------------[ cut here ]------------
[ 65.194762] WARNING: CPU: 1 PID: 784 at drivers/net/phy/phy.c:942 phy_error+0x30/0x78
[ 65.202685] Modules linked in: snd_soc_simple_amplifier snd_soc_sgtl5000 imx_sdma coda_vpu v4l2_jpeg imx_vdoa videobuf2_vmalloc snd_soc_simple_card sis_i2c(O) scx0500633(O) rtc_pcf8563_guf(O) ni_force_ts(O) imx6_spreadspectrum(O) ilitek(O) ili2118(O) gfplatdetect(O) egalaxi2c(O) eetii2c(O) atmel_mxt(O) kernel_module_touchgpio(O) configfs
[ 65.232961] CPU: 1 PID: 784 Comm: irq/101-2188000 Tainted: G O 5.15.29-guf #25
[ 65.241511] Hardware name: Freescale i.MX6 Quad/DualLite (Device Tree)
[ 65.248054] Backtrace:
[ 65.250524] [] (dump_backtrace) from [] (show_stack+0x20/0x24)
[ 65.258137] r7:00000009 r6:00000000 r5:c14439a0 r4:60000013
[ 65.263809] [] (show_stack) from [] (dump_stack_lvl+0x60/0x78)
[ 65.271405] [] (dump_stack_lvl) from [] (dump_stack+0x14/0x1c)
[ 65.279001] r7:00000009 r6:000003ae r5:c0963bf8 r4:c1415570
[ 65.284673] [] (dump_stack) from [] (__warn+0xe8/0x168)
[ 65.291662] [] (__warn) from [] (warn_slowpath_fmt+0x6c/0xcc)
[ 65.299176] r7:00000009 r6:000003ae r5:c1415570 r4:00000000
[ 65.304847] [] (warn_slowpath_fmt) from [] (phy_error+0x30/0x78)
[ 65.312620] r8:c5f53a00 r7:c43bdc00 r6:c176ff1c r5:c45e84b0 r4:c45e8000
[ 65.319332] [] (phy_error) from [] (smsc_phy_handle_interrupt+0x68/0x70)
[ 65.327801] r5:c45e8000 r4:ffffff92
[ 65.331390] [] (smsc_phy_handle_interrupt) from [] (phy_interrupt+0x38/0x4c)
[ 65.340200] r5:c45e84b0 r4:c45e8000
[ 65.343789] [] (phy_interrupt) from [] (irq_thread_fn+0x2c/0x88)
[ 65.351561] r7:c43bdc00 r6:c43bdc00 r5:c8010000 r4:c5f53a00
[ 65.357232] [] (irq_thread_fn) from [] (irq_thread+0x16c/0x2a0)
[ 65.364912] r7:c43bdc00 r6:c5f53a24 r5:c8010000 r4:00000000
[ 65.370585] [] (irq_thread) from [] (kthread+0x154/0x178)
[ 65.377750] r10:c5e590c0 r9:c4dffae4 r8:c5f53a00 r7:c01af26c r6:c5e59080 r5:c8010000
[ 65.385593] r4:c5f53a40
[ 65.388139] [] (kthread) from [] (ret_from_fork+0x14/0x38)
[ 65.395386] Exception stack(0xc8011fb0 to 0xc8011ff8)
[ 65.400456] 1fa0: 00000000 00000000 00000000 00000000
[ 65.408648] 1fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 65.416840] 1fe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 65.423471] r10:00000000 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c015f504
[ 65.431314] r4:c5f53a40 r3:c8010000
[ 65.435002] irq event stamp: 11797
[ 65.438476] hardirqs last enabled at (11807): [] __up_console_sem+0x60/0x70
[ 65.446485] hardirqs last disabled at (11816): [] __up_console_sem+0x4c/0x70
[ 65.454435] softirqs last enabled at (11796): [] __do_softirq+0x328/0x5e8
[ 65.462258] softirqs last disabled at (11785): [] __irq_exit_rcu+0x168/0x1e0
[ 65.470252] ---[ end trace 0d5bf8ae98ca1fc0 ]---
[ 65.475698]
[ 65.477206] ============================================
[ 65.482523] WARNING: possible recursive locking detected
[ 65.487840] 5.15.29-guf #25 Tainted: G W O
[ 65.493072] --------------------------------------------
[ 65.498386] irq/101-2188000/784 is trying to acquire lock:
[ 65.503878] c45e84e8 (&dev->lock){+.+.}-{3:3}, at: phy_error+0x3c/0x78
[ 65.510451]
[ 65.510451] but task is already holding lock:
[ 65.516286] c45e84e8 (&dev->lock){+.+.}-{3:3}, at: phy_interrupt+0x2c/0x4c
[ 65.523189]
[ 65.523189] other info that might help us debug this:
[ 65.529718] Possible unsafe locking scenario:
[ 65.529718]
[ 65.535639] CPU0
[ 65.538088] ----
[ 65.540537] lock(&dev->lock);
[ 65.543690] lock(&dev->lock);
[ 65.546843]
[ 65.546843] *** DEADLOCK ***
[ 65.546843]
[ 65.552764] May be due to missing lock nesting notation

Second - reset during suspend. Fix from Seco 4.1.15 kernel was cherry-picked.

Reset log root@GFMM03488724:~# ./suspend.sh
+ echo N
+ echo 8
+ echo enabled
+ echo mem
[ 343.702904] PM: suspend entry (deep)
[ 343.734982] Filesystems sync: 0.027 seconds
[ 343.787672] Freezing user space processes ... (elapsed 0.007 seconds) done.
[ 343.804002] OOM killer disabled.
[ 343.807832] Freezing remaining freezable tasks ... (elapsed 0.005 seconds) done.
[ 343.888040] fec 2188000.ethernet eth0: Link is Down
[ 344.143419] PM: suspend devices took 0.320 seconds
[ 344.168142] Disabling non-boot CPUs ...
Configuring DDR3 pads
DDR3 Voltage: 1350 mV
MMDC_MDCTL = 0x03110000
Initializing DDR3-800E RAM...

Merge request reports