summaryrefslogtreecommitdiff
path: root/recipes-bsp/multitech
diff options
context:
space:
mode:
authorJohn Klug <john.klug@multitech.com>2023-01-18 12:13:08 -0600
committerJohn Klug <john.klug@multitech.com>2023-01-18 13:40:48 -0600
commit90dca3ca47c4b1b11fa8d5879cc6247f3594974a (patch)
treecb820dfca1f1be5c92878627c08dd54f87e2d90d /recipes-bsp/multitech
parent2641245c4cc099a2e5bdd178354957acf2dcc065 (diff)
downloadmeta-multitech-90dca3ca47c4b1b11fa8d5879cc6247f3594974a.tar.gz
meta-multitech-90dca3ca47c4b1b11fa8d5879cc6247f3594974a.tar.bz2
meta-multitech-90dca3ca47c4b1b11fa8d5879cc6247f3594974a.zip
SDIO modules on MTCDT3 hangs reboot when mts-io is removed
Diffstat (limited to 'recipes-bsp/multitech')
-rwxr-xr-xrecipes-bsp/multitech/mts-io/mts-io.init39
1 files changed, 27 insertions, 12 deletions
diff --git a/recipes-bsp/multitech/mts-io/mts-io.init b/recipes-bsp/multitech/mts-io/mts-io.init
index eee2635..29f0080 100755
--- a/recipes-bsp/multitech/mts-io/mts-io.init
+++ b/recipes-bsp/multitech/mts-io/mts-io.init
@@ -31,6 +31,16 @@ hw_name=""
MTAC_MODULES=""
((HASAP=0))
+remove_mod() {
+ mod=$1
+ # modprobe -R does not work for modules not in /lib/modules
+ if lsmod | grep -E "^${mod}[[:space:]]" ; then
+ if ! modprobe -r ${mod} ; then
+ rmmod ${mod}
+ fi
+ fi
+}
+
sethwtype() {
# mts-io must be loaded before trying this
# Also, mtcdt3b should be loaded if it exists
@@ -395,25 +405,30 @@ case $1 in
;;
stop)
+ # Remove modules that fall down when
+ # mts-io is removed.
+ remove_mod rsi_sdio
+ remove_mod wlcore_sdio
+ remove_mod wl18xx
+ remove_mod wlcore
+ if [[ -x /usr/sbin/rs9113_remove_modules.sh ]] ; then
+ /usr/sbin/rs9113_remove_modules.sh
+ else
+ remove_mod mac80211
+ remove_mod cfg80211
+ remove_mod bluetooth
+ fi
/usr/bin/logger -t "mts-io" -p daemon.info -s "Unloading mtac modules and mts-io module"
MTAC_MODULES=$(lsmod | grep '^mtac_' | sed -e 's/_/-/' -e 's/ .*//')
MTCDT3B_MODULES=$(lsmod | grep '^mtcdt3b_' | sed -e 's/_/-/' -e 's/ .*//')
for f in ${MTAC_MODULES} ; do
- if ! modprobe -r "$f" ; then
- rmmod "$f"
- fi
+ remove_mod "$f"
done
- if ! modprobe -r mtac ; then
- rmmod mtac
- fi
+ remove_mod mtac
+ remove_mod mtcdt3b
+ remove_mod mts_io
- if ! modprobe -r mtcdt3b ; then
- rmmod mtcdt3b
- fi
- if ! modprobe -r mts-io ; then
- rmmod mtsio
- fi
RETVAL=$?
if ((RETVAL == 0)) ; then
echo "OK"