[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170614222017.14653-2-mcgrof@kernel.org>
Date: Wed, 14 Jun 2017 15:20:14 -0700
From: "Luis R. Rodriguez" <mcgrof@...nel.org>
To: gregkh@...uxfoundation.org
Cc: mfuzzey@...keon.com, ebiederm@...ssion.com,
dmitry.torokhov@...il.com, wagi@...om.org, dwmw2@...radead.org,
jewalt@...innovations.com, rafal@...ecki.pl,
arend.vanspriel@...adcom.com, rjw@...ysocki.net,
yi1.li@...ux.intel.com, atull@...nel.org, moritz.fischer@...us.com,
pmladek@...e.com, johannes.berg@...el.com,
emmanuel.grumbach@...el.com, luciano.coelho@...el.com,
kvalo@...eaurora.org, luto@...nel.org,
torvalds@...ux-foundation.org, keescook@...omium.org,
takahiro.akashi@...aro.org, dhowells@...hat.com, pjones@...hat.com,
hdegoede@...hat.com, alan@...ux.intel.com, tytso@....edu,
mtk.manpages@...il.com, paul.gortmaker@...driver.com,
mtosatti@...hat.com, mawilcox@...rosoft.com,
linux-api@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
"Luis R. Rodriguez" <mcgrof@...nel.org>
Subject: [PATCH 1/4] test_firmware: add test case for SIGCHLD on sync fallback
It has been reported that SIGCHLD will trigger an immediate abort
on sync firmware requests which rely on the sysfs interface for a
trigger. This is unexpected behaviour, this reproduces this issue.
This test case currenty fails.
Reported-by: Martin Fuzzey <mfuzzey@...keon.com>
Signed-off-by: Luis R. Rodriguez <mcgrof@...nel.org>
---
tools/testing/selftests/firmware/fw_fallback.sh | 31 +++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/tools/testing/selftests/firmware/fw_fallback.sh b/tools/testing/selftests/firmware/fw_fallback.sh
index 2e4c22d5abf7..8f511035f783 100755
--- a/tools/testing/selftests/firmware/fw_fallback.sh
+++ b/tools/testing/selftests/firmware/fw_fallback.sh
@@ -134,6 +134,27 @@ load_fw_custom_cancel()
wait
}
+load_fw_fallback_with_child()
+{
+ local name="$1"
+ local file="$2"
+
+ # This is the value already set but we want to be explicit
+ echo 4 >/sys/class/firmware/timeout
+
+ sleep 1 &
+ SECONDS_BEFORE=$(date +%s)
+ echo -n "$name" >"$DIR"/trigger_request 2>/dev/null
+ SECONDS_AFTER=$(date +%s)
+ SECONDS_DELTA=$(($SECONDS_AFTER - $SECONDS_BEFORE))
+ if [ "$SECONDS_DELTA" -lt 4 ]; then
+ RET=1
+ else
+ RET=0
+ fi
+ wait
+ return $RET
+}
trap "test_finish" EXIT
@@ -221,4 +242,14 @@ else
echo "$0: cancelling custom fallback mechanism works"
fi
+set +e
+load_fw_fallback_with_child "nope-signal-$NAME" "$FW"
+if [ "$?" -eq 0 ]; then
+ echo "$0: SIGCHLD on sync ignored as expected" >&2
+else
+ echo "$0: error - sync firmware request cancelled due to SIGCHLD" >&2
+ exit 1
+fi
+set -e
+
exit 0
--
2.11.0
Powered by blists - more mailing lists