This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AM625: GPIO interrupts stop working after deepsleep resume

Part Number: AM625
Other Parts Discussed in Thread: SK-AM62B-P1, SK-AM62

Hi TI Experts,

We have a custom HW based on AM62 SOCs. We are trying to integrate suspend-to-ram/deep-sleep functionality on our HW.

It seems that GPIO interrupt functionality stops working once system resumes from deepsleep on AM62.

'cat /proc/interrupts' count for GPIO irqs are not getting updated upon actual HW events. 'evtests' fails detecting input events after resume too. (The same GPIO interrupts works fine before deepsleep entry)

I suspect that breakage of this GPIO interrupt functionality is the main root cause of the Ethernet PHY not resuming properly with an interrupt mode as discussed here.

Please have a look at '364:        256      GPIO  32 Edge    -davinci_gpio  Wake-Up' line for the exact issue.

root@verdin-am62-15136141:~# cat /proc/interrupts | grep GPIO
357:          2      GPIO  25 Edge    -davinci_gpio  8000f00.mdio:00
364:        101      GPIO  32 Edge    -davinci_gpio  Wake-Up
445:          0      GPIO  17 Edge    -davinci_gpio  HPD
447:          0      GPIO  19 Edge    -davinci_gpio  extcon-usb0
root@verdin-am62-15136141:~# cat /proc/interrupts | grep GPIO
357:          2      GPIO  25 Edge    -davinci_gpio  8000f00.mdio:00
364:        122      GPIO  32 Edge    -davinci_gpio  Wake-Up
445:          0      GPIO  17 Edge    -davinci_gpio  HPD
447:          0      GPIO  19 Edge    -davinci_gpio  extcon-usb0
root@verdin-am62-15136141:~# ev
eval    evtest  
root@verdin-am62-15136141:~# evtest 
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      tps65219-pwrbutton
/dev/input/event1:      gpio-keys
/dev/input/event2:      Logitech G300s Optical Gaming Mouse
/dev/input/event3:      Logitech G300s Optical Gaming Mouse Keyboard
/dev/input/event4:      Logitech G300s Optical Gaming Mouse
Select the device event number [0-4]: 1
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "gpio-keys"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 143 (KEY_WAKEUP)
Properties:
Testing ... (interrupt to exit)
Event: time 1706800933.815546, type 1 (EV_KEY), code 143 (KEY_WAKEUP), value 0
Event: time 1706800933.815546, -------------- SYN_REPORT ------------
Event: time 1706800935.293734, type 1 (EV_KEY), code 143 (KEY_WAKEUP), value 1
Event: time 1706800935.293734, -------------- SYN_REPORT ------------
Event: time 1706800936.115144, type 1 (EV_KEY), code 143 (KEY_WAKEUP), value 0
Event: time 1706800936.115144, -------------- SYN_REPORT ------------
Event: time 1706800936.865577, type 1 (EV_KEY), code 143 (KEY_WAKEUP), value 1
Event: time 1706800936.865577, -------------- SYN_REPORT ------------
Event: time 1706800938.004802, type 1 (EV_KEY), code 143 (KEY_WAKEUP), value 0
Event: time 1706800938.004802, -------------- SYN_REPORT ------------
Event: time 1706800938.767227, type 1 (EV_KEY), code 143 (KEY_WAKEUP), value 1
Event: time 1706800938.767227, -------------- SYN_REPORT ------------
Event: time 1706800939.416789, type 1 (EV_KEY), code 143 (KEY_WAKEUP), value 0
Event: time 1706800939.416789, -------------- SYN_REPORT ------------
Event: time 1706800940.345778, type 1 (EV_KEY), code 143 (KEY_WAKEUP), value 1
Event: time 1706800940.345778, -------------- SYN_REPORT ------------
Event: time 1706800941.133675, type 1 (EV_KEY), code 143 (KEY_WAKEUP), value 0
Event: time 1706800941.133675, -------------- SYN_REPORT ------------
Event: time 1706800941.985323, type 1 (EV_KEY), code 143 (KEY_WAKEUP), value 1
Event: time 1706800941.985323, -------------- SYN_REPORT ------------
Event: time 1706800942.999731, type 1 (EV_KEY), code 143 (KEY_WAKEUP), value 0
Event: time 1706800942.999731, -------------- SYN_REPORT ------------
Event: time 1706800943.909666, type 1 (EV_KEY), code 143 (KEY_WAKEUP), value 1
Event: time 1706800943.909666, -------------- SYN_REPORT ------------
Event: time 1706800944.730682, type 1 (EV_KEY), code 143 (KEY_WAKEUP), value 0
Event: time 1706800944.730682, -------------- SYN_REPORT ------------
Event: time 1706800945.685882, type 1 (EV_KEY), code 143 (KEY_WAKEUP), value 1

root@verdin-am62-15136141:~# rtcwake -s 10 -m mem -d rtc1                                                                                                                                                                                                                                                                                                                              
rtcwake: assuming RTC uses UTC ...
rtcwake: wakeup from "mem" using rtc1 at Thu Jan  1 00:02:05 1970
[  107.905705] PM: suspend entry (deep)
[  107.910853] Filesystems sync: 0.001 seconds
[  107.922678] Freezing user space processes
[  107.930158] Freezing user space processes completed (elapsed 0.003 seconds)
[  107.937431] OOM killer disabled.
[  107.940661] Freezing remaining freezable tasks
[  107.946643] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
[  107.954114] printk: Suspending console(s) (use no_console_suspend to debug)
[  108.021094] tc358768 0-000e: Software disable failed: -121
[  108.053438] am65-cpsw-nuss 8000000.ethernet eth0: Link is Down
[  108.056896] omap8250 2810000.serial: PM domain pd:152 will not be powered off
[  108.068964] Disabling non-boot CPUs ...
[  108.070388] ti-sci 44043000.system-controller: ti_sci_resume: setting EXT_REFCLK1 at 25MHz success : 0
[  108.070463] ti-sci 44043000.system-controller: ti_sci_resume: wakeup source: 0x50
[  108.084779] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 19
[  108.105533] am65-cpsw-nuss 8000000.ethernet eth0: PHY [8000f00.mdio:00] driver [TI DP83867] (irq=357)
[  108.106120] am65-cpsw-nuss 8000000.ethernet eth0: configuring for phy/rgmii-rxid link mode
[  108.331965] tc358768 0-000e: Software reset failed: -121
[  108.332105] tc358768 0-000e: Bridge is not enabled
[  108.455849] OOM killer enabled.
[  108.459042] Restarting tasks ... done.
[  108.538455] random: crng reseeded on system resumption
[  108.576035] PM: suspend exit
root@verdin-am62-15136141:~# [  109.140849] VFS: busy inodes on changed media sda
[  109.182735]  sda:
   
root@verdin-am62-15136141:~# cat /proc/interrupts | grep GPIO
357:          3      GPIO  25 Edge    -davinci_gpio  8000f00.mdio:00
364:        256      GPIO  32 Edge    -davinci_gpio  Wake-Up
445:          0      GPIO  17 Edge    -davinci_gpio  HPD
447:          0      GPIO  19 Edge    -davinci_gpio  extcon-usb0
root@verdin-am62-15136141:~# cat /proc/interrupts | grep GPIO
357:          3      GPIO  25 Edge    -davinci_gpio  8000f00.mdio:00
364:        256      GPIO  32 Edge    -davinci_gpio  Wake-Up
445:          0      GPIO  17 Edge    -davinci_gpio  HPD
447:          0      GPIO  19 Edge    -davinci_gpio  extcon-usb0
root@verdin-am62-15136141:~# evtest 
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0:      tps65219-pwrbutton
/dev/input/event1:      gpio-keys
/dev/input/event2:      Logitech G300s Optical Gaming Mouse
/dev/input/event3:      Logitech G300s Optical Gaming Mouse Keyboard
/dev/input/event4:      Logitech G300s Optical Gaming Mouse
Select the device event number [0-4]: 1
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x1 product 0x1 version 0x100
Input device name: "gpio-keys"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 143 (KEY_WAKEUP)
Properties:
Testing ... (interrupt to exit)
^Croot@verdin-am62-15136141:~# 

Full logs: /cfs-file/__key/communityserver-discussions-components-files/791/AM62_5F00_GPIO_5F00_ITR_5F00_Could_5F00_Not_5F00_Work_5F00_After_5F00_Resume_5F00_Console_5F00_Logs.txt

SW details:

I tested this on SK-AM62B-P1 boards and there also I see the same issue of GPIO interrupt count not getting increased after resume from deepsleep.

Questions :

  1. Is GPIO interrupt functionality tested and working with a latest SDK with deepsleep feature on AM62 ?
  2. What could be the possible solution/workaround for this issue ?

Looking forward for support. Thank you.

Regards,

Parth P

  • Hi Parth,

    I checked around internally, GPIO interrupt after resume doesn't seem to be validated.

    I will try to reproduce the issue on SK-AM62, then work with the dev team to understand the root cause.

  • Hi Parth,

    Our sw dev team is able to reproduce the issue on EVM, and is looking into it.

    Meanwhile, does your board have access to any MCU GPIO pin which can used as the alternative? The MCU GPIO pin doesn't have such issue.

  • Hi Parth,

    To debug this GPIO interrupt issue, can you please read a group of registers before and after the very first iteration of suspend/resume?

    See the AM62x TRM (revB) page 10897, which describes register INTR_CFG_MUXCNTL_N from address 0x00a00004. Please read total 22 registers from address 0x00a00004 with increment of 4. We suspect the issue is because of context loss in these registers.

  • Hi Bin,

    Thank you for confirming the issue and it's reproducibility at your end. We need to have this GPIO interrupt functionality working considering our HW design.

    I tried to read suggested registers INTR_CFG_MUXCNTL_N from address 0x00a00004 with offset 0x04 and I see that these register context is being lost after resume from deeplseep.

    Please see snippet below.

    root@verdin-am62-15136141:~# ./Read_AM62_INTR_CFG_MUXCNTL_N_regs.sh 
    ### Reading Reg 0xa00004
    /dev/mem opened.
    Memory mapped at address 0xffffa3a5e000.
    Read at address  0x00A00004 (0xffffa3a5e004): 0x000100BE
    ### Reading Reg 0xa00008
    /dev/mem opened.
    Memory mapped at address 0xffffa620d000.
    Read at address  0x00A00008 (0xffffa620d008): 0x000100BF
    ### Reading Reg 0xa0000c
    /dev/mem opened.
    Memory mapped at address 0xffff93378000.
    Read at address  0x00A0000C (0xffff9337800c): 0x000100C0
    ### Reading Reg 0xa00010
    /dev/mem opened.
    Memory mapped at address 0xffffb77b0000.
    Read at address  0x00A00010 (0xffffb77b0010): 0x000100C1
    ### Reading Reg 0xa00014
    /dev/mem opened.
    Memory mapped at address 0xffff94da5000.
    Read at address  0x00A00014 (0xffff94da5014): 0x000100C2
    ### Reading Reg 0xa00018
    /dev/mem opened.
    Memory mapped at address 0xffff82bab000.
    Read at address  0x00A00018 (0xffff82bab018): 0x000100C3
    ### Reading Reg 0xa0001c
    /dev/mem opened.
    Memory mapped at address 0xffffb29b0000.
    Read at address  0x00A0001C (0xffffb29b001c): 0x000100B4
    ### Reading Reg 0xa00020
    /dev/mem opened.
    Memory mapped at address 0xffff98ace000.
    Read at address  0x00A00020 (0xffff98ace020): 0x000100B5
    ### Reading Reg 0xa00024
    /dev/mem opened.
    Memory mapped at address 0xffffb4621000.
    Read at address  0x00A00024 (0xffffb4621024): 0x000100B6
    ### Reading Reg 0xa00028
    /dev/mem opened.
    Memory mapped at address 0xffffb31c4000.
    Read at address  0x00A00028 (0xffffb31c4028): 0x000100B7
    ### Reading Reg 0xa0002c
    /dev/mem opened.
    Memory mapped at address 0xffffb0743000.
    Read at address  0x00A0002C (0xffffb074302c): 0x00000000
    ### Reading Reg 0xa00030
    /dev/mem opened.
    Memory mapped at address 0xffff878cc000.
    Read at address  0x00A00030 (0xffff878cc030): 0x00000000
    ### Reading Reg 0xa00034
    /dev/mem opened.
    Memory mapped at address 0xffffbafbc000.
    Read at address  0x00A00034 (0xffffbafbc034): 0x00000000
    ### Reading Reg 0xa00038
    /dev/mem opened.
    Memory mapped at address 0xffff85ad8000.
    Read at address  0x00A00038 (0xffff85ad8038): 0x00000000
    ### Reading Reg 0xa0003c
    /dev/mem opened.
    Memory mapped at address 0xffffbd4e6000.
    Read at address  0x00A0003C (0xffffbd4e603c): 0x00000000
    ### Reading Reg 0xa00040
    /dev/mem opened.
    Memory mapped at address 0xffff9882c000.
    Read at address  0x00A00040 (0xffff9882c040): 0x00000000
    ### Reading Reg 0xa00044
    /dev/mem opened.
    Memory mapped at address 0xffff861ad000.
    Read at address  0x00A00044 (0xffff861ad044): 0x00000000
    ### Reading Reg 0xa00048
    /dev/mem opened.
    Memory mapped at address 0xffffa1495000.
    Read at address  0x00A00048 (0xffffa1495048): 0x00000000
    ### Reading Reg 0xa0004c
    /dev/mem opened.
    Memory mapped at address 0xffffbc34c000.
    Read at address  0x00A0004C (0xffffbc34c04c): 0x00000000
    ### Reading Reg 0xa00050
    /dev/mem opened.
    Memory mapped at address 0xffff855ab000.
    Read at address  0x00A00050 (0xffff855ab050): 0x00000000
    ### Reading Reg 0xa00054
    /dev/mem opened.
    Memory mapped at address 0xffffb0f9b000.
    Read at address  0x00A00054 (0xffffb0f9b054): 0x00000000
    ### Reading Reg 0xa00058
    /dev/mem opened.
    Memory mapped at address 0xffffab959000.
    Read at address  0x00A00058 (0xffffab959058): 0x00000000
    ### Reading Reg 0xa0005c
    /dev/mem opened.
    Memory mapped at address 0xffffba6a9000.
    Read at address  0x00A0005C (0xffffba6a905c): 0x00000000
    root@verdin-am62-15136141:~# rtcwake -s 10 -m mem -d rtc1                                                                                                                                                                                                                                                                                                   
    rtcwake: assuming RTC uses UTC ...
    rtcwake: wakeup from "mem" using rtc1 at Thu Jan  1 00:03:30 1970
    [  193.292216] PM: suspend entry (deep)
    [  193.304414] Filesystems sync: 0.002 seconds
    [  193.319516] Freezing user space processes
    [  193.332535] Freezing user space processes completed (elapsed 0.002 seconds)
    [  193.339707] OOM killer disabled.
    [  193.342980] Freezing remaining freezable tasks
    [  193.348817] Freezing remaining freezable tasks completed (elapsed 0.001 seconds)
    [  193.356271] printk: Suspending console(s) (use no_console_suspend to debug)
    [  193.421654] tc358768 0-000e: Software disable failed: -121
    [  193.474324] am65-cpsw-nuss 8000000.ethernet eth0: Link is Down
    [  193.475013] am65-cpsw-nuss 8000000.ethernet eth1: Link is Down
    [  193.479324] omap8250 2810000.serial: PM domain pd:152 will not be powered off
    [  193.491566] Disabling non-boot CPUs ...
    [  193.492881] ti-sci 44043000.system-controller: ti_sci_resume: wakeup source: 0x50
    [  193.507377] am65-cpsw-nuss 8000000.ethernet: set new flow-id-base 19
    [  193.523840] am65-cpsw-nuss 8000000.ethernet eth0: PHY [8000f00.mdio:00] driver [TI DP83867] (irq=357)
    [  193.529960] am65-cpsw-nuss 8000000.ethernet eth0: configuring for phy/rgmii-rxid link mode
    [  193.537075] am65-cpsw-nuss 8000000.ethernet eth1: PHY [8000f00.mdio:07] driver [Microchip KSZ9131 Gigabit PHY] (irq=370)
    [  193.542032] am65-cpsw-nuss 8000000.ethernet eth1: configuring for phy/rgmii-rxid link mode
    [  193.773077] tc358768 0-000e: Software reset failed: -121
    [  193.773208] tc358768 0-000e: Bridge is not enabled
    [  193.912460] OOM killer enabled.
    [  193.915612] Restarting tasks ... done.
    [  193.990753] random: crng reseeded on system resumption
    [  194.029864] PM: suspend exit
    root@verdin-am62-15136141:~# [  195.310017] VFS: busy inodes on changed media sda
    [  195.351819]  sda:
    
    root@verdin-am62-15136141:~# 
    root@verdin-am62-15136141:~# ./Read_AM62_INTR_CFG_MUXCNTL_N_regs.sh 
    ### Reading Reg 0xa00004
    /dev/mem opened.
    Memory mapped at address 0xffff93889000.
    Read at address  0x00A00004 (0xffff93889004): 0x00000000
    ### Reading Reg 0xa00008
    /dev/mem opened.
    Memory mapped at address 0xffff84318000.
    Read at address  0x00A00008 (0xffff84318008): 0x00000000
    ### Reading Reg 0xa0000c
    /dev/mem opened.
    Memory mapped at address 0xffffabfb6000.
    Read at address  0x00A0000C (0xffffabfb600c): 0x00000000
    ### Reading Reg 0xa00010
    /dev/mem opened.
    Memory mapped at address 0xffffa057f000.
    Read at address  0x00A00010 (0xffffa057f010): 0x00000000
    ### Reading Reg 0xa00014
    /dev/mem opened.
    Memory mapped at address 0xffff84f5b000.
    Read at address  0x00A00014 (0xffff84f5b014): 0x00000000
    ### Reading Reg 0xa00018
    /dev/mem opened.
    Memory mapped at address 0xffffa369c000.
    Read at address  0x00A00018 (0xffffa369c018): 0x00000000
    ### Reading Reg 0xa0001c
    /dev/mem opened.
    Memory mapped at address 0xffff851e0000.
    Read at address  0x00A0001C (0xffff851e001c): 0x00000000
    ### Reading Reg 0xa00020
    /dev/mem opened.
    Memory mapped at address 0xffffa1de2000.
    Read at address  0x00A00020 (0xffffa1de2020): 0x00000000
    ### Reading Reg 0xa00024
    /dev/mem opened.
    Memory mapped at address 0xffff89aef000.
    Read at address  0x00A00024 (0xffff89aef024): 0x00000000
    ### Reading Reg 0xa00028
    /dev/mem opened.
    Memory mapped at address 0xffffbd35f000.
    Read at address  0x00A00028 (0xffffbd35f028): 0x00000000
    ### Reading Reg 0xa0002c
    /dev/mem opened.
    Memory mapped at address 0xffffa0198000.
    Read at address  0x00A0002C (0xffffa019802c): 0x00000000
    ### Reading Reg 0xa00030
    /dev/mem opened.
    Memory mapped at address 0xffff950de000.
    Read at address  0x00A00030 (0xffff950de030): 0x00000000
    ### Reading Reg 0xa00034
    /dev/mem opened.
    Memory mapped at address 0xffffab228000.
    Read at address  0x00A00034 (0xffffab228034): 0x00000000
    ### Reading Reg 0xa00038
    /dev/mem opened.
    Memory mapped at address 0xffff88cb0000.
    Read at address  0x00A00038 (0xffff88cb0038): 0x00000000
    ### Reading Reg 0xa0003c
    /dev/mem opened.
    Memory mapped at address 0xffffbb959000.
    Read at address  0x00A0003C (0xffffbb95903c): 0x00000000
    ### Reading Reg 0xa00040
    /dev/mem opened.
    Memory mapped at address 0xffffaaf0b000.
    Read at address  0x00A00040 (0xffffaaf0b040): 0x00000000
    ### Reading Reg 0xa00044
    /dev/mem opened.
    Memory mapped at address 0xffffb7380000.
    Read at address  0x00A00044 (0xffffb7380044): 0x00000000
    ### Reading Reg 0xa00048
    /dev/mem opened.
    Memory mapped at address 0xffff922d0000.
    Read at address  0x00A00048 (0xffff922d0048): 0x00000000
    ### Reading Reg 0xa0004c
    /dev/mem opened.
    Memory mapped at address 0xffff8744e000.
    Read at address  0x00A0004C (0xffff8744e04c): 0x00000000
    ### Reading Reg 0xa00050
    /dev/mem opened.
    Memory mapped at address 0xffffaadf6000.
    Read at address  0x00A00050 (0xffffaadf6050): 0x00000000
    ### Reading Reg 0xa00054
    /dev/mem opened.
    Memory mapped at address 0xffffb675b000.
    Read at address  0x00A00054 (0xffffb675b054): 0x00000000
    ### Reading Reg 0xa00058
    /dev/mem opened.
    Memory mapped at address 0xffffac258000.
    Read at address  0x00A00058 (0xffffac258058): 0x00000000
    ### Reading Reg 0xa0005c
    /dev/mem opened.
    Memory mapped at address 0xffff87349000.
    Read at address  0x00A0005C (0xffff8734905c): 0x00000000
    root@verdin-am62-15136141:~# 

    As this issue is easily reproducible with SDK and SK boards, I expect quick workaround/solution for the same. In addition, this GPIO interrupt is a very basic system function which has to be working always throughout the system up time with or without deep-sleep. Hope you understand the severity of the issue here.

    The breakage of such a basic functionality would also results in our other HW peripherals not working post resume such as display and touch screen.

    Thank you.

    Regards,

    Parth P

  • Hi Parth,

    The official fix would take a while, the dev team has to make a strategic decision that the context backup/restore should be done in SYSFW or kernel. But I can provide a kernel patch to solve the issue to unblock you in the near term. I should be able to provide the patch by mid next week if not earlier.

  • Hi Bin,

    Thank you for response. Yes, that completely makes sense.

    If a kernel patch would be able to solve the issue for time-being until the proper fix, it should work for me.

    Regards,

    Parth P

  • Hi Parth,

    Fortunately I have some time today to get the fix implemented. Please apply the following kernel patch and let me know if it solves the GPIO interrupt issue. It is a hack but it should unblock your project.

    diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
    index a58d25724365..56b863f5eec1 100644
    --- a/drivers/firmware/ti_sci.c
    +++ b/drivers/firmware/ti_sci.c
    @@ -33,6 +33,9 @@
     
     #define AM62X_DEV_MCU_M4FSS0_CORE0_DEV_ID 9
     
    +#define NR_GPIO_CTX 10
    +#define GPIO_CTX_BASE 0x00a00004
    +
     /* List of all TI SCI devices active in system */
     static LIST_HEAD(ti_sci_list);
     /* Protection for the entire list */
    @@ -132,6 +135,8 @@ struct ti_sci_info {
     
     	int nr_wakeup_sources;
     	struct device_node **wakeup_source_nodes;
    +
    +	u8 gpio_ctx[NR_GPIO_CTX];
     };
     
     #define cl_to_ti_sci_info(c)	container_of(c, struct ti_sci_info, cl)
    @@ -3590,11 +3595,39 @@ static int ti_sci_prepare_system_suspend(struct ti_sci_info *info)
     #endif
     }
     
    +static void ti_sci_save_gpio_ctx(struct ti_sci_info *info)
    +{
    +	void *va;
    +	int i;
    +
    +	va = ioremap(GPIO_CTX_BASE, 4 * NR_GPIO_CTX);
    +	if (IS_ERR(va))
    +		return;
    +	for (i = 0; i < NR_GPIO_CTX; i++)
    +		info->gpio_ctx[i] = readl_relaxed(va + i * 4) & 0xff;
    +	iounmap(va);
    +}
    +
    +static void ti_sci_restore_gpio_ctx(struct ti_sci_info *info)
    +{
    +	int ret, i;
    +
    +	if (!info->gpio_ctx[0])
    +		return;
    +	for (i = 0; i < NR_GPIO_CTX; i++) {
    +		ret = ti_sci_cmd_set_irq(&info->handle, 3, info->gpio_ctx[i], 3, i);
    +		if (ret)
    +			return;
    +	}
    +}
    +
     static int ti_sci_suspend(struct device *dev)
     {
     	struct ti_sci_info *info = dev_get_drvdata(dev);
     	int ret;
     
    +	ti_sci_save_gpio_ctx(info);
    +
     	ret = ti_sci_cmd_set_io_isolation(&info->handle, TISCI_MSG_VALUE_IO_ENABLE);
     	if (ret)
     		return ret;
    @@ -3622,6 +3655,8 @@ static int ti_sci_resume(struct device *dev)
     	ti_sci_msg_cmd_lpm_wake_reason(&info->handle, &source, &time);
     	dev_info(dev, "%s: wakeup source: 0x%X\n", __func__, source);
     
    +	ti_sci_restore_gpio_ctx(info);
    +
     	return 0;
     }
     
    

  • Hi Bin,

    Thank you for the update and quick workaround for the issue here.

    With the above changes in ti_sci kernel driver, GPIO interrupt functionality works fine after resume from deepsleep for me.

    Regards,

    Parth P

  • Hi Parth,

    Glad the issue is resolved. Thanks for the update.

    Please update on your another e2e thread that Ethernet PHY doesn't bring up the link after resume, does this GPIO fix resolve that issue too? I am not an Ethernet expert, but I am curious if these two issues are related or not.

  • Hi Bin,

    The issue related to Ethernet PHY is solved partially with this change related to GPIO interrupt.

    If I do not reset the Ethernet PHY from HW side during deepsleep mode, PHY functionality works fine post resume with interrupt mode enabled, which was broken before due to this GPIO interrupt not working. Whereas, with PHY HW reset enabled during deepsleep mode, PHY can not resume and still there is something to debug.

    Having said that, It seems like we have some working solution around this Ethernet PHY issue now. I will update the related e2e accordingly.

    Appreciate your support.

    Regards,

    Parth P

  • Hi Parth,

    great! Thanks for the update.