After waking up the system, the gpio status changed

My system is jp5.1.2, using a custom board, and we use the gpio-331 (PCC.03). It was originally used in the mux sel of the default camera, and our custom board uses it as a normal gpio (the original gpio configuration has been deleted in the device tree). By default, the gpio works normally, but when it enters the suspend state and wakes up, the state of the io will become low. I want to know if there is any program controlling its state?

my operation cmd:

#export the gpio

root@zme:/sys/class/gpio# echo 331 > export 
root@zme:/sys/class/gpio# cd PCC.03
root@zme:/sys/class/gpio/PCC.03# cat direction 
out
root@zme:/sys/class/gpio/PCC.03# cat value 
1

#suspend and wakeup use ethernet

root@zme:/sys/class/gpio/PCC.03# systemctl suspend
root@zme:/sys/class/gpio/PCC.03# ����
                                     ��[   108.269088] Camera-FW on t234-rce-safe started
TCU early console enabled.
��
  ��I/TC: Secondary CPU 1 initializing
I/TC: Secondary CPU 1 switching to normal world boot
I/TC: Secondary CPU 2 initializing
I/TC: Secondary CPU 2 switching to normal world boot
��r�� Second��DCE��a��: FW Boot Done
     ��y CPU 3 initializing
I/TC: Secondary CPU 3 switching to normal world boot
I/TC: Secondary CPU 8 initializing
I/TC: Secondary CPU 8 switching to normal world boot
I/TC: Secondary CPU 9 initializing
I/TC: Secondary CPU 9 switching to normal world boot
I/TC: Secondary CPU 10 initializ��[   108.478270] Ca��in��mera-FW on t234-rce-safe ready SHA1=8676d22a (crt 2.918 ms, total boot 212.305 ms)
��g
I/TC: Secondary CPU 10 switching to normal world boot
I/TC: Secondary CPU 11 initializing
I/TC: Secondary CPU 11 switching to normal world boot
��[   88.116994] CPU:0, Error: dce-fabric@0xde00000, irq=28
[   88.116996] **************************************
[   88.116998] CPU:0, Error:dce-fabric, Errmon:4
[   88.117004]    Error Code            : SLAVE_ERR
[   88.117005]    Overflow              : Multiple SLAVE_ERR
[   88.117013] 
[   88.117014]    Error Code            : SLAVE_ERR
[   88.117015]    MASTER_ID             : DCE
[   88.117015]    Address               : 0xdc9ed80
[   88.117017]    Cache                 : 0x3 -- Bufferable Modifiable 
[   88.117018]    Protection            : 0x2 -- Unprivileged, Non-Secure, Data Access
[   88.117019]    Access_Type           : Read
[   88.117020]    Access_ID             : 0x0
[   88.117020]    Fabric                : dce-fabric
[   88.117021]    Slave_Id              : 0x5
[   88.117022]    Burst_length          : 0x7
[   88.117022]    Burst_type            : 0x1
[   88.117023]    Beat_size             : 0x3
[   88.117024]    VQC                   : 0x0
[   88.117024]    GRPSEC                : 0x3f
[   88.117025]    FALCONSEC             : 0x0
[   88.117027]  **************************************
[   88.273987] CPU1: shutdown
[   88.276584] CPU2: shutdown
[   88.278861] CPU3: shutdown
[   88.281075] CPU4: shutdown
[   88.283091] CPU5: shutdown
[   88.285196] CPU6: shutdown
[   88.287769] IRQ 117: no longer affine to CPU7
[   88.288094] CPU7: shutdown
[   89.173465] PM: dpm_run_callback(): platform_pm_resume+0x0/0x80 returns -110
[   89.173468] PM: Device 3ae0000.nvrng failed to resume: error -110

# gpio status has been changed.

root@zme:/sys/class/gpio/PCC.03# cat value 
0
root@zme:/sys/class/gpio/PCC.03# 

I did not execute any program to control gpio before waking up from sleep mode. All the settings for this gpio are only this device tree.

	gpio@c2f0000 {
		pice2usb-power {
			gpio-hog;
			output-high;
			gpios = <TEGRA234_AON_GPIO(CC, 3) 0>;
			label = "pcie2usb-hub-pwr";
		};
	};

Hope to get your help, thanks.

Hi 1031150349,

How did you configure this pin in pinmux spreadsheet?
It seems you want to use this pin as Output.
What’s the default state you configured for PCC.03?

I am using the default gpio state, its value in the spreadsheet is as follows
image

Linux_for_Tegra/bootloader/t186ref/BCT/tegra234-mb1-bct-pinmux-p3767-dp-a03.dtsi

spi2_cs0_pcc3 {
	nvidia,pins = "spi2_cs0_pcc3";
	nvidia,function = "rsvd1";
	nvidia,pull = <TEGRA_PIN_PULL_NONE>;
	nvidia,tristate = <TEGRA_PIN_DISABLE>;
	nvidia,enable-input = <TEGRA_PIN_DISABLE>;
	nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
	nvidia,lpdr = <TEGRA_PIN_DISABLE>;
};

If I change the gpio setting to the following in the kernel stage, the io will still become low level after wakeup.

			spi2_cs0_pcc3 {
				nvidia,pins = "spi2_cs0_pcc3";
				nvidia,function = "rsvd1";
				nvidia,pull = <TEGRA_PIN_PULL_UP>;
				nvidia,tristate = <TEGRA_PIN_DISABLE>;
				nvidia,enable-input = <TEGRA_PIN_DISABLE>;
				// nvidia,io-high-voltage = <TEGRA_PIN_DISABLE>;
				// nvidia,lpdr = <TEGRA_PIN_DISABLE>;
			};

Can anyone help me?

Hi @1031150349

This is a known bug on rel-35.4.1.

This is fixed in rel-35.6.

1 Like

Do you mean that my gpio is the same as the gpio mentioned in this thread, and the gpio status is invalid after waking up?

It is not relating to specific gpio and the fix is included in the binary.
Could you simply update to the r35.6.0 to verify?

OK, thanks, I will start working on jp5.1.5 in the next two weeks, then I will verify this issue.

I have verified that in r35.6.1, the gpio status will not change after waking up, thanks