<dhruvag2000>
Yeah s2idle is not really expected to work, atleast from what little I understand about that flow is it ends up in k3_validate_power_state which is a "TODO" at this point, so I think it doesn't proceed further into deep sleep sequence. I am not too sure about why the dwc3 issue comes up in s2idle and not in deepsleep because that just seems totally kernel side sequence to me.
<dhruvag2000>
Does the wakeup source come up as usb1 even if you disabled it and did a rtcwake?
florian has joined #linux-ti
wadim_ has joined #linux-ti
<wadim_>
Disabling USB1 breaks the suspend/resume process. It hangs and I have to restart my system. It will never wakeup.
florian has quit [Ping timeout: 276 seconds]
wadim_ has quit [Ping timeout: 256 seconds]
<dhruvag2000>
Trying to gather few more data points, when you do rtcwake does the device resume instantly or does it actually wait for 5 seconds before resume sequence?
<dhruvag2000>
If 5 is too fast to catch, try with 10 seconds perhaps and ensure that device stays suspended for around 10 seconds
<dhruvag2000>
What I am suspecting is that USB is still triggering a wakeup before the rtc and hence you're seeing it as the wakeup source
<dhruvag2000>
Also, does the USB1 have any peripheral connected?
wadim_ has joined #linux-ti
florian has joined #linux-ti
wadim_ has quit [Ping timeout: 256 seconds]
wadim_ has joined #linux-ti
<wadim_>
With rtcwake and if M4 is running, the wakeup happens after the wakealarm timeout of the rtc. Without M4, the rtcwake happens instantly.
<wadim_>
I tested also longer timeouts of 10 seconds and it behaves identically.
<wadim_>
Our board has a USB Hub connected to USB1. But I do not see any interrupts from USB, only if I enter the suspend state it generates a lot of interrupts.
florian_kc has joined #linux-ti
<dhruvag2000>
@wadim_ /////can you please disconnect the usb hub and try once?
<dhruvag2000>
We have seen issues in the past as well where some USB hubs if connected , they cause issue with suspend resume. I don't have the exact root cause yet on this, maybe try e2e.ti.com for a deep dive with why USB hub may fail. There maybe hardware related stuff that I may not be aware of
<wadim_>
It is a Microchip USB2514 hub. I can not just disconnect it on my hardware. I will try to find a way to test it without the hub, thanks!
<dhruvag2000>
Another data point, when you disable usb and you say it locks up the system, I want to ensure that in your entire boot process no body is touching usb1 including u-boot. Best way to check is using `k3conf dump device 162` (ref. https://software-dl.ti.com/tisci/esd/latest/5_soc_doc/am62x/devices.html ) and see before suspending if it's actually disabled/ OFF state. If not then it maybe in some unclean state
<dhruvag2000>
> I will try to find a way to test it without the hub
<dhruvag2000>
Quick hack maybe to just hack the drivers/usb/dwc3/dwc3-am62.c driver to disable device wakeup stuff, but I am no USB expert so I can't comment more on what exactly needs to be done to achieve wakeup disable.
<wadim_>
Uh, interesting the k3conf device dump returns DEVICE_STATE_ON even after disabling USB1 via device tree