aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Hainke <vincent@systemli.org>2021-12-20 21:48:38 +0100
committerHauke Mehrtens <hauke@hauke-m.de>2022-01-02 12:35:21 +0100
commit27225e35382d018a59078a52fa802e5e56d6be4b (patch)
tree96aedec1770dffea6c76c9afabc104f5beb7da3c
parent104774c3b07b1dff14f8987687ad5a99fc5ada8a (diff)
downloadupstream-27225e35382d018a59078a52fa802e5e56d6be4b.tar.gz
upstream-27225e35382d018a59078a52fa802e5e56d6be4b.tar.bz2
upstream-27225e35382d018a59078a52fa802e5e56d6be4b.zip
kernel: ath10k: provide a build variant for small RAM devices
Based on: 1ac627024de9 ("kernel: ath10k-ct: provide a build variant for small RAM devices") Like described in the ath10k-ct-smallbuffers version, oom-killer gets triggered frequently by devices with small RAM. That change is necessary for many community mesh networks which use ath10k based devices with too little RAM. The -ct driver has been proven unstable if used with 11s meshing and only wave2 chipsets are supporting 11s. Freifunk Berlin is nowadays assembling its firmware-based completely of vanilla OpenWRT with some package additions which are made through the imagebuilder. Therefore we cannot take the approach other freifunk communities have taken to maintain that patch downstream [1]. Other communities consider these devices as broken and that change would pretty much give those devices a second life [2]. [1] - https://git.freifunk-franken.de/mirror/openwrt/commit/450b306e540bc0f2c8a8841bbe4d9612f2b8cdea [2] - https://github.com/freifunk-gluon/gluon/issues/1988#issuecomment-619532909 Signed-off-by: Simon Polack <spolack+git@mailbox.org> Signed-off-by: Nick Hainke <vincent@systemli.org> (cherry picked from commit 694757a08f620a9f24b70003542d9dcd0abeac46)
-rw-r--r--package/kernel/mac80211/Makefile8
-rw-r--r--package/kernel/mac80211/ath.mk14
-rw-r--r--package/kernel/mac80211/patches/ath/990-ath10k-small-buffers.patch64
3 files changed, 82 insertions, 4 deletions
diff --git a/package/kernel/mac80211/Makefile b/package/kernel/mac80211/Makefile
index 948dd50ccb..3686126053 100644
--- a/package/kernel/mac80211/Makefile
+++ b/package/kernel/mac80211/Makefile
@@ -434,9 +434,15 @@ config-$(call config_package,rsi91x-sdio) += RSI_SDIO
config-$(CONFIG_LEDS_TRIGGERS) += MAC80211_LEDS
+C_DEFINES=
+
+ifeq ($(BUILD_VARIANT),smallbuffers)
+ C_DEFINES+= -DCONFIG_ATH10K_SMALLBUFFERS
+endif
+
MAKE_OPTS:= -C "$(PKG_BUILD_DIR)" \
$(KERNEL_MAKE_FLAGS) \
- EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include $(IREMAP_CFLAGS)" \
+ EXTRA_CFLAGS="-I$(PKG_BUILD_DIR)/include $(IREMAP_CFLAGS) $(C_DEFINES)" \
KLIB_BUILD="$(LINUX_DIR)" \
MODPROBE=true \
KLIB=$(TARGET_MODULES_DIR) \
diff --git a/package/kernel/mac80211/ath.mk b/package/kernel/mac80211/ath.mk
index 24abb910ff..e815f37e1c 100644
--- a/package/kernel/mac80211/ath.mk
+++ b/package/kernel/mac80211/ath.mk
@@ -1,5 +1,5 @@
PKG_DRIVERS += \
- ath ath5k ath6kl ath6kl-sdio ath6kl-usb ath9k ath9k-common ath9k-htc ath10k \
+ ath ath5k ath6kl ath6kl-sdio ath6kl-usb ath9k ath9k-common ath9k-htc ath10k ath10k-smallbuffers \
carl9170 owl-loader ar5523 wil6210
PKG_CONFIG_DEPENDS += \
@@ -55,6 +55,7 @@ config-$(CONFIG_ATH10K_THERMAL) += ATH10K_THERMAL
config-$(call config_package,ath9k-htc) += ATH9K_HTC
config-$(call config_package,ath10k) += ATH10K ATH10K_PCI
+config-$(call config_package,ath10k-smallbuffers) += ATH10K ATH10K_PCI ATH10K_SMALLBUFFERS
config-$(call config_package,ath5k) += ATH5K
ifdef CONFIG_TARGET_ath25
@@ -260,6 +261,7 @@ define KernelPackage/ath10k
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \
$(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko
AUTOLOAD:=$(call AutoProbe,ath10k_pci)
+ VARIANT:=regular
endef
define KernelPackage/ath10k/description
@@ -273,14 +275,20 @@ define KernelPackage/ath10k/config
config ATH10K_LEDS
bool "Enable LED support"
default y
- depends on PACKAGE_kmod-ath10k
+ depends on PACKAGE_kmod-ath10k || PACKAGE_kmod-ath10k-smallbuffers
config ATH10K_THERMAL
bool "Enable thermal sensors and throttling support"
- depends on PACKAGE_kmod-ath10k
+ depends on PACKAGE_kmod-ath10k || PACKAGE_kmod-ath10k-smallbuffers
endef
+define KernelPackage/ath10k-smallbuffers
+ $(call KernelPackage/ath10k)
+ TITLE+= (small buffers for low-RAM devices)
+ VARIANT:=smallbuffers
+endef
+
define KernelPackage/carl9170
$(call KernelPackage/mac80211/Default)
TITLE:=Driver for Atheros AR9170 USB sticks
diff --git a/package/kernel/mac80211/patches/ath/990-ath10k-small-buffers.patch b/package/kernel/mac80211/patches/ath/990-ath10k-small-buffers.patch
new file mode 100644
index 0000000000..2f560c70a0
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath/990-ath10k-small-buffers.patch
@@ -0,0 +1,64 @@
+--- a/drivers/net/wireless/ath/ath10k/htt.h
++++ b/drivers/net/wireless/ath/ath10k/htt.h
+@@ -235,7 +235,11 @@ enum htt_rx_ring_flags {
+ };
+
+ #define HTT_RX_RING_SIZE_MIN 128
++#ifndef CONFIG_ATH10K_SMALLBUFFERS
+ #define HTT_RX_RING_SIZE_MAX 2048
++#else
++#define HTT_RX_RING_SIZE_MAX 512
++#endif
+ #define HTT_RX_RING_SIZE HTT_RX_RING_SIZE_MAX
+ #define HTT_RX_RING_FILL_LEVEL (((HTT_RX_RING_SIZE) / 2) - 1)
+ #define HTT_RX_RING_FILL_LEVEL_DUAL_MAC (HTT_RX_RING_SIZE - 1)
+--- a/drivers/net/wireless/ath/ath10k/pci.c
++++ b/drivers/net/wireless/ath/ath10k/pci.c
+@@ -131,7 +131,11 @@ static const struct ce_attr pci_host_ce_
+ .flags = CE_ATTR_FLAGS,
+ .src_nentries = 0,
+ .src_sz_max = 2048,
++#ifndef CONFIG_ATH10K_SMALLBUFFERS
+ .dest_nentries = 512,
++#else
++ .dest_nentries = 128,
++#endif
+ .recv_cb = ath10k_pci_htt_htc_rx_cb,
+ },
+
+@@ -140,7 +144,11 @@ static const struct ce_attr pci_host_ce_
+ .flags = CE_ATTR_FLAGS,
+ .src_nentries = 0,
+ .src_sz_max = 2048,
++#ifndef CONFIG_ATH10K_SMALLBUFFERS
+ .dest_nentries = 128,
++#else
++ .dest_nentries = 64,
++#endif
+ .recv_cb = ath10k_pci_htc_rx_cb,
+ },
+
+@@ -167,7 +175,11 @@ static const struct ce_attr pci_host_ce_
+ .flags = CE_ATTR_FLAGS,
+ .src_nentries = 0,
+ .src_sz_max = 512,
++#ifndef CONFIG_ATH10K_SMALLBUFFERS
+ .dest_nentries = 512,
++#else
++ .dest_nentries = 128,
++#endif
+ .recv_cb = ath10k_pci_htt_rx_cb,
+ },
+
+@@ -192,7 +204,11 @@ static const struct ce_attr pci_host_ce_
+ .flags = CE_ATTR_FLAGS,
+ .src_nentries = 0,
+ .src_sz_max = 2048,
++#ifndef CONFIG_ATH10K_SMALLBUFFERS
+ .dest_nentries = 128,
++#else
++ .dest_nentries = 96,
++#endif
+ .recv_cb = ath10k_pci_pktlog_rx_cb,
+ },
+