HWIRQ: 47 waking up WP76

Hi,
since the evaluation in WP76xx not waking up from SPM on GPIO - #16 by simon.naegele, which is now working smoothly, we are going on and found that hwirq: 47 is waking up the module sometimes:

Feb  6 07:00:42 swi-mdm9x28-wp user.debug kernel: [  633.211913] PM: Entering mem sleep
Feb  6 07:00:42 swi-mdm9x28-wp user.warn kernel: [  633.211953] Suspending console(s) (use no_console_suspend to debug)
Feb  6 07:00:42 swi-mdm9x28-wp user.info kernel: [  633.266344] PM: suspend of devices complete after 52.169 msecs
Feb  6 07:00:42 swi-mdm9x28-wp user.info kernel: [  633.268815] PM: late suspend of devices complete after 2.422 msecs
Feb  6 07:00:42 swi-mdm9x28-wp user.info kernel: [  633.271527] PM: noirq suspend of devices complete after 2.665 msecs
Feb  6 07:00:42 swi-mdm9x28-wp user.info kernel: [  633.271556] msm_mpm_interrupts_detectable(): gpio preventing system sleep modes during suspend
Feb  6 07:00:42 swi-mdm9x28-wp user.info kernel: [  633.271569]         hwirq: 47
Feb  6 07:00:42 swi-mdm9x28-wp user.info kernel: [  633.271618] suspend ns:     633271599094    suspend cycles:    3101531768376
Feb  6 07:00:42 swi-mdm9x28-wp user.info kernel: [  633.271599] msm_mpm_interrupts_detectable(): gpio preventing system sleep modes during suspend
Feb  6 07:00:42 swi-mdm9x28-wp user.info kernel: [  633.271599]         hwirq: 47
Feb  6 07:00:42 swi-mdm9x28-wp user.info kernel: [  633.271599] CPU0:msm_cpu_pm_enter_sleep mode:3 during suspend
Feb  6 07:00:42 swi-mdm9x28-wp user.info kernel: [  633.271599] resume cycles:    3102101630546
Feb  6 07:00:42 swi-mdm9x28-wp user.info kernel: [  633.273902] PM: noirq resume of devices complete after 1.770 msecs
Feb  6 07:00:42 swi-mdm9x28-wp user.info kernel: [  633.274565] sierra_rtc_wake
Feb  6 07:00:42 swi-mdm9x28-wp user.info kernel: [  633.274574] sierra_rtc_wake: sierra_rtc_wake
Feb  6 07:00:42 swi-mdm9x28-wp user.info kernel: [  633.276535] PM: early resume of devices complete after 1.333 msecs
Feb  6 07:00:42 swi-mdm9x28-wp user.info kernel: [  633.300531] PM: resume of devices complete after 23.925 msecs
Feb  6 07:00:42 swi-mdm9x28-wp user.debug kernel: [  633.302328] PM: Finishing wakeup.
Feb  6 07:00:42 swi-mdm9x28-wp user.warn kernel: [  633.302354] Restarting tasks ... done.
Feb  6 07:00:42 swi-mdm9x28-wp user.info kernel: [  633.329669] sierra_pm_resume
Feb  6 07:01:13 swi-mdm9x28-wp user.info kernel: [  633.340769] PM: suspend exit 2023-02-06 07:00:42.998744035 UTC
Feb  6 07:01:13 swi-mdm9x28-wp user.info kernel: [  633.340842] PM: suspend entry 2023-02-06 07:00:42.998856848 UTC

We searched for the IRQ in the device tree and code, but we couldn’t find which GPIO this is.
Is it even a GPIO?
Is this the RTC?
Is this expected behaviour?

Any insights would be helpfull.

Thanks,
Simon

does this help?

root@swi-mdm9x28-wp:~# cat /proc/interrupts
           CPU0
 16:       5909       GIC  38  arch_mem_timer
 17:          3       GIC  59  smp2p
 19:          0       GIC 114  nidnt_nidnt
 20:         42       GIC 203  601d0.qcom,mpm
 21:          0       GIC  35  apps_wdog_bark
 25:        233       GIC 130  i2c-msm-v2-irq
 26:       1058       GIC 166  msm_otg, msm_hsusb
 27:          0       GIC 172  msm_otg
 28:         69       GIC 173  ehci_hcd:usb1
 29:          0       GIC 174  msm_hsic_async
 30:          0       GIC 164  sps
 31:          0       GIC 216  tsens_interrupt
 32:          4       GIC  61  sps
 33:          0       GIC 222  200f000.qcom,spmi
 34:          0  qpnp-int  66  qpnp_cblpwr_status
 35:          0  qpnp-int 777  qpnp_rtc_alarm
 38:          0  qpnp-int 419  qpnp_adc_tm_high_interrupt
 39:          0  qpnp-int 420  qpnp_adc_tm_low_interrupt
 41:          0       GIC  56  modem
 42:        520       GIC 157  mmc0
 43:         80       GIC 253  7864900.sdhci
 44:          0       GIC 239  sps
 47:         16       GIC  52  cpr
 48:        663       GIC 139  msm_serial_hsl1
 51:          0  qpnp-int 1544  vbus_det_irq
 78:          3   msmgpio  26  wake-n_gpio26
105:          0   msmgpio  53  soc:pps.-1
132:        549       GIC  57  qcom,smd-modem
133:         10       GIC  58  qcom,smsm-modem
134:       1640       GIC 200  qcom,smd-rpm
201:          0  qpnp-int 1280  msm_otg
203:          0  smp2p_gpio   0  modem
204:          1  smp2p_gpio   1  error_ready_interrupt
205:          1  smp2p_gpio   2  modem
206:          0  smp2p_gpio   3  modem
Err:          0

So is it the first or the second column?
In my case it would also be 47: 25 GIC 52 cpr, but what does cpr mean?

maybe related to this :
https://www.kernel.org/doc/Documentation/devicetree/bindings/power/avs/qcom%2Ccpr.yaml

looks like a bigger thing to investigate :frowning:
thanks!

first column seems to be the softirq
maybe this column is the hwirq

image

now it appeared in the list! before it wasn’t there!

 57:         10   msmgpio   5  msm_hs_wakeup
 78:          3   msmgpio  26  wake-n_gpio26
 99:          0   msmgpio  47  gpiolib
105:          0   msmgpio  53  soc:pps.-1

ok, some sort of gpio is the problem.
gpiolib so this should be a sysfs GPIO, right?

didn’t you already prove this here?

I found it. On our software this is GPIO30, which is configured to be an interrupt.
If I don’t export it, it’s not in the list in /proc/interrupts/.
We’ll check with the hardware what’s going on during sleep.

The GPIOs in the other thread are not a problem, because they are all set to a specific level in hardware.

Thanks!