/usr/src/linux-headers-5.15.0-190/tools/testing/selftests/powerpc/scripts
Edit: /usr/src/linux-headers-5.15.0-190/tools/testing/selftests/powerpc/scripts/hmi.sh (2401B)
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0-only
#
# Copyright 2015, Daniel Axtens, IBM Corporation
#
# do we have ./getscom, ./putscom?
if [ -x ./getscom ] && [ -x ./putscom ]; then
GETSCOM=./getscom
PUTSCOM=./putscom
elif which getscom > /dev/null; then
GETSCOM=$(which getscom)
PUTSCOM=$(which putscom)
else
cat <
/dev/null; then
echo "Error injecting. Aborting!"
exit 1
fi
# now we want to wait for all the HMIs to be processed
# we expect one per thread on the core
i=0;
new_hmis=$(COUNT_HMIS)
while [ $new_hmis -lt $((old_hmis + expected_hmis)) ] && [ $i -lt 12 ]; do
echo "Seen $((new_hmis - old_hmis)) HMI(s) out of $expected_hmis expected, sleeping"
sleep 5;
i=$((i + 1))
new_hmis=$(COUNT_HMIS)
done
if [ $i = 12 ]; then
echo "Haven't seen expected $expected_hmis recoveries after 1 min. Aborting."
exit 1
fi
echo "Processed $expected_hmis events; presumed success. Check dmesg."
echo ""
done