Shutdown takes a longer time

Hi, I have a TX2 module on my custom board. I flash the kernel and u-boot with version l4t-r32.4.3.

I use a startup and poweroff loop shell to test.
Sometimes, TX2 will take about 90s to shutdown (normal less than 10s).
This situation occurs after I installing Jetson SDK components into TX2.

What may be the reason cause this?

Hi,

Please connect serial console on your board and dump us the log during shutdown.

Thanks for replying.
I have disabled quite in /boot/extlinux/extlinux.conf.

And I only got this when shutdown (on serial console)

(Normal)
[ 24.460415] systemd-shutdow: 34 output lines suppressed due to ratelimiting
[ 24.692213] CPU3: shutdown
[ 24.748427] CPU4: shutdown
[ 24.792455] CPU5: shutdown
[ 24.799810] reboot: Power down

(Take longer time)
[ 109.431012] systemd-shutdow: 37 output lines suppressed due to ratelimiting
[ 109.639871] CPU3: shutdown
[ 109.683873] CPU4: shutdown
[ 109.723919] CPU5: shutdown
[ 109.731237] reboot: Power down

Hi tsungmin_wang,

From the UART log, it seems the elapsed time for shutdown are same.

How did you tell it takes more time to shutdown?

Hi, WayneWWW

Thanks for replying.

I use teraterm to make a startup and poweroff shell to record time.

I set /sys/class/rtc/rtc0/wakealarm to startup 30s later then poweroff.

If poweroff takes time more than 30s, it will not startup next time.

Here is my time log.


power_on_off_log_731.txt
=======================
Power on: 2020/07/24-06:08:02
Power off start. Time: 2020/07/24-06:08:53
Power off stop. Time: 2020/07/24-06:08:59
*****************************************************

power_on_off_log_732.txt
=======================
Power on: 2020/07/24-06:08:59
Power off start. Time: 2020/07/24-06:09:49
Power off stop. Time: 2020/07/24-06:09:55
*****************************************************

power_on_off_log_733.txt
=======================
Power on: 2020/07/24-06:09:55
Power off start. Time: 2020/07/24-06:10:45
Power off stop. Time: 2020/07/24-06:10:51
*****************************************************

power_on_off_log_734.txt
=======================
Power on: 2020/07/24-06:10:51
Power off start. Time: 2020/07/24-06:11:42
Power off stop. Time: 2020/07/24-06:11:48
*****************************************************

power_on_off_log_735.txt
=======================
Power on: 2020/07/24-06:11:48
Power off start. Time: 2020/07/24-06:12:39
Power off stop. Time: 2020/07/24-06:12:44
*****************************************************

power_on_off_log_736.txt
=======================
Power on: 2020/07/24-06:12:45
Power off start. Time: 2020/07/24-06:13:35
Power off stop. Time: 2020/07/24-06:15:07
*****************************************************

Normally, it just takes 5s~10s to poweroff, but sometimes, it needs about 90s to poweroff.

I have no ideal what cause this situation.

Hi,

Are you able to try same tool (teraterm) on nvidia devkit and see if you can still reproduce this issue?

Hi,
Unfortunately, the devkit that supplier provides is broken.
We don’t have the devkit to reproduce this issue.

Then could you share how you setup teraterm so that we can try it on our devkit?

Hi,

Thanks, I appreciate your help very much.
Here is the code, there are four lines need to be modified.

sendln ‘your_username
sendln ‘your_password
wait ‘[sudo] password for your_username:’
sendln ‘your_password

Use “Teraterm -> Control -> Macro” to load the code.

When you stay at line

your_username login:  

You may need to press “enter” to let the “Macro” to get the key word.

Then TeraTerm will start to loop the startup and poweroff shell.

changedir 'D:\tx2_power_on_off_log'

i=1
while i<2000

gettime time_power_on "%Y/%m/%d-%H:%M:%S"

sprintf2 msg 'loop %d' i
settitle msg
sprintf2 filename 'power_on_off_log_%d.txt' i
logopen filename 0 0

logwrite 'Power on: '
logwrite time_power_on
logwrite #13#10
logwrite '*****************************************************'#13#10

wait 'login:'
sendln 'your_username'
wait 'Password:'
sendln 'your_password'
wait '~$'
sendln 'sudo -s'
wait '[sudo] password for your_username:'
sendln 'your_password'
wait '~#'
pause 1
sendln 'echo 0 > /sys/class/rtc/rtc0/wakealarm'
wait '~#'
pause 1
sendln 'echo `expr $(date +%s) + 30` > /sys/class/rtc/rtc0/wakealarm'
wait '~#'
pause 1

sendln 'poweroff'
wait 'poweroff'

gettime time_power_off_start "%Y/%m/%d-%H:%M:%S"
logwrite '*****************************************************'#13#10
logwrite 'Power off start. Time: '
logwrite time_power_off_start
logwrite #13#10
logwrite '*****************************************************'#13#10

wait 'reboot: Power down'

gettime time_power_off_stop "%Y/%m/%d-%H:%M:%S"
logwrite '*****************************************************'#13#10
logwrite 'Power off stop. Time: '
logwrite time_power_off_stop
logwrite #13#10

logclose

i=i+1

sprintf2 AllTimeLog 'all_time_log.txt'
logopen AllTimeLog 0 1
logwrite #13#10
logwrite filename
logwrite #13#10
logwrite '======================='#13#10
logwrite 'Power on: '
logwrite time_power_on
logwrite #13#10
logwrite 'Power off start. Time: '
logwrite time_power_off_start
logwrite #13#10
logwrite 'Power off stop. Time: '
logwrite time_power_off_stop
logwrite #13#10
logwrite '*****************************************************'#13#10
logclose

endwhile

Not sure for your case, but I have also seen shutdown to take 90s with this message:

A stop job is running for Session c2 of user ... (1min 30s)

This might be the crash report system being uploading data, or something else.

You may try to edit (as root) file /etc/systemd/system.conf and set:

DefaultTimeoutStopSec=10s

That would be effective after a reboot. If you want it to be effective immediately, you can run

sudo systemctl daemon-reload

before shutting down.

1 Like

I am also wondering the case mentioned by @Honey_Patouceul.

@tsungmin_wang, do you connect a monitor when you tried this test?

Hi,
Our custom board doesn’t have any output interface (e.g. VGA, DVI, HDMI which we disabled in dts).

We only use serial console to test TX2, so we might not get the message.

I will try to use the setting by @Honey_Patouceul, and test for this issue.

Thanks for your replying.

Hi,
I have tested the TX2 with new setting for 1200 times, and it doesn’t take more than 90s.

Thanks for your help.

1 Like