Add wink patch for disabling MHI M2 state. Rename firmware.

Disabling the MHI M2 state appears to completely resolve issues where
enabling the wifi firmware would cause the the whole system to freeze
quite frequently. The reason for why this fix works so well is still
unknown and under investigation. See some discussion here:

http://lists.infradead.org/pipermail/ath11k/2020-December/000876.html

Also renames the firmware package to clarify that it is for the wifi
driver. This is to avoid confusion with the bluetooth firmware which
will be added in an upcoming patch.
This commit is contained in:
mitchmindtree 2020-12-13 15:09:57 +01:00
parent 7f1da4009b
commit 08d1c4dd2b
3 changed files with 31 additions and 4 deletions

View file

@ -7,12 +7,12 @@
# TODO: upstream to NixOS/nixpkgs
nixpkgs.overlays = [(final: previous: {
qca6390-firmware = final.callPackage ./qca6390-firmware.nix {};
qca6390-wifi-firmware = final.callPackage ./qca6390-wifi-firmware.nix {};
})];
hardware.firmware = lib.mkBefore [
# Firmware for the AX500 (wi-fi & bluetooth chip).
pkgs.qca6390-firmware
pkgs.qca6390-wifi-firmware
];
# The QCA6390 driver currently requires a specific version of the kernel
@ -212,14 +212,22 @@
};
}
# Patch for crash by w1nk.
# Extra patches by wink.
{
# Improves some cases in which races could occur.
name = "w1nk-irq-lock-patch";
patch = pkgs.fetchpatch {
url = "https://raw.githubusercontent.com/w1nk/ath11k-debug/master/one-irq-manage.patch";
sha256 = "011db3h10smqy0ni0qr9mkyhykf1f3yq6yym6ysbb7jr7l51q0n9";
};
}
{
# System crashes appear to have been caused by MHI state transitions to M2 state.
# Currently under investigation.
# http://lists.infradead.org/pipermail/ath11k/2020-December/000876.html
name = "w1nk-disable-mhi-m2-transition";
patch = ./disable-mhi-m2.patch;
}
];
} // (args.argsOverride or { }));
linux_patched = pkgs.callPackage linux_patched_pkg { };

View file

@ -0,0 +1,19 @@
diff --git a/drivers/bus/mhi/core/pm.c b/drivers/bus/mhi/core/pm.c
index 3de7b1639ec6..02882038e4cc 100644
--- a/drivers/bus/mhi/core/pm.c
+++ b/drivers/bus/mhi/core/pm.c
@@ -55,12 +55,12 @@ static struct mhi_pm_transitions const dev_state_transitions[] = {
},
{
MHI_PM_M0,
- MHI_PM_M0 | MHI_PM_M2 | MHI_PM_M3_ENTER |
+ MHI_PM_M0 | MHI_PM_M3_ENTER |
MHI_PM_SYS_ERR_DETECT | MHI_PM_SHUTDOWN_PROCESS |
MHI_PM_LD_ERR_FATAL_DETECT | MHI_PM_FW_DL_ERR
},
{
- MHI_PM_M2,
+ MHI_PM_M0,
MHI_PM_M0 | MHI_PM_SYS_ERR_DETECT | MHI_PM_SHUTDOWN_PROCESS |
MHI_PM_LD_ERR_FATAL_DETECT
},

View file

@ -3,7 +3,7 @@
{ stdenv, fetchFromGitHub }:
stdenv.mkDerivation rec {
name = "${target}-firmware-${version}";
name = "${target}-wifi-firmware-${version}";
version = "${branch}-00042";
branch = "master";
target = "QCA6390";