From a02abb799405d0e4ad0d6bb46eacf6fbe958c06e Mon Sep 17 00:00:00 2001 From: Pierre-Louis Bossart Date: Wed, 14 Feb 2018 19:30:57 -0600 Subject: [PATCH] soft: kmod_scripts: initial import set of basic bash scripts to remove/insert SOF Linux kernel modules in the right order. This is typically used to avoid rebooting every time the SOF image or topology are updated - and detect leaks on remove. sof_remove.sh: remove all SOF modules sof_insert.sh: probe SOF modules sof_bootone.sh: combination of remove/insert in one shot sof_bootloop.sh: boot loop to see if firmware boot is reliable over time This can probably be enhanced to remove spurious "module is not currently loaded" logs. Signed-off-by: Pierre-Louis Bossart --- kmod_scripts/sof_bootloop.sh | 11 +++++++++++ kmod_scripts/sof_bootone.sh | 19 +++++++++++++++++++ kmod_scripts/sof_insert.sh | 12 ++++++++++++ kmod_scripts/sof_remove.sh | 27 +++++++++++++++++++++++++++ 4 files changed, 69 insertions(+) create mode 100755 kmod_scripts/sof_bootloop.sh create mode 100755 kmod_scripts/sof_bootone.sh create mode 100755 kmod_scripts/sof_insert.sh create mode 100755 kmod_scripts/sof_remove.sh diff --git a/kmod_scripts/sof_bootloop.sh b/kmod_scripts/sof_bootloop.sh new file mode 100755 index 0000000..f1bc99b --- /dev/null +++ b/kmod_scripts/sof_bootloop.sh @@ -0,0 +1,11 @@ +#!/bin/bash + +MAXLOOPS=100 +COUNTER=0 + +while [ $COUNTER -lt $MAXLOOPS ]; do + echo "test $COUNTER" + ./sof_bootone.sh + dmesg > boot_$COUNTER.bootlog + let COUNTER+=1 +done diff --git a/kmod_scripts/sof_bootone.sh b/kmod_scripts/sof_bootone.sh new file mode 100755 index 0000000..6bc5f27 --- /dev/null +++ b/kmod_scripts/sof_bootone.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +dmesg -C +./sof_remove.sh +./sof_insert.sh +sleep 1 + +unset FW_BOOT +unset ERROR +FW_BOOT=$(dmesg | grep sof-audio | grep "boot complete") +ERROR=$(dmesg | grep sof-audio | grep "error") + +if [ ! -z "$ERROR" ] || [ -z "$FW_BOOT" ] +then + echo "boot failed" +else + echo "boot success" +fi + diff --git a/kmod_scripts/sof_insert.sh b/kmod_scripts/sof_insert.sh new file mode 100755 index 0000000..93b2242 --- /dev/null +++ b/kmod_scripts/sof_insert.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +modprobe snd_soc_rt5670 +modprobe snd_soc_rt5645 +modprobe snd_soc_rt5651 +modprobe snd_soc_rt5640 +modprobe snd_soc_da7213 + +modprobe sof_acpi_dev +modprobe sof_pci_dev + + diff --git a/kmod_scripts/sof_remove.sh b/kmod_scripts/sof_remove.sh new file mode 100755 index 0000000..1ea0598 --- /dev/null +++ b/kmod_scripts/sof_remove.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +rmmod sof_pci_dev +rmmod sof_acpi_dev +rmmod snd_soc_acpi_intel_match +rmmod snd_sof_intel_byt +rmmod snd_sof_intel_hsw +rmmod snd_sof_intel_bdw +rmmod snd_sof_intel_apl +rmmod snd_sof_intel_cnl +rmmod snd_sof_intel_hda_common +rmmod snd_sof + +rmmod snd_soc_sst_bytcr_rt5640 +rmmod snd_soc_sst_bytcr_rt5651 +rmmod snd_soc_sst_cht_bsw_rt5645 +rmmod snd_soc_sst_cht_bsw_rt5670 +rmmod snd_soc_sst_byt_cht_da7213 + +rmmod snd_soc_rt5670 +rmmod snd_soc_rt5645 +rmmod snd_soc_rt5651 +rmmod snd_soc_rt5640 +rmmod snd_soc_rl6231 +rmmod snd_soc_da7213 + +rmmod snd_soc_acpi