Bug 13461

Summary: [2.8 M2 RC1] beaglebone can not poweroff when run "shutdown -h now"
Product: [Build System, Metadata & Runtime] BSPs Reporter: Yi Zhao <yi.zhao>
Component: bsps-meta-yoctoAssignee: Kevin Hao <kexin.hao>
Status: VERIFIED FIXED QA Contact:
Severity: normal    
Priority: High CC: ee.peng.yeoh, randy.macleod, yi.zhao
Version: 0.0.0   
Target Milestone: 2.8 M3   
Hardware: BeagleBone   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Yi Zhao 2019-07-30 08:29:47 UTC
Image location: https://autobuilder.yocto.io/pub/releases/yocto-2.8_M2.rc1/machines/beaglebone-yocto/

Git rev: master/835f7eac0610325e906591cd81890bebe8627580

Steps:
1. Download the wic image from the above site
2. dd the image to MircoSD card
3. Boot up the board
4. Run command "shutdown -h now"

After run command "shutdown -h now", all processes are stopped but at the end the board can not power off. The screen hangs on the splash image.
There is no such issue in previous build.

Here is the log:

root@beaglebone-yocto:~# shutdown -h now

The system is going down for system halt NOW!(ttyS0) (Tue Jul 30 08:24:08 201
INIT: Switching to runlevel: 0
INIT: Sending processes the TERM signal
root@beaglebone-yocto:~# Stopping OpenBSD Secure Shell server: sshdstopped /usr/sbin/sshd (pid 545)
.
[ ok ]pping Avahi mDNS/DNS-SD Daemon: avahi-daemon
Stopping atd: OK
Stopping bluetooth: bluetoothd.
Stopping system message bus: dbus.
Stopping syslogd/klogd: stopped syslogd (pid 578)
stopped klogd (pid 581)
done
Stopping tcf-agent: OK
Stopping XServer
xinit: connection to X server lost

waiting for X server to shut down dbus-daemon[669]: Reloaded configuration
(II) Server terminated successfully (0). Closing log file.

xinit: unexpected signal 15
Stopping Connection Manager
Stopping Telephony daemon
cpsw 4a100000.ethernet eth0: Link is Down
Stopping random number generator daemon.
ALSA: Storing mixer settings...
Failed to stop kdump!
Stopping crond: OK
Stopping rpcbind daemon...
done.
Stopping Linux NFC daemon
Deconfiguring network interfaces... done.
Sending all processes the TERM signal...
logout
Error VT_WAITACTIVE failed
: Interrupted system call
Sending all processes the KILL signal...
Unmounting remote filesystems...
Deactivating swap...
Unmounting local filesystems...
EXT4-fs (mmcblk0p2): re-mounted. Opts: (null)
Comment 1 yeoh ee peng 2019-08-01 00:27:10 UTC
Same issue happening on genericx86-64.

Image location: https://autobuilder.yocto.io/pub/releases/yocto-2.8_M2.rc1/machines/genericx86-64/core-image-sato-sdk-genericx86-64.hddimg

Git rev: master/835f7eac0610325e906591cd81890bebe8627580

Steps:
1. Download the hddimg image from the above site
2. dd the image to USB 
3. Boot up the genericx86-64 board
4. Run command "shutdown -h now"

After run command "shutdown -h now", all processes are stopped but at the end the board can not power off. The screen hangs on the splash image.
There is no such issue in previous build.

Log:
INIT: Switching to runlevel: 0
INIT: Sending processes the TERM signal
...
...
Sending all processes the TERM signal...
Sending all processes the KILL signal...
Unmounting remote filesystems...
Deactivating swap...
Unmounting local filesystems...
EXT4-fs (loop0): re-mounted. Opts: (null)
Comment 2 Yi Zhao 2019-08-09 08:49:33 UTC
This issue only happens if the board connects a LCD display with mini HDMI cable.
There is no this issue if I disconnect the display.  

When the bug occurs,  it will report an error on screen:

Error VT_WAITACTIVE failed
: Interrupted system call
Comment 3 Kevin Hao 2019-08-22 01:17:59 UTC
This has been fixed by the following commit:
commit f45a48887fd5
Author: Kevin Hao <kexin.hao@windriver.com>
Date:   Mon Aug 19 17:27:15 2019 +0800

    psplash: Avoid mount the psplash tmpfs twice
    
    The /etc/init.d/psplash.sh will be invoked both in boot and
    shutdown/reboot. And the psplash tmpfs will be mounted twice. This
    will trigger a bug in umount and let the system hang when
    shutdown/reboot. I already made a patch [1] to fix the issue in
    umount, but there is no reason for the psplash to do the twice mount.
    So also fix it.
    
    [Yocto 13461]
    
    [1] https://lore.kernel.org/util-linux/20190819083022.12289-1-kexin.hao@windriver.com/T/#u
    
    (From OE-Core rev: 5cea0448c5c75b9defc5fc2582e9b0c14e26a4e9)
    
    Signed-off-by: Kevin Hao <kexin.hao@windriver.com>
    Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Comment 4 Yi Zhao 2019-09-26 02:21:19 UTC
Verified with 2.8 M3 RC1.
Git rev: master/81f9e815d36848761a9dfa94b00ad998bb39a4a6