From 64d900abe40057393148bc0283d35c2254dd4f57 Mon Sep 17 00:00:00 2001 From: Sergey Yelin Date: Wed, 23 Oct 2024 16:42:09 +0300 Subject: [PATCH] Unload brcmfmac_wcc (if loaded) before brcmfmac (#1200) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Module brcmfmac cannot be unloaded with rmmod when brcmfmac_wcc is loaded. This leads brcmfmac to crash on wake up. Co-authored-by: Jörg Thalheim --- apple/macbook-pro/12-1/default.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/apple/macbook-pro/12-1/default.nix b/apple/macbook-pro/12-1/default.nix index 631cd7511..7497b2fff 100644 --- a/apple/macbook-pro/12-1/default.nix +++ b/apple/macbook-pro/12-1/default.nix @@ -16,7 +16,10 @@ # https://bugzilla.kernel.org/show_bug.cgi?id=101681#c116. # Also brcmfmac could randomly crash on resume from sleep. powerUpCommands = lib.mkBefore "${pkgs.kmod}/bin/modprobe brcmfmac"; - powerDownCommands = lib.mkBefore "${pkgs.kmod}/bin/rmmod brcmfmac"; + powerDownCommands = lib.mkBefore '' + ${pkgs.kmod}/bin/rmmod -f -v brcmfmac_wcc 2>/dev/null || true + ${pkgs.kmod}/bin/rmmod brcmfmac + ''; }; # USB subsystem wakes up MBP right after suspend unless we disable it.