device-pine64-pinephone: fix suspend with elogind (MR 1636)

- re-enable console suspend, which seems to be broken with elogind when
  suspending (kernel gets hung up indefinitely in vt_waitactive)

- add a suspend hook to work around the musb driver not allowing the
  device to suspend

Based on my testing, this option seems to prevent suspending via
elogind (using `loginctl suspend`). When console suspend is disabled,
the kernel gets hung up in the call to vt_waitactive, and elogind times
out trying to suspend.
This commit is contained in:
clayton craft 2020-10-21 23:16:28 -07:00
parent 2d10cc697a
commit f7d743a213
No known key found for this signature in database
GPG key ID: 23A30DA6D406B355
3 changed files with 31 additions and 5 deletions

View file

@ -3,14 +3,14 @@
# Co-Maintainer: Luca Weiss <luca@z3ntu.xyz> # Co-Maintainer: Luca Weiss <luca@z3ntu.xyz>
# Co-Maintainer: Bart Ribbers <bribbers@disroot.org> # Co-Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=device-pine64-pinephone pkgname=device-pine64-pinephone
pkgver=0.8 pkgver=0.9
pkgrel=0 pkgrel=0
pkgdesc="PINE64 PinePhone" pkgdesc="PINE64 PinePhone"
url="https://postmarketos.org" url="https://postmarketos.org"
license="MIT" license="MIT"
arch="aarch64" arch="aarch64"
options="!check !archcheck" options="!check !archcheck"
subpackages="$pkgname-nonfree-firmware:nonfree_firmware $pkgname-phosh" subpackages="$pkgname-nonfree-firmware:nonfree_firmware $pkgname-phosh $pkgname-elogind"
depends="postmarketos-base u-boot-pinephone uboot-tools mesa-dri-gallium linux-postmarketos-allwinner gpsd atinout alsa-ucm-conf" depends="postmarketos-base u-boot-pinephone uboot-tools mesa-dri-gallium linux-postmarketos-allwinner gpsd atinout alsa-ucm-conf"
makedepends="devicepkg-dev" makedepends="devicepkg-dev"
install="$pkgname.post-install" install="$pkgname.post-install"
@ -27,6 +27,7 @@ source="deviceinfo
ucm/VoiceCall.conf ucm/VoiceCall.conf
eg25.initd eg25.initd
setup-modem.sh setup-modem.sh
elogind-system-sleep_musb-hdrc-quirk.hook
" "
build() { build() {
@ -87,8 +88,14 @@ phosh() {
mkdir "$subpkgdir" mkdir "$subpkgdir"
} }
elogind() {
install_if="$pkgname elogind"
install -Dm755 "$srcdir"/elogind-system-sleep_musb-hdrc-quirk.hook \
"$subpkgdir"/usr/libexec/elogind/system-sleep/musb-hdrc-quirk.hook
}
sha512sums="c862454638db61f998c72848073bb7c97ccc51ac689865c5aa201d5e93a757b3d84c3807c3e5300ea0c3bd8adf0471e5148ad45ee203a690d4b909e7b90becbb deviceinfo sha512sums="c862454638db61f998c72848073bb7c97ccc51ac689865c5aa201d5e93a757b3d84c3807c3e5300ea0c3bd8adf0471e5148ad45ee203a690d4b909e7b90becbb deviceinfo
462cf12a3bb29d9a67759f568aea702d0201c61508a352c86ecf23b91d43a0ccc2adf510ee3110f0d748d98d11a54bce3084f2380ebe1714556477b47ed6f473 uboot-script.cmd b20d4fb9f08a1bbc1c12ce6940e438a00f5c8d400fbc5071e951ffc69f77d2421204472e86f1a7df0488d250f3ec16205b75d4eac8c3cb5521fe9a02ea24865a uboot-script.cmd
f4b5509fd6a8b23f3667f5e7262b3a19c607a37cb9eaf7d0e93eb826d45c26ec12df4810879bacb8e4042bb83cc80b2b436224c8d47b6d67361369a724bbf7ee sysrq.conf f4b5509fd6a8b23f3667f5e7262b3a19c607a37cb9eaf7d0e93eb826d45c26ec12df4810879bacb8e4042bb83cc80b2b436224c8d47b6d67361369a724bbf7ee sysrq.conf
3dd6d612c381cb0002049d1974d8fb5aa5a53a1eb4d6bcbf62eb2ad52cfdc45f0f6ad24a699716d3513b0371aa1316f25dc72afc10d7176cc3b99d0965c3f030 hwtest.ini 3dd6d612c381cb0002049d1974d8fb5aa5a53a1eb4d6bcbf62eb2ad52cfdc45f0f6ad24a699716d3513b0371aa1316f25dc72afc10d7176cc3b99d0965c3f030 hwtest.ini
b53cc6f2531854cc9c1e4c334185a20551d64c8675ee8a8eaa03b99d80808fad421a0f6e99e5be212a974d88c85f461a71ba59ac59c29f298c82f211e3be1ef4 10-pinephone-proximity.rules b53cc6f2531854cc9c1e4c334185a20551d64c8675ee8a8eaa03b99d80808fad421a0f6e99e5be212a974d88c85f461a71ba59ac59c29f298c82f211e3be1ef4 10-pinephone-proximity.rules
@ -99,4 +106,5 @@ e852b48a687f9b2a0eca444aa3d00a1818aead9f5e5d28e070b51c9d6f8ec648e66f1d88e2bfa94d
c3abc45269fb135075f5e227161c68ac234775b87fcf224385c5f40123108bf87e1351a1f1ec6786e964f493129511b8363070116a9a451e53cd7b17b3a76cc8 HiFi.conf c3abc45269fb135075f5e227161c68ac234775b87fcf224385c5f40123108bf87e1351a1f1ec6786e964f493129511b8363070116a9a451e53cd7b17b3a76cc8 HiFi.conf
4bf91e0a3cdd9020322d6fdf9990b6885c35a2f21276f412dffea3e7026da9e14437878f254a156cfd7dae3c44769ff37ae24b99ace854f56bc49d19bc7a9bb7 VoiceCall.conf 4bf91e0a3cdd9020322d6fdf9990b6885c35a2f21276f412dffea3e7026da9e14437878f254a156cfd7dae3c44769ff37ae24b99ace854f56bc49d19bc7a9bb7 VoiceCall.conf
db57bd1613ae988a05df86fa962352145f480e1a4e5a0ff921e734cf35ecd755b7f14775a70bb31a7e875813cbc7a4722202cf76023f1b15862bbd5390d0b757 eg25.initd db57bd1613ae988a05df86fa962352145f480e1a4e5a0ff921e734cf35ecd755b7f14775a70bb31a7e875813cbc7a4722202cf76023f1b15862bbd5390d0b757 eg25.initd
0c81d758e1bcb56ed2cdaf91124121ebbd4dd7a5e25f02a7685b837faf660949d05f6b07b39a1c6a9ca22a7029cdcf3c6dac8f1038e37c8a34cb7c5702e9df51 setup-modem.sh" 0c81d758e1bcb56ed2cdaf91124121ebbd4dd7a5e25f02a7685b837faf660949d05f6b07b39a1c6a9ca22a7029cdcf3c6dac8f1038e37c8a34cb7c5702e9df51 setup-modem.sh
d664ffce64e8f5bd76fea74a1952065ac1da62cf323be8af110a2fc1765ca52029370292a044b878aabec15778f8d0924b1ebf585e9e9e2ce40dd57c19bd40ee elogind-system-sleep_musb-hdrc-quirk.hook"

View file

@ -0,0 +1,18 @@
#!/bin/sh
set -x
musb_dev=$(ls -d /sys/bus/platform/devices/musb-hdrc.?.auto)
if ! [ -e "$musb_dev" ]; then
echo "Could not find musb device."
exit 1
fi
musb_dev=$(basename "$musb_dev")
case $1/$2 in
pre/*)
printf '%s' "$musb_dev" > /sys/bus/platform/drivers/musb-hdrc/unbind
;;
post/*)
printf '%s' "$musb_dev" > /sys/bus/platform/drivers/musb-hdrc/bind
;;
esac

View file

@ -9,7 +9,7 @@ else
setenv bootdev 2; setenv bootdev 2;
fi; fi;
setenv bootargs init=/init.sh rw console=tty0 console=ttyS0,115200 no_console_suspend earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1 cma=256M PMOS_NO_OUTPUT_REDIRECT PMOS_FORCE_PARTITION_RESIZE pmos_boot=/dev/mmcblk${bootdev}p1 pmos_root=/dev/mmcblk${bootdev}p2 setenv bootargs init=/init.sh rw console=tty0 console=ttyS0,115200 earlycon=uart,mmio32,0x01c28000 panic=10 consoleblank=0 loglevel=1 cma=256M PMOS_NO_OUTPUT_REDIRECT PMOS_FORCE_PARTITION_RESIZE pmos_boot=/dev/mmcblk${bootdev}p1 pmos_root=/dev/mmcblk${bootdev}p2
printenv printenv