From e7a21cdad0dcc1ddb57ae6c80ee298a9ff1839f7 Mon Sep 17 00:00:00 2001 From: Hector Palacios Date: Wed, 30 Nov 2016 12:01:04 +0100 Subject: [PATCH] ccimx6ul: suspend: unload wireless module always before suspending The suspend script was unloading the wireless module driver *only* if the interface 'wlan0' was previously up. If the interface is down the module does not unload and the system fails to suspend. This patch removes the module always if it appears in the list of loaded modules. While on it, move the unloading of wireless after the unloading of Bluetooth, to be in line with the reversed order in which they are loaded on the resume_interfaces() call. Signed-off-by: Hector Palacios https://jira.digi.com/browse/DEL-3241 --- .../recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend b/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend index a87cdcd65..597b441c2 100755 --- a/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend +++ b/meta-digi-dey/recipes-core/busybox/busybox-1.23.2/ccimx6ul/suspend @@ -26,12 +26,15 @@ usage() { } suspend_interfaces() { - if grep -qs '^wlan0' /var/run/ifstate; then - ifdown wlan0 && up_wlan_on_resume="1" && sleep 0.5 && rmmod wlan - fi if hcitool -i hci0 dev >/dev/null 2>&1; then hciconfig hci0 down && up_hci0_on_resume="1" && sleep 0.5 fi + if grep -qs '^wlan0' /var/run/ifstate; then + ifdown wlan0 && up_wlan_on_resume="1" && sleep 0.5 + fi + if grep -qs '^wlan' /proc/modules; then + rmmod wlan + fi } resume_interfaces() {