mac80211: ath10k: Allow to enable the thermal code of ath10k
authorSven Eckelmann <sven.eckelmann@openmesh.com>
Tue, 30 Jan 2018 08:41:45 +0000 (09:41 +0100)
committerJo-Philipp Wich <jo@mein.io>
Tue, 18 Dec 2018 16:32:19 +0000 (17:32 +0100)
Some ath10k firmware versions allow to access the chip internal a
temperature sensor and allow to reduce the amount of the time when the card
is allowed to send. The latter is required on devices which tend to
overheat.

An userspace service has to read
/sys/class/ieee80211/phy*/device/hwmon/hwmon*/temp1_input regularly and
then decide how much the device has to be throttled. This can be done by
writing to /sys/class/ieee80211/phy*/device/cooling_device/cur_state. By
default it is not throttled (0) but it can be throttled up to 100(%).

Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
(backported from 4270847a2c2b8e4b890de16b51bd2e50c64077d2)
(rebased patches)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
package/kernel/mac80211/Makefile
package/kernel/mac80211/patches/080-ath10k_thermal_config.patch
package/kernel/mac80211/patches/309-v4.16-0002-ath10k-move-spectral-scan-support-under-a-separate-c.patch
package/kernel/mac80211/patches/602-rt2x00-introduce-rt2x00eeprom.patch
package/kernel/mac80211/patches/974-ath10k_add-LED-and-GPIO-controlling-support-for-various-chipsets.patch

index 91c08fdb7e02a49ee52aa955b66394c9ae9d64a4..5345337349f76dc6ea1611bc6d15d820e9ddaabe 100644 (file)
@@ -75,6 +75,7 @@ PKG_CONFIG_DEPENDS:= \
        CONFIG_PACKAGE_RTLWIFI_DEBUG \
        CONFIG_ATH9K_SUPPORT_PCOEM \
        CONFIG_ATH9K_TX99 \
+       CONFIG_ATH10K_THERMAL \
        CONFIG_ATH_USER_REGD \
 
 include $(INCLUDE_DIR)/package.mk
@@ -337,7 +338,8 @@ define KernelPackage/ath10k
   $(call KernelPackage/mac80211/Default)
   TITLE:=Atheros 802.11ac wireless cards support
   URL:=https://wireless.wiki.kernel.org/en/users/drivers/ath10k
-  DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT
+  DEPENDS+= @PCI_SUPPORT +kmod-ath +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +@DRIVER_11W_SUPPORT \
+       +ATH10K_THERMAL:kmod-hwmon-core +ATH10K_THERMAL:kmod-thermal
   FILES:= \
        $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_core.ko \
        $(PKG_BUILD_DIR)/drivers/net/wireless/ath/ath10k/ath10k_pci.ko
@@ -350,6 +352,14 @@ Atheros IEEE 802.11ac family of chipsets. For now only
 PCI is supported.
 endef
 
+define KernelPackage/ath10k/config
+
+       config ATH10K_THERMAL
+               bool "Enable thermal sensors and throttling support"
+               depends on PACKAGE_kmod-ath10k
+
+endef
+
 #Broadcom firmware
 ifneq ($(CONFIG_B43_FW_6_30),)
   PKG_B43_FWV4_NAME:=broadcom-wl
@@ -1636,6 +1646,7 @@ config-$(CONFIG_ATH_USER_REGD) += ATH_USER_REGD
 config-$(CONFIG_ATH9K_SUPPORT_PCOEM) += ATH9K_PCOEM
 config-$(CONFIG_ATH9K_TX99) += ATH9K_TX99
 config-$(CONFIG_ATH9K_UBNTHSR) += ATH9K_UBNTHSR
+config-$(CONFIG_ATH10K_THERMAL) += ATH10K_THERMAL
 
 config-$(call config_package,ath9k-htc) += ATH9K_HTC
 config-$(call config_package,ath10k) += ATH10K ATH10K_PCI
index 796615b03c9adbaac3208bd7c16d4c0df72ae52e..adcd788bd323b894910366e53124e633fc0a72fa 100644 (file)
  int ath10k_thermal_register(struct ath10k *ar);
  void ath10k_thermal_unregister(struct ath10k *ar);
  void ath10k_thermal_event_temperature(struct ath10k *ar, int temperature);
+--- a/local-symbols
++++ b/local-symbols
+@@ -139,6 +139,7 @@ ATH10K_SDIO=
+ ATH10K_USB=
+ ATH10K_DEBUG=
+ ATH10K_DEBUGFS=
++ATH10K_THERMAL=
+ ATH10K_TRACING=
+ ATH10K_DFS_CERTIFIED=
+ WCN36XX=
index 604a6f1585aba2cefe5a95a601411043aafc39c2..9eefdbce6755e1a1bdb7efc9c6bffb3eee881885 100644 (file)
@@ -86,6 +86,6 @@ Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
  ATH10K_DEBUG=
  ATH10K_DEBUGFS=
 +ATH10K_SPECTRAL=
+ ATH10K_THERMAL=
  ATH10K_TRACING=
  ATH10K_DFS_CERTIFIED=
- WCN36XX=
index f95fa9540c1e19fbd0f965167133533fdd7f1547..86a95a09f97bdfc105bc9b4d1d4fa73c9eef2c32 100644 (file)
@@ -1,6 +1,6 @@
 --- a/local-symbols
 +++ b/local-symbols
-@@ -298,6 +298,7 @@ RT2X00_LIB_FIRMWARE=
+@@ -299,6 +299,7 @@ RT2X00_LIB_FIRMWARE=
  RT2X00_LIB_CRYPTO=
  RT2X00_LIB_LEDS=
  RT2X00_LIB_DEBUGFS=
index fc7fe1edb04ff3254d8fc90020526fe5b1a37c55..c0da27cdb29b90b788f3d2199c28702015ec2987 100644 (file)
@@ -119,9 +119,9 @@ v13:
  ATH10K_DEBUGFS=
  ATH10K_SPECTRAL=
 +ATH10K_LEDS=
+ ATH10K_THERMAL=
  ATH10K_TRACING=
  ATH10K_DFS_CERTIFIED=
- WCN36XX=
 --- a/drivers/net/wireless/ath/ath10k/core.c
 +++ b/drivers/net/wireless/ath/ath10k/core.c
 @@ -32,6 +32,7 @@