Part Number: AM625
Hello,
this is a follow-up of https://e2e.ti.com/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1663669/am62p-suspend-failure-with-12-01-00-05-linux-kernel , which seems to be locked now.
Platform: Verdin AM62 (AM62x), TIFS 11.2.5--v11.02.05 (Fancy Rat).
Some updates after additional tests:
- Linux mainline fails too —
4db207599acfupstream, backported to stable asddcf84b25af0(v6.18.36). - In our testing it only happens when console suspend is disabled (
no_console_suspend, orecho N > /sys/module/printk/parameters/console_suspend).
I added the debug proposed by Anshu Madwesh, plus:
@@ -99,8 +101,8 @@ static inline void ti_sci_pd_set_wkup_constraint(struct device *dev) ret = ti_sci->ops.pm_ops.set_device_constraint(ti_sci, pd->idx, TISCI_MSG_CONSTRAINT_SET);- if (!ret)- dev_dbg(dev, "ti_sci_pd: ID:%d set device constraint.\n", pd->idx);++ dev_err(dev, "ti_sci_pd: ID:%d set device constraint. Ret. %d\n", pd->idx, ret);
In the failing case, all constraints are ACKed:
rtc-ti-k3 2b1f0000.rtc: ti_sci_pd: ID:117 set device constraint. Ret. 0dwc3-am62 f900000.dwc3-usb: ti_sci_pd: ID:178 set device constraint. Ret. 0dwc3-am62 f910000.dwc3-usb: ti_sci_pd: ID:179 set device constraint. Ret. 0omap8250 2800000.serial: ti_sci_pd: ID:146 set device constraint. Ret. 0ti-sci 44043000.system-controller: Failed to prepare sleepti-sci 44043000.system-controller: PM: failed to suspend: error -19
and then TI_SCI_MSG_PREPARE_SLEEP is NACKed, which ti_sci_cmd_prepare_sleep() turns into -ENODEV.
ID 146 is AM62X_DEV_UART0, the console (main_uart0, 0x02800000). The only difference between a working and a failing cycle is that constraint: with console suspend enabled, 117/178/179 are set, PREPARE_SLEEP is ACKed and deep sleep works.
So my questions are:
- Why does the DM accept the constraint on
AM62X_DEV_UART0and then refusePREPARE_SLEEP? Note thatMAIN_USB0_ISO_VDandMAIN_USB1_ISO_VDare also in MAIN and are accepted, so it does not look like a plain MAIN/WKUP split. - Since the documentation says a constraint restricts the low power modes the SoC can enter, would it not be better for the DM to NACK
TISCI_MSG_CONSTRAINT_SETwhen it cannot honour it, rather than accepting it and failingPREPARE_SLEEPlater? A NACK would let the kernel react; silently ignoring it would be worse than either. - Separate issue: after one failed
PREPARE_SLEEP, every subsequent suspend fails until reboot, even with console suspend re-enabled and the same constraints as a previously successful cycle. The docs sayLPM_ABORTshould be sent after a failed prepare sleep, and the kernel does that only whenMSG_FLAG_CAPS_LPM_ABORTis advertised. Is that capability exposed by TIFS 11.2.5?
As a workaround users can avoid disabling console suspend, but I think this should be fixed properly.
Do you have any suggestions?
Emanuele