Merge Official Source
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
This commit is contained in:
commit
62f7ce033b
3
Makefile
3
Makefile
@ -40,6 +40,9 @@ else
|
||||
include tools/Makefile
|
||||
include toolchain/Makefile
|
||||
|
||||
# Include the test suite Makefile if it exists
|
||||
-include tests/Makefile
|
||||
|
||||
$(toolchain/stamp-compile): $(tools/stamp-compile) $(if $(CONFIG_BUILDBOT),toolchain_rebuild_check)
|
||||
$(target/stamp-compile): $(toolchain/stamp-compile) $(tools/stamp-compile) $(BUILD_DIR)/.prepared
|
||||
$(package/stamp-compile): $(target/stamp-compile) $(package/stamp-cleanup)
|
||||
|
||||
@ -33,7 +33,8 @@ BPF_TARGET:=bpf$(if $(CONFIG_BIG_ENDIAN),eb,el)
|
||||
BPF_HEADERS_DIR:=$(STAGING_DIR)/bpf-headers
|
||||
|
||||
BPF_KERNEL_INCLUDE := \
|
||||
-nostdinc $(patsubst %,-isystem %,$(TOOLCHAIN_INC_DIRS)) \
|
||||
-nostdinc -isystem $(TOOLCHAIN_ROOT_DIR)/lib/gcc/*/*/include \
|
||||
$(patsubst %,-isystem%,$(TOOLCHAIN_INC_DIRS)) \
|
||||
-I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include \
|
||||
-I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/asm/mach-generic \
|
||||
-I$(BPF_HEADERS_DIR)/arch/$(BPF_KARCH)/include/generated \
|
||||
|
||||
@ -111,6 +111,8 @@ start=$((network | (start & hostmask)))
|
||||
|
||||
if [ "$prefix" -le 30 ]; then
|
||||
upper=$(((network | hostmask) - 1))
|
||||
elif [ "$prefix" -eq 31 ]; then
|
||||
upper=$((network | hostmask))
|
||||
else
|
||||
upper="$network"
|
||||
fi
|
||||
|
||||
@ -8,14 +8,14 @@ PKG_LICENSE_FILES:=
|
||||
|
||||
PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2023-06-05
|
||||
PKG_SOURCE_VERSION:=fadd0768cbd22248a60efbb219ccefc9d86cd78c
|
||||
PKG_MIRROR_HASH:=caaa373ae2cc6e443e8a31e43e5e2caca4f4ba2b9614efd3e5c9df401056d307
|
||||
PKG_SOURCE_DATE:=2024-03-03
|
||||
PKG_SOURCE_VERSION:=eb3f488a200fafc46140fd51b5e21f737ee50f24
|
||||
PKG_MIRROR_HASH:=368ed648dc7239dbcac3c6ba09be92c4b706118052d35e058cf5d1dae2917039
|
||||
|
||||
# Build the 6.4 ath10k-ct driver version.
|
||||
# Build the 6.7 ath10k-ct driver version.
|
||||
# Probably this should match as closely as
|
||||
# possible to whatever mac80211 backports version is being used.
|
||||
CT_KVER="-6.4"
|
||||
CT_KVER="-6.7"
|
||||
|
||||
PKG_MAINTAINER:=Ben Greear <greearb@candelatech.com>
|
||||
PKG_BUILD_PARALLEL:=1
|
||||
|
||||
@ -1,111 +0,0 @@
|
||||
From a227621b46df8a7a5c276131b245f40eac7513fb Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Fri, 3 Nov 2023 04:03:08 +0100
|
||||
Subject: [PATCH] ath10k-ct: port compilation warning for debug level to kernel
|
||||
6.4
|
||||
|
||||
Port compilation warning for debug level previously fixed in other
|
||||
kernel to kernel version 6.4.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
ath10k-6.4/debug.c | 85 ++++++++++++++++++++++++++--------------------
|
||||
1 file changed, 48 insertions(+), 37 deletions(-)
|
||||
|
||||
--- a/ath10k-6.4/debug.c
|
||||
+++ b/ath10k-6.4/debug.c
|
||||
@@ -1345,47 +1345,58 @@ static const struct file_operations fops
|
||||
.llseek = default_llseek,
|
||||
};
|
||||
|
||||
+static const char debug_level_buf[] =
|
||||
+ "To change debug level, set value adding up desired flags:\n"
|
||||
+ "PCI: 0x1\n"
|
||||
+ "WMI: 0x2\n"
|
||||
+ "HTC: 0x4\n"
|
||||
+ "HTT: 0x8\n"
|
||||
+ "MAC: 0x10\n"
|
||||
+ "BOOT: 0x20\n"
|
||||
+ "PCI-DUMP: 0x40\n"
|
||||
+ "HTT-DUMP: 0x80\n"
|
||||
+ "MGMT: 0x100\n"
|
||||
+ "DATA: 0x200\n"
|
||||
+ "BMI: 0x400\n"
|
||||
+ "REGULATORY: 0x800\n"
|
||||
+ "TESTMODE: 0x1000\n"
|
||||
+ "WMI-PRINT: 0x2000\n"
|
||||
+ "PCI-PS: 0x4000\n"
|
||||
+ "AHB: 0x8000\n"
|
||||
+ "SDIO: 0x10000\n"
|
||||
+ "SDIO_DUMP: 0x20000\n"
|
||||
+ "USB: 0x40000\n"
|
||||
+ "USB_BULK: 0x80000\n"
|
||||
+ "SNOC: 0x100000\n"
|
||||
+ "QMI: 0x200000\n"
|
||||
+ "BEACONS: 0x8000000\n"
|
||||
+ "NO-FW-DBGLOG:0x10000000\n"
|
||||
+ "MAC2: 0x20000000\n"
|
||||
+ "INFO-AS-DBG: 0x40000000\n"
|
||||
+ "FW: 0x80000000\n"
|
||||
+ "ALL: 0xEFFFFFFF\n";
|
||||
+
|
||||
+#define READ_DEBUG_LEVEL_SIZE sizeof(debug_level_buf) + 60
|
||||
+
|
||||
static ssize_t ath10k_read_debug_level(struct file *file,
|
||||
char __user *user_buf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
- int sz;
|
||||
- const char buf[] =
|
||||
- "To change debug level, set value adding up desired flags:\n"
|
||||
- "PCI: 0x1\n"
|
||||
- "WMI: 0x2\n"
|
||||
- "HTC: 0x4\n"
|
||||
- "HTT: 0x8\n"
|
||||
- "MAC: 0x10\n"
|
||||
- "BOOT: 0x20\n"
|
||||
- "PCI-DUMP: 0x40\n"
|
||||
- "HTT-DUMP: 0x80\n"
|
||||
- "MGMT: 0x100\n"
|
||||
- "DATA: 0x200\n"
|
||||
- "BMI: 0x400\n"
|
||||
- "REGULATORY: 0x800\n"
|
||||
- "TESTMODE: 0x1000\n"
|
||||
- "WMI-PRINT: 0x2000\n"
|
||||
- "PCI-PS: 0x4000\n"
|
||||
- "AHB: 0x8000\n"
|
||||
- "SDIO: 0x10000\n"
|
||||
- "SDIO_DUMP: 0x20000\n"
|
||||
- "USB: 0x40000\n"
|
||||
- "USB_BULK: 0x80000\n"
|
||||
- "SNOC: 0x100000\n"
|
||||
- "QMI: 0x200000\n"
|
||||
- "BEACONS: 0x8000000\n"
|
||||
- "NO-FW-DBGLOG:0x10000000\n"
|
||||
- "MAC2: 0x20000000\n"
|
||||
- "INFO-AS-DBG: 0x40000000\n"
|
||||
- "FW: 0x80000000\n"
|
||||
- "ALL: 0xEFFFFFFF\n";
|
||||
- char wbuf[sizeof(buf) + 60];
|
||||
- sz = snprintf(wbuf, sizeof(wbuf), "Current debug level: 0x%x\n\n%s",
|
||||
- ath10k_debug_mask, buf);
|
||||
- wbuf[sizeof(wbuf) - 1] = 0;
|
||||
+ int sz, ret;
|
||||
+ char *wbuf;
|
||||
+
|
||||
+ wbuf = kcalloc(READ_DEBUG_LEVEL_SIZE, sizeof(char), GFP_KERNEL);
|
||||
+ if (!wbuf)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ sz = snprintf(wbuf, READ_DEBUG_LEVEL_SIZE,
|
||||
+ "Current debug level: 0x%x\n\n%s",
|
||||
+ ath10k_debug_mask, debug_level_buf);
|
||||
+
|
||||
+ ret = simple_read_from_buffer(user_buf, count, ppos, wbuf, sz);
|
||||
+ kfree(wbuf);
|
||||
|
||||
- return simple_read_from_buffer(user_buf, count, ppos, wbuf, sz);
|
||||
+ return ret;
|
||||
}
|
||||
|
||||
/* Set logging level.
|
||||
@ -39,8 +39,8 @@ that the feature is properly initialized:
|
||||
|
||||
Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
|
||||
|
||||
--- a/ath10k-6.4/core.c
|
||||
+++ b/ath10k-6.4/core.c
|
||||
--- a/ath10k-6.7/core.c
|
||||
+++ b/ath10k-6.7/core.c
|
||||
@@ -2869,14 +2869,14 @@ done:
|
||||
static void ath10k_core_fetch_btcoex_dt(struct ath10k *ar)
|
||||
{
|
||||
|
||||
@ -1,108 +1,58 @@
|
||||
From: Sebastian Gottschall <s.gottschall@newmedia-net.de>
|
||||
|
||||
Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 based
|
||||
chipsets with on chipset connected led's using WMI Firmware API. The LED
|
||||
device will get available named as "ath10k-phyX" at sysfs and can be controlled
|
||||
with various triggers. adds also debugfs interface for gpio control.
|
||||
|
||||
This patch is specific for OpenWRt base, as is use old backported package
|
||||
with old wireless source. Support for QCA9984 is removed.
|
||||
Reworked to use ath10k-ct custom source
|
||||
From 8e1debd82466a3fe711784ab37e6b54e56011267 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Gottschall <s.gottschall@dd-wrt.com>
|
||||
Date: Mon, 13 May 2024 17:22:25 +0300
|
||||
Subject: [PATCH] wifi: ath10k: add LED and GPIO controlling support for
|
||||
various chipsets
|
||||
|
||||
Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984
|
||||
based chipsets with on chipset connected led's using WMI Firmware API.
|
||||
The LED device will get available named as "ath10k-phyX" at sysfs and
|
||||
can be controlled with various triggers.
|
||||
Adds also debugfs interface for gpio control.
|
||||
|
||||
Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
|
||||
Reviewed-by: Steve deRosier <derosier@cal-sierra.com>
|
||||
[kvalo: major reorg and cleanup]
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
[ansuel: rebase and small cleanup]
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com
|
||||
---
|
||||
ath10k-6.7/Kconfig | 6 ++
|
||||
ath10k-6.7/Makefile | 1 +
|
||||
ath10k-6.7/core.c | 32 ++++++++
|
||||
ath10k-6.7/core.h | 8 ++
|
||||
ath10k-6.7/hw.h | 1 +
|
||||
ath10k-6.7/leds.c | 90 +++++++++++++++++++++++
|
||||
ath10k-6.7/leds.h | 34 +++++++++
|
||||
ath10k-6.7/mac.c | 1 +
|
||||
ath10k-6.7/wmi-ops.h | 32 ++++++++
|
||||
ath10k-6.7/wmi-tlv.c | 2 +
|
||||
ath10k-6.7/wmi.c | 54 ++++++++++++++
|
||||
ath10k-6.7/wmi.h | 35 +++++++++
|
||||
12 files changed, 296 insertions(+)
|
||||
create mode 100644 ath10k-6.7/leds.c
|
||||
create mode 100644 ath10k-6.7/leds.h
|
||||
|
||||
v13:
|
||||
|
||||
* only compile tested!
|
||||
|
||||
* fix all checkpatch warnings
|
||||
|
||||
* fix commit log
|
||||
|
||||
* sizeof(struct ath10k_gpiocontrol) -> sizeof(*gpio)
|
||||
|
||||
* unsigned -> unsigned int
|
||||
|
||||
* remove GPIOLIB code, that should be added in a separate patch
|
||||
|
||||
* rename gpio.c to leds.c
|
||||
|
||||
* add leds.h
|
||||
|
||||
* rename some functions:
|
||||
|
||||
ath10k_attach_led() -> ath10k_leds_register()
|
||||
ath10k_unregister_led() -> ath10k_leds_unregister()
|
||||
ath10k_reset_led_pin() -> ath10k_leds_start()
|
||||
|
||||
* call ath10k_leds_unregister() before ath10k_thermal_unregister() to preserve ordering
|
||||
|
||||
* call ath10k_leds_start() only from ath10k_core_start() and not from mac.c
|
||||
|
||||
* rename struct ath10k_gpiocontrol as anonymous function under struct
|
||||
ath10k::leds, no need for memory allocation
|
||||
|
||||
* merge ath10k_add_led() to ath10k_attach_led(), which is it's only caller
|
||||
|
||||
* remove #if IS_ENABLED() checks from most of places, memory savings from those were not worth it
|
||||
|
||||
* Kconfig help text improvement and move it lower in the menu, also don't enable it by default
|
||||
|
||||
* switch to set_brightness_blocking() so that the callback can sleep,
|
||||
then no need to use ath10k_wmi_cmd_send_nowait() and can take mutex
|
||||
to access ar->state
|
||||
|
||||
* don't touch ath10k_wmi_pdev_get_temperature()
|
||||
|
||||
* as QCA6174/QCA9377 are not (yet) supported don't add the command to WMI-TLV interface
|
||||
|
||||
* remove debugfs interface, that should be added in another patch
|
||||
|
||||
* cleanup includes
|
||||
|
||||
ath10k-6.4/Kconfig | 10 +++
|
||||
ath10k-6.4/Makefile | 1 +
|
||||
ath10k-6.4/core.c | 22 +++++++
|
||||
ath10k-6.4/core.h | 9 ++-
|
||||
ath10k-6.4/hw.h | 1 +
|
||||
ath10k-6.4/leds.c | 103 ++++++++++++++++++++++++++++++
|
||||
ath10k-6.4/leds.h | 45 +++++++++++++
|
||||
ath10k-6.4/mac.c | 1 +
|
||||
ath10k-6.4/wmi-ops.h | 32 ++++++++++
|
||||
ath10k-6.4/wmi-tlv.c | 2 +
|
||||
ath10k-6.4/wmi.c | 54 ++++++++++++++++
|
||||
ath10k-6.4/wmi.h | 35 ++++++++++
|
||||
12 files changed, 314 insertions(+), 1 deletion(-)
|
||||
create mode 100644 ath10k-6.4/leds.c
|
||||
create mode 100644 ath10k-6.4/leds.h
|
||||
|
||||
--- a/ath10k-6.4/Kconfig
|
||||
+++ b/ath10k-6.4/Kconfig
|
||||
@@ -67,6 +67,16 @@ config ATH10K_DEBUGFS
|
||||
--- a/ath10k-6.7/Kconfig
|
||||
+++ b/ath10k-6.7/Kconfig
|
||||
@@ -67,6 +67,12 @@ config ATH10K_DEBUGFS
|
||||
|
||||
If unsure, say Y to make it easier to debug problems.
|
||||
|
||||
+config ATH10K_LEDS
|
||||
+ bool "Atheros ath10k LED support"
|
||||
+ bool
|
||||
+ depends on ATH10K
|
||||
+ select MAC80211_LEDS
|
||||
+ select LEDS_CLASS
|
||||
+ select NEW_LEDS
|
||||
+ depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211
|
||||
+ default y
|
||||
+ ---help---
|
||||
+ This option is necessary, if you want LED support for chipset connected led pins. If unsure, say N.
|
||||
+
|
||||
config ATH10K_SPECTRAL
|
||||
bool "Atheros ath10k spectral scan support"
|
||||
depends on ATH10K_DEBUGFS
|
||||
--- a/ath10k-6.4/Makefile
|
||||
+++ b/ath10k-6.4/Makefile
|
||||
--- a/ath10k-6.7/Makefile
|
||||
+++ b/ath10k-6.7/Makefile
|
||||
@@ -20,6 +20,7 @@ ath10k_core-$(CONFIG_ATH10K_SPECTRAL) +=
|
||||
ath10k_core-$(CONFIG_NL80211_TESTMODE) += testmode.o
|
||||
ath10k_core-$(CONFIG_ATH10K_TRACING) += trace.o
|
||||
@ -111,8 +61,8 @@ v13:
|
||||
ath10k_core-$(CONFIG_MAC80211_DEBUGFS) += debugfs_sta.o
|
||||
ath10k_core-$(CONFIG_PM) += wow.o
|
||||
ath10k_core-$(CONFIG_ATH10K_CE) += ce.o
|
||||
--- a/ath10k-6.4/core.c
|
||||
+++ b/ath10k-6.4/core.c
|
||||
--- a/ath10k-6.7/core.c
|
||||
+++ b/ath10k-6.7/core.c
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "testmode.h"
|
||||
#include "wmi-ops.h"
|
||||
@ -121,47 +71,135 @@ v13:
|
||||
|
||||
/* Disable ath10k-ct DBGLOG output by default */
|
||||
unsigned int ath10k_debug_mask = ATH10K_DBG_NO_DBGLOG;
|
||||
@@ -78,6 +79,7 @@ static const struct ath10k_hw_params ath
|
||||
.dev_id = QCA988X_2_0_DEVICE_ID,
|
||||
.bus = ATH10K_BUS_PCI,
|
||||
@@ -80,6 +81,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca988x hw2.0",
|
||||
+ .led_pin = 1,
|
||||
.patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 7,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
|
||||
@@ -159,6 +161,7 @@ static const struct ath10k_hw_params ath
|
||||
.dev_id = QCA9887_1_0_DEVICE_ID,
|
||||
.bus = ATH10K_BUS_PCI,
|
||||
.name = "qca9887 hw1.0",
|
||||
+ .led_pin = 1,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
@@ -120,6 +122,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca988x hw2.0 ubiquiti",
|
||||
.patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 7,
|
||||
+ .led_pin = 0,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
@@ -161,6 +164,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca9887 hw1.0",
|
||||
.patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 7,
|
||||
+ .led_pin = 1,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
|
||||
@@ -400,6 +403,7 @@ static const struct ath10k_hw_params ath
|
||||
.dev_id = QCA99X0_2_0_DEVICE_ID,
|
||||
.bus = ATH10K_BUS_PCI,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
@@ -202,6 +206,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca6174 hw3.2 sdio",
|
||||
.patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 19,
|
||||
+ .led_pin = 0,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
.max_probe_resp_desc_thres = 0,
|
||||
@@ -238,6 +243,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca6164 hw2.1",
|
||||
.patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 6,
|
||||
+ .led_pin = 0,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
.max_probe_resp_desc_thres = 0,
|
||||
@@ -278,6 +284,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca6174 hw2.1",
|
||||
.patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 6,
|
||||
+ .led_pin = 0,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
.max_probe_resp_desc_thres = 0,
|
||||
@@ -318,6 +325,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca6174 hw3.0",
|
||||
.patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 6,
|
||||
+ .led_pin = 0,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
.max_probe_resp_desc_thres = 0,
|
||||
@@ -358,6 +366,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca6174 hw3.2",
|
||||
.patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 6,
|
||||
+ .led_pin = 0,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
.max_probe_resp_desc_thres = 0,
|
||||
@@ -402,6 +411,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca99x0 hw2.0",
|
||||
+ .led_pin = 17,
|
||||
.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 7,
|
||||
.otp_exe_param = 0x00000700,
|
||||
@@ -446,6 +450,7 @@ static const struct ath10k_hw_params ath
|
||||
.dev_id = QCA9984_1_0_DEVICE_ID,
|
||||
.bus = ATH10K_BUS_PCI,
|
||||
.name = "qca9984/qca9994 hw1.0",
|
||||
+ .led_pin = 17,
|
||||
.otp_exe_param = 0x00000700,
|
||||
.continuous_frag_desc = true,
|
||||
.cck_rate_map_rev2 = true,
|
||||
@@ -448,6 +458,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca9984/qca9994 hw1.0",
|
||||
.patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 7,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
|
||||
@@ -499,6 +504,7 @@ static const struct ath10k_hw_params ath
|
||||
.dev_id = QCA9888_2_0_DEVICE_ID,
|
||||
.bus = ATH10K_BUS_PCI,
|
||||
.name = "qca9888 hw2.0",
|
||||
+ .led_pin = 17,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
|
||||
.otp_exe_param = 0x00000700,
|
||||
.continuous_frag_desc = true,
|
||||
@@ -501,6 +512,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca9888 hw2.0",
|
||||
.patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 7,
|
||||
+ .led_pin = 17,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
|
||||
@@ -4080,6 +4086,10 @@ int ath10k_core_start(struct ath10k *ar,
|
||||
.otp_exe_param = 0x00000700,
|
||||
.continuous_frag_desc = true,
|
||||
@@ -551,6 +563,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca9377 hw1.0",
|
||||
.patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 6,
|
||||
+ .led_pin = 0,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
.max_probe_resp_desc_thres = 0,
|
||||
@@ -591,6 +604,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca9377 hw1.1",
|
||||
.patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 6,
|
||||
+ .led_pin = 0,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
.max_probe_resp_desc_thres = 0,
|
||||
@@ -633,6 +647,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca9377 hw1.1 sdio",
|
||||
.patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 19,
|
||||
+ .led_pin = 0,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
.max_probe_resp_desc_thres = 0,
|
||||
@@ -666,6 +681,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca4019 hw1.0",
|
||||
.patch_load_addr = QCA4019_HW_1_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 7,
|
||||
+ .led_pin = 0,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
|
||||
.otp_exe_param = 0x0010000,
|
||||
.continuous_frag_desc = true,
|
||||
@@ -711,6 +727,7 @@ static const struct ath10k_hw_params ath
|
||||
.dev_id = 0,
|
||||
.bus = ATH10K_BUS_SNOC,
|
||||
.name = "wcn3990 hw1.0",
|
||||
+ .led_pin = 0,
|
||||
.continuous_frag_desc = true,
|
||||
.tx_chain_mask = 0x7,
|
||||
.rx_chain_mask = 0x7,
|
||||
@@ -4071,6 +4088,10 @@ int ath10k_core_start(struct ath10k *ar,
|
||||
ath10k_wmi_check_apply_board_power_ctl_table(ar);
|
||||
}
|
||||
|
||||
@ -172,7 +210,7 @@ v13:
|
||||
return 0;
|
||||
|
||||
err_hif_stop:
|
||||
@@ -4341,9 +4351,18 @@ static void ath10k_core_register_work(st
|
||||
@@ -4332,9 +4353,18 @@ static void ath10k_core_register_work(st
|
||||
goto err_spectral_destroy;
|
||||
}
|
||||
|
||||
@ -191,7 +229,7 @@ v13:
|
||||
err_spectral_destroy:
|
||||
ath10k_spectral_destroy(ar);
|
||||
err_debug_destroy:
|
||||
@@ -4403,6 +4422,8 @@ void ath10k_core_unregister(struct ath10
|
||||
@@ -4394,6 +4424,8 @@ void ath10k_core_unregister(struct ath10
|
||||
if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
|
||||
return;
|
||||
|
||||
@ -200,8 +238,8 @@ v13:
|
||||
ath10k_thermal_unregister(ar);
|
||||
/* Stop spectral before unregistering from mac80211 to remove the
|
||||
* relayfs debugfs file cleanly. Otherwise the parent debugfs tree
|
||||
--- a/ath10k-6.4/core.h
|
||||
+++ b/ath10k-6.4/core.h
|
||||
--- a/ath10k-6.7/core.h
|
||||
+++ b/ath10k-6.7/core.h
|
||||
@@ -14,6 +14,7 @@
|
||||
#include <linux/pci.h>
|
||||
#include <linux/uuid.h>
|
||||
@ -210,7 +248,7 @@ v13:
|
||||
|
||||
#include "htt.h"
|
||||
#include "htc.h"
|
||||
@@ -1586,6 +1587,13 @@ struct ath10k {
|
||||
@@ -1589,6 +1590,13 @@ struct ath10k {
|
||||
} testmode;
|
||||
|
||||
struct {
|
||||
@ -224,8 +262,8 @@ v13:
|
||||
/* protected by data_lock */
|
||||
u32 rx_crc_err_drop;
|
||||
u32 fw_crash_counter;
|
||||
--- a/ath10k-6.4/hw.h
|
||||
+++ b/ath10k-6.4/hw.h
|
||||
--- a/ath10k-6.7/hw.h
|
||||
+++ b/ath10k-6.7/hw.h
|
||||
@@ -523,6 +523,7 @@ struct ath10k_hw_params {
|
||||
const char *name;
|
||||
u32 patch_load_addr;
|
||||
@ -235,25 +273,14 @@ v13:
|
||||
|
||||
/* Type of hw cycle counter wraparound logic, for more info
|
||||
--- /dev/null
|
||||
+++ b/ath10k-6.4/leds.c
|
||||
@@ -0,0 +1,103 @@
|
||||
+++ b/ath10k-6.7/leds.c
|
||||
@@ -0,0 +1,90 @@
|
||||
+// SPDX-License-Identifier: ISC
|
||||
+/*
|
||||
+ * Copyright (c) 2005-2011 Atheros Communications Inc.
|
||||
+ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
|
||||
+ * Copyright (c) 2018 Sebastian Gottschall <s.gottschall@dd-wrt.com>
|
||||
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
|
||||
+ *
|
||||
+ * Permission to use, copy, modify, and/or distribute this software for any
|
||||
+ * purpose with or without fee is hereby granted, provided that the above
|
||||
+ * copyright notice and this permission notice appear in all copies.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
+ * Copyright (c) 2018 The Linux Foundation. All rights reserved.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/leds.h>
|
||||
@ -320,8 +347,6 @@ v13:
|
||||
+
|
||||
+ ar->leds.cdev.name = ar->leds.label;
|
||||
+ ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
|
||||
+
|
||||
+ /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
|
||||
+ ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
|
||||
+
|
||||
+ ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
|
||||
@ -341,23 +366,16 @@ v13:
|
||||
+}
|
||||
+
|
||||
--- /dev/null
|
||||
+++ b/ath10k-6.4/leds.h
|
||||
@@ -0,0 +1,41 @@
|
||||
+++ b/ath10k-6.7/leds.h
|
||||
@@ -0,0 +1,34 @@
|
||||
+/* SPDX-License-Identifier: ISC */
|
||||
+/*
|
||||
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
|
||||
+ *
|
||||
+ * Permission to use, copy, modify, and/or distribute this software for any
|
||||
+ * purpose with or without fee is hereby granted, provided that the above
|
||||
+ * copyright notice and this permission notice appear in all copies.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
+ * Copyright (c) 2005-2011 Atheros Communications Inc.
|
||||
+ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
|
||||
+ * Copyright (c) 2018 Sebastian Gottschall <s.gottschall@dd-wrt.com>
|
||||
+ * Copyright (c) 2018 The Linux Foundation. All rights reserved.
|
||||
+ */
|
||||
+
|
||||
+#ifndef _LEDS_H_
|
||||
+#define _LEDS_H_
|
||||
+
|
||||
@ -384,8 +402,8 @@ v13:
|
||||
+
|
||||
+#endif
|
||||
+#endif /* _LEDS_H_ */
|
||||
--- a/ath10k-6.4/mac.c
|
||||
+++ b/ath10k-6.4/mac.c
|
||||
--- a/ath10k-6.7/mac.c
|
||||
+++ b/ath10k-6.7/mac.c
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "wmi-tlv.h"
|
||||
#include "wmi-ops.h"
|
||||
@ -394,8 +412,8 @@ v13:
|
||||
|
||||
/*********/
|
||||
/* Rates */
|
||||
--- a/ath10k-6.4/wmi-ops.h
|
||||
+++ b/ath10k-6.4/wmi-ops.h
|
||||
--- a/ath10k-6.7/wmi-ops.h
|
||||
+++ b/ath10k-6.7/wmi-ops.h
|
||||
@@ -228,7 +228,10 @@ struct wmi_ops {
|
||||
const struct wmi_bb_timing_cfg_arg *arg);
|
||||
struct sk_buff *(*gen_per_peer_per_tid_cfg)(struct ath10k *ar,
|
||||
@ -443,8 +461,8 @@ v13:
|
||||
static inline int
|
||||
ath10k_wmi_dbglog_cfg(struct ath10k *ar, u64 module_enable, u32 log_level)
|
||||
{
|
||||
--- a/ath10k-6.4/wmi-tlv.c
|
||||
+++ b/ath10k-6.4/wmi-tlv.c
|
||||
--- a/ath10k-6.7/wmi-tlv.c
|
||||
+++ b/ath10k-6.7/wmi-tlv.c
|
||||
@@ -4601,6 +4601,8 @@ static const struct wmi_ops wmi_tlv_ops
|
||||
.gen_echo = ath10k_wmi_tlv_op_gen_echo,
|
||||
.gen_vdev_spectral_conf = ath10k_wmi_tlv_op_gen_vdev_spectral_conf,
|
||||
@ -454,9 +472,9 @@ v13:
|
||||
};
|
||||
|
||||
static const struct wmi_peer_flags_map wmi_tlv_peer_flags_map = {
|
||||
--- a/ath10k-6.4/wmi.c
|
||||
+++ b/ath10k-6.4/wmi.c
|
||||
@@ -8438,6 +8438,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
|
||||
--- a/ath10k-6.7/wmi.c
|
||||
+++ b/ath10k-6.7/wmi.c
|
||||
@@ -8446,6 +8446,49 @@ ath10k_wmi_op_gen_peer_set_param(struct
|
||||
return skb;
|
||||
}
|
||||
|
||||
@ -506,7 +524,7 @@ v13:
|
||||
static struct sk_buff *
|
||||
ath10k_wmi_op_gen_set_psmode(struct ath10k *ar, u32 vdev_id,
|
||||
enum wmi_sta_ps_mode psmode)
|
||||
@@ -10269,6 +10312,9 @@ static const struct wmi_ops wmi_ops = {
|
||||
@@ -10255,6 +10298,9 @@ static const struct wmi_ops wmi_ops = {
|
||||
.fw_stats_fill = ath10k_wmi_main_op_fw_stats_fill,
|
||||
.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
|
||||
.gen_echo = ath10k_wmi_op_gen_echo,
|
||||
@ -516,7 +534,7 @@ v13:
|
||||
/* .gen_bcn_tmpl not implemented */
|
||||
/* .gen_prb_tmpl not implemented */
|
||||
/* .gen_p2p_go_bcn_ie not implemented */
|
||||
@@ -10339,6 +10385,8 @@ static const struct wmi_ops wmi_10_1_ops
|
||||
@@ -10325,6 +10371,8 @@ static const struct wmi_ops wmi_10_1_ops
|
||||
.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
|
||||
.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
|
||||
.gen_echo = ath10k_wmi_op_gen_echo,
|
||||
@ -525,7 +543,7 @@ v13:
|
||||
/* .gen_bcn_tmpl not implemented */
|
||||
/* .gen_prb_tmpl not implemented */
|
||||
/* .gen_p2p_go_bcn_ie not implemented */
|
||||
@@ -10418,6 +10466,8 @@ static const struct wmi_ops wmi_10_2_ops
|
||||
@@ -10404,6 +10452,8 @@ static const struct wmi_ops wmi_10_2_ops
|
||||
.gen_delba_send = ath10k_wmi_op_gen_delba_send,
|
||||
.fw_stats_fill = ath10k_wmi_10x_op_fw_stats_fill,
|
||||
.get_vdev_subtype = ath10k_wmi_op_get_vdev_subtype,
|
||||
@ -534,7 +552,7 @@ v13:
|
||||
/* .gen_pdev_enable_adaptive_cca not implemented */
|
||||
};
|
||||
|
||||
@@ -10489,6 +10539,8 @@ static const struct wmi_ops wmi_10_2_4_o
|
||||
@@ -10475,6 +10525,8 @@ static const struct wmi_ops wmi_10_2_4_o
|
||||
ath10k_wmi_op_gen_pdev_enable_adaptive_cca,
|
||||
.get_vdev_subtype = ath10k_wmi_10_2_4_op_get_vdev_subtype,
|
||||
.gen_bb_timing = ath10k_wmi_10_2_4_op_gen_bb_timing,
|
||||
@ -543,7 +561,7 @@ v13:
|
||||
/* .gen_bcn_tmpl not implemented */
|
||||
/* .gen_prb_tmpl not implemented */
|
||||
/* .gen_p2p_go_bcn_ie not implemented */
|
||||
@@ -10571,6 +10623,8 @@ static const struct wmi_ops wmi_10_4_ops
|
||||
@@ -10557,6 +10609,8 @@ static const struct wmi_ops wmi_10_4_ops
|
||||
.gen_pdev_bss_chan_info_req = ath10k_wmi_10_2_op_gen_pdev_bss_chan_info,
|
||||
.gen_echo = ath10k_wmi_op_gen_echo,
|
||||
.gen_pdev_get_tpc_config = ath10k_wmi_10_2_4_op_gen_pdev_get_tpc_config,
|
||||
@ -552,8 +570,8 @@ v13:
|
||||
};
|
||||
|
||||
int ath10k_wmi_attach(struct ath10k *ar)
|
||||
--- a/ath10k-6.4/wmi.h
|
||||
+++ b/ath10k-6.4/wmi.h
|
||||
--- a/ath10k-6.7/wmi.h
|
||||
+++ b/ath10k-6.7/wmi.h
|
||||
@@ -3133,6 +3133,41 @@ enum wmi_10_4_feature_mask {
|
||||
|
||||
};
|
||||
@ -9,14 +9,14 @@ traffic.
|
||||
|
||||
Signed-off-by: Mathias Kresin <dev@kresin.me>
|
||||
---
|
||||
ath10k-6.4/core.h | 4 ++++
|
||||
ath10k-6.4/leds.c | 4 +---
|
||||
ath10k-6.4/mac.c | 2 +-
|
||||
ath10k-6.7/core.h | 4 ++++
|
||||
ath10k-6.7/leds.c | 4 +---
|
||||
ath10k-6.7/mac.c | 2 +-
|
||||
3 files changed, 6 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/ath10k-6.4/core.h
|
||||
+++ b/ath10k-6.4/core.h
|
||||
@@ -1701,6 +1701,10 @@ struct ath10k {
|
||||
--- a/ath10k-6.7/core.h
|
||||
+++ b/ath10k-6.7/core.h
|
||||
@@ -1704,6 +1704,10 @@ struct ath10k {
|
||||
u8 csi_data[4096];
|
||||
u16 csi_data_len;
|
||||
|
||||
@ -27,22 +27,20 @@ Signed-off-by: Mathias Kresin <dev@kresin.me>
|
||||
/* must be last */
|
||||
u8 drv_priv[] __aligned(sizeof(void *));
|
||||
};
|
||||
--- a/ath10k-6.4/leds.c
|
||||
+++ b/ath10k-6.4/leds.c
|
||||
@@ -81,9 +81,7 @@ int ath10k_leds_register(struct ath10k *
|
||||
--- a/ath10k-6.7/leds.c
|
||||
+++ b/ath10k-6.7/leds.c
|
||||
@@ -70,7 +70,7 @@ int ath10k_leds_register(struct ath10k *
|
||||
|
||||
ar->leds.cdev.name = ar->leds.label;
|
||||
ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
|
||||
-
|
||||
- /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
|
||||
- ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
|
||||
+ ar->leds.cdev.default_trigger = ar->led_default_trigger;
|
||||
|
||||
ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
|
||||
if (ret)
|
||||
--- a/ath10k-6.4/mac.c
|
||||
+++ b/ath10k-6.4/mac.c
|
||||
@@ -11616,7 +11616,7 @@ int ath10k_mac_register(struct ath10k *a
|
||||
--- a/ath10k-6.7/mac.c
|
||||
+++ b/ath10k-6.7/mac.c
|
||||
@@ -11622,7 +11622,7 @@ int ath10k_mac_register(struct ath10k *a
|
||||
ar->hw->weight_multiplier = ATH10K_AIRTIME_WEIGHT_MULTIPLIER;
|
||||
|
||||
#ifdef CPTCFG_MAC80211_LEDS
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
--- a/ath10k-6.4/wmi.h
|
||||
+++ b/ath10k-6.4/wmi.h
|
||||
--- a/ath10k-6.7/wmi.h
|
||||
+++ b/ath10k-6.7/wmi.h
|
||||
@@ -6341,7 +6341,7 @@ struct qca9880_set_ctl_table_cmd {
|
||||
__le32 ctl_len; /* in bytes. This may be ignored in firmware,
|
||||
* make sure ctl_info data is sizeof(qca9880_power_ctl) */
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
--- a/ath10k-6.4/htt.h
|
||||
+++ b/ath10k-6.4/htt.h
|
||||
--- a/ath10k-6.7/htt.h
|
||||
+++ b/ath10k-6.7/htt.h
|
||||
@@ -237,7 +237,11 @@ enum htt_rx_ring_flags {
|
||||
};
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
--- a/ath10k-6.4/pci.c
|
||||
+++ b/ath10k-6.4/pci.c
|
||||
--- a/ath10k-6.7/pci.c
|
||||
+++ b/ath10k-6.7/pci.c
|
||||
@@ -131,7 +131,11 @@ static const struct ce_attr pci_host_ce_
|
||||
.flags = CE_ATTR_FLAGS,
|
||||
.src_nentries = 0,
|
||||
|
||||
@ -13,12 +13,12 @@ own loss detection mechanism.
|
||||
|
||||
Signed-off-by: David Bauer <mail@david-bauer.net>
|
||||
---
|
||||
ath10k-6.4/mac.c | 1 -
|
||||
ath10k-6.7/mac.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
--- a/ath10k-6.4/mac.c
|
||||
+++ b/ath10k-6.4/mac.c
|
||||
@@ -11305,7 +11305,6 @@ int ath10k_mac_register(struct ath10k *a
|
||||
--- a/ath10k-6.7/mac.c
|
||||
+++ b/ath10k-6.7/mac.c
|
||||
@@ -11311,7 +11311,6 @@ int ath10k_mac_register(struct ath10k *a
|
||||
ieee80211_hw_set(ar->hw, CHANCTX_STA_CSA);
|
||||
ieee80211_hw_set(ar->hw, QUEUE_CONTROL);
|
||||
ieee80211_hw_set(ar->hw, SUPPORTS_TX_FRAG);
|
||||
|
||||
@ -1,103 +1,52 @@
|
||||
From: Sebastian Gottschall <s.gottschall@newmedia-net.de>
|
||||
|
||||
Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984 based
|
||||
chipsets with on chipset connected led's using WMI Firmware API. The LED
|
||||
device will get available named as "ath10k-phyX" at sysfs and can be controlled
|
||||
with various triggers. adds also debugfs interface for gpio control.
|
||||
|
||||
This patch is specific for OpenWRt base, as is use old backported package
|
||||
with old wireless source. Support for QCA9984 is removed and a simbol
|
||||
is added to local-simbol file to export the actually compile the code
|
||||
with the ATH10K_LEDS simbol.
|
||||
From 8e1debd82466a3fe711784ab37e6b54e56011267 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Gottschall <s.gottschall@dd-wrt.com>
|
||||
Date: Mon, 13 May 2024 17:22:25 +0300
|
||||
Subject: [PATCH] wifi: ath10k: add LED and GPIO controlling support for
|
||||
various chipsets
|
||||
|
||||
Adds LED and GPIO Control support for 988x, 9887, 9888, 99x0, 9984
|
||||
based chipsets with on chipset connected led's using WMI Firmware API.
|
||||
The LED device will get available named as "ath10k-phyX" at sysfs and
|
||||
can be controlled with various triggers.
|
||||
Adds also debugfs interface for gpio control.
|
||||
|
||||
Signed-off-by: Sebastian Gottschall <s.gottschall@dd-wrt.com>
|
||||
Reviewed-by: Steve deRosier <derosier@cal-sierra.com>
|
||||
[kvalo: major reorg and cleanup]
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
[ansuel: rebase and small cleanup]
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
|
||||
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
|
||||
Link: https://msgid.link/20230611080505.17393-1-ansuelsmth@gmail.com
|
||||
---
|
||||
|
||||
v13:
|
||||
|
||||
* only compile tested!
|
||||
|
||||
* fix all checkpatch warnings
|
||||
|
||||
* fix commit log
|
||||
|
||||
* sizeof(struct ath10k_gpiocontrol) -> sizeof(*gpio)
|
||||
|
||||
* unsigned -> unsigned int
|
||||
|
||||
* remove GPIOLIB code, that should be added in a separate patch
|
||||
|
||||
* rename gpio.c to leds.c
|
||||
|
||||
* add leds.h
|
||||
|
||||
* rename some functions:
|
||||
|
||||
ath10k_attach_led() -> ath10k_leds_register()
|
||||
ath10k_unregister_led() -> ath10k_leds_unregister()
|
||||
ath10k_reset_led_pin() -> ath10k_leds_start()
|
||||
|
||||
* call ath10k_leds_unregister() before ath10k_thermal_unregister() to preserve ordering
|
||||
|
||||
* call ath10k_leds_start() only from ath10k_core_start() and not from mac.c
|
||||
|
||||
* rename struct ath10k_gpiocontrol as anonymous function under struct
|
||||
ath10k::leds, no need for memory allocation
|
||||
|
||||
* merge ath10k_add_led() to ath10k_attach_led(), which is it's only caller
|
||||
|
||||
* remove #if IS_ENABLED() checks from most of places, memory savings from those were not worth it
|
||||
|
||||
* Kconfig help text improvement and move it lower in the menu, also don't enable it by default
|
||||
|
||||
* switch to set_brightness_blocking() so that the callback can sleep,
|
||||
then no need to use ath10k_wmi_cmd_send_nowait() and can take mutex
|
||||
to access ar->state
|
||||
|
||||
* don't touch ath10k_wmi_pdev_get_temperature()
|
||||
|
||||
* as QCA6174/QCA9377 are not (yet) supported don't add the command to WMI-TLV interface
|
||||
|
||||
* remove debugfs interface, that should be added in another patch
|
||||
|
||||
* cleanup includes
|
||||
|
||||
|
||||
drivers/net/wireless/ath/ath10k/Kconfig | 10 +++
|
||||
drivers/net/wireless/ath/ath10k/Makefile | 1 +
|
||||
drivers/net/wireless/ath/ath10k/core.c | 22 +++++++
|
||||
drivers/net/wireless/ath/ath10k/core.h | 9 ++-
|
||||
drivers/net/wireless/ath/ath10k/hw.h | 1 +
|
||||
drivers/net/wireless/ath/ath10k/leds.c | 103 ++++++++++++++++++++++++++++++
|
||||
drivers/net/wireless/ath/ath10k/leds.h | 45 +++++++++++++
|
||||
drivers/net/wireless/ath/ath10k/mac.c | 1 +
|
||||
drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++++
|
||||
drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 +
|
||||
drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++++
|
||||
drivers/net/wireless/ath/ath10k/wmi.h | 35 ++++++++++
|
||||
12 files changed, 314 insertions(+), 1 deletion(-)
|
||||
drivers/net/wireless/ath/ath10k/Kconfig | 6 ++
|
||||
drivers/net/wireless/ath/ath10k/Makefile | 1 +
|
||||
drivers/net/wireless/ath/ath10k/core.c | 32 ++++++++
|
||||
drivers/net/wireless/ath/ath10k/core.h | 8 ++
|
||||
drivers/net/wireless/ath/ath10k/hw.h | 1 +
|
||||
drivers/net/wireless/ath/ath10k/leds.c | 90 +++++++++++++++++++++++
|
||||
drivers/net/wireless/ath/ath10k/leds.h | 34 +++++++++
|
||||
drivers/net/wireless/ath/ath10k/mac.c | 1 +
|
||||
drivers/net/wireless/ath/ath10k/wmi-ops.h | 32 ++++++++
|
||||
drivers/net/wireless/ath/ath10k/wmi-tlv.c | 2 +
|
||||
drivers/net/wireless/ath/ath10k/wmi.c | 54 ++++++++++++++
|
||||
drivers/net/wireless/ath/ath10k/wmi.h | 35 +++++++++
|
||||
12 files changed, 296 insertions(+)
|
||||
create mode 100644 drivers/net/wireless/ath/ath10k/leds.c
|
||||
create mode 100644 drivers/net/wireless/ath/ath10k/leds.h
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath10k/Kconfig
|
||||
+++ b/drivers/net/wireless/ath/ath10k/Kconfig
|
||||
@@ -72,6 +72,16 @@ config ATH10K_DEBUGFS
|
||||
@@ -72,6 +72,12 @@ config ATH10K_DEBUGFS
|
||||
|
||||
If unsure, say Y to make it easier to debug problems.
|
||||
|
||||
+config ATH10K_LEDS
|
||||
+ bool "Atheros ath10k LED support"
|
||||
+ bool
|
||||
+ depends on ATH10K
|
||||
+ select MAC80211_LEDS
|
||||
+ select LEDS_CLASS
|
||||
+ select NEW_LEDS
|
||||
+ depends on LEDS_CLASS=y || LEDS_CLASS=MAC80211
|
||||
+ default y
|
||||
+ ---help---
|
||||
+ This option is necessary, if you want LED support for chipset connected led pins. If unsure, say N.
|
||||
+
|
||||
config ATH10K_SPECTRAL
|
||||
bool "Atheros ath10k spectral scan support"
|
||||
@ -132,47 +81,135 @@ v13:
|
||||
|
||||
unsigned int ath10k_debug_mask;
|
||||
EXPORT_SYMBOL(ath10k_debug_mask);
|
||||
@@ -65,6 +66,7 @@ static const struct ath10k_hw_params ath
|
||||
.dev_id = QCA988X_2_0_DEVICE_ID,
|
||||
.bus = ATH10K_BUS_PCI,
|
||||
@@ -67,6 +68,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca988x hw2.0",
|
||||
+ .led_pin = 1,
|
||||
.patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 7,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
|
||||
@@ -146,6 +148,7 @@ static const struct ath10k_hw_params ath
|
||||
.dev_id = QCA9887_1_0_DEVICE_ID,
|
||||
.bus = ATH10K_BUS_PCI,
|
||||
.name = "qca9887 hw1.0",
|
||||
+ .led_pin = 1,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
@@ -107,6 +109,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca988x hw2.0 ubiquiti",
|
||||
.patch_load_addr = QCA988X_HW_2_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 7,
|
||||
+ .led_pin = 0,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
@@ -148,6 +151,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca9887 hw1.0",
|
||||
.patch_load_addr = QCA9887_HW_1_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 7,
|
||||
+ .led_pin = 1,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_ALL,
|
||||
@@ -387,6 +390,7 @@ static const struct ath10k_hw_params ath
|
||||
.dev_id = QCA99X0_2_0_DEVICE_ID,
|
||||
.bus = ATH10K_BUS_PCI,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
@@ -189,6 +193,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca6174 hw3.2 sdio",
|
||||
.patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 19,
|
||||
+ .led_pin = 0,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
.max_probe_resp_desc_thres = 0,
|
||||
@@ -225,6 +230,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca6164 hw2.1",
|
||||
.patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 6,
|
||||
+ .led_pin = 0,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
.max_probe_resp_desc_thres = 0,
|
||||
@@ -265,6 +271,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca6174 hw2.1",
|
||||
.patch_load_addr = QCA6174_HW_2_1_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 6,
|
||||
+ .led_pin = 0,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
.max_probe_resp_desc_thres = 0,
|
||||
@@ -305,6 +312,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca6174 hw3.0",
|
||||
.patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 6,
|
||||
+ .led_pin = 0,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
.max_probe_resp_desc_thres = 0,
|
||||
@@ -345,6 +353,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca6174 hw3.2",
|
||||
.patch_load_addr = QCA6174_HW_3_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 6,
|
||||
+ .led_pin = 0,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
.max_probe_resp_desc_thres = 0,
|
||||
@@ -389,6 +398,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca99x0 hw2.0",
|
||||
+ .led_pin = 17,
|
||||
.patch_load_addr = QCA99X0_HW_2_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 7,
|
||||
.otp_exe_param = 0x00000700,
|
||||
@@ -433,6 +437,7 @@ static const struct ath10k_hw_params ath
|
||||
.dev_id = QCA9984_1_0_DEVICE_ID,
|
||||
.bus = ATH10K_BUS_PCI,
|
||||
.name = "qca9984/qca9994 hw1.0",
|
||||
+ .led_pin = 17,
|
||||
.otp_exe_param = 0x00000700,
|
||||
.continuous_frag_desc = true,
|
||||
.cck_rate_map_rev2 = true,
|
||||
@@ -435,6 +445,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca9984/qca9994 hw1.0",
|
||||
.patch_load_addr = QCA9984_HW_1_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 7,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
|
||||
@@ -486,6 +491,7 @@ static const struct ath10k_hw_params ath
|
||||
.dev_id = QCA9888_2_0_DEVICE_ID,
|
||||
.bus = ATH10K_BUS_PCI,
|
||||
.name = "qca9888 hw2.0",
|
||||
+ .led_pin = 17,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
|
||||
.otp_exe_param = 0x00000700,
|
||||
.continuous_frag_desc = true,
|
||||
@@ -488,6 +499,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca9888 hw2.0",
|
||||
.patch_load_addr = QCA9888_HW_2_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 7,
|
||||
+ .led_pin = 17,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
|
||||
@@ -3222,6 +3228,10 @@ int ath10k_core_start(struct ath10k *ar,
|
||||
.otp_exe_param = 0x00000700,
|
||||
.continuous_frag_desc = true,
|
||||
@@ -538,6 +550,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca9377 hw1.0",
|
||||
.patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 6,
|
||||
+ .led_pin = 0,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
.max_probe_resp_desc_thres = 0,
|
||||
@@ -578,6 +591,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca9377 hw1.1",
|
||||
.patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 6,
|
||||
+ .led_pin = 0,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
.max_probe_resp_desc_thres = 0,
|
||||
@@ -620,6 +634,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca9377 hw1.1 sdio",
|
||||
.patch_load_addr = QCA9377_HW_1_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 19,
|
||||
+ .led_pin = 0,
|
||||
.otp_exe_param = 0,
|
||||
.channel_counters_freq_hz = 88000,
|
||||
.max_probe_resp_desc_thres = 0,
|
||||
@@ -653,6 +668,7 @@ static const struct ath10k_hw_params ath
|
||||
.name = "qca4019 hw1.0",
|
||||
.patch_load_addr = QCA4019_HW_1_0_PATCH_LOAD_ADDR,
|
||||
.uart_pin = 7,
|
||||
+ .led_pin = 0,
|
||||
.cc_wraparound_type = ATH10K_HW_CC_WRAP_SHIFTED_EACH,
|
||||
.otp_exe_param = 0x0010000,
|
||||
.continuous_frag_desc = true,
|
||||
@@ -698,6 +714,7 @@ static const struct ath10k_hw_params ath
|
||||
.dev_id = 0,
|
||||
.bus = ATH10K_BUS_SNOC,
|
||||
.name = "wcn3990 hw1.0",
|
||||
+ .led_pin = 0,
|
||||
.continuous_frag_desc = true,
|
||||
.tx_chain_mask = 0x7,
|
||||
.rx_chain_mask = 0x7,
|
||||
@@ -3222,6 +3239,10 @@ int ath10k_core_start(struct ath10k *ar,
|
||||
goto err_hif_stop;
|
||||
}
|
||||
|
||||
@ -183,7 +220,7 @@ v13:
|
||||
return 0;
|
||||
|
||||
err_hif_stop:
|
||||
@@ -3480,9 +3490,18 @@ static void ath10k_core_register_work(st
|
||||
@@ -3480,9 +3501,18 @@ static void ath10k_core_register_work(st
|
||||
goto err_spectral_destroy;
|
||||
}
|
||||
|
||||
@ -202,7 +239,7 @@ v13:
|
||||
err_spectral_destroy:
|
||||
ath10k_spectral_destroy(ar);
|
||||
err_debug_destroy:
|
||||
@@ -3528,6 +3547,8 @@ void ath10k_core_unregister(struct ath10
|
||||
@@ -3528,6 +3558,8 @@ void ath10k_core_unregister(struct ath10
|
||||
if (!test_bit(ATH10K_FLAG_CORE_REGISTERED, &ar->dev_flags))
|
||||
return;
|
||||
|
||||
@ -247,24 +284,13 @@ v13:
|
||||
/* Type of hw cycle counter wraparound logic, for more info
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/wireless/ath/ath10k/leds.c
|
||||
@@ -0,0 +1,103 @@
|
||||
@@ -0,0 +1,90 @@
|
||||
+// SPDX-License-Identifier: ISC
|
||||
+/*
|
||||
+ * Copyright (c) 2005-2011 Atheros Communications Inc.
|
||||
+ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
|
||||
+ * Copyright (c) 2018 Sebastian Gottschall <s.gottschall@dd-wrt.com>
|
||||
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
|
||||
+ *
|
||||
+ * Permission to use, copy, modify, and/or distribute this software for any
|
||||
+ * purpose with or without fee is hereby granted, provided that the above
|
||||
+ * copyright notice and this permission notice appear in all copies.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
+ * Copyright (c) 2018 The Linux Foundation. All rights reserved.
|
||||
+ */
|
||||
+
|
||||
+#include <linux/leds.h>
|
||||
@ -331,8 +357,6 @@ v13:
|
||||
+
|
||||
+ ar->leds.cdev.name = ar->leds.label;
|
||||
+ ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
|
||||
+
|
||||
+ /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
|
||||
+ ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
|
||||
+
|
||||
+ ret = led_classdev_register(wiphy_dev(ar->hw->wiphy), &ar->leds.cdev);
|
||||
@ -353,22 +377,15 @@ v13:
|
||||
+
|
||||
--- /dev/null
|
||||
+++ b/drivers/net/wireless/ath/ath10k/leds.h
|
||||
@@ -0,0 +1,41 @@
|
||||
@@ -0,0 +1,34 @@
|
||||
+/* SPDX-License-Identifier: ISC */
|
||||
+/*
|
||||
+ * Copyright (c) 2018, The Linux Foundation. All rights reserved.
|
||||
+ *
|
||||
+ * Permission to use, copy, modify, and/or distribute this software for any
|
||||
+ * purpose with or without fee is hereby granted, provided that the above
|
||||
+ * copyright notice and this permission notice appear in all copies.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
||||
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
||||
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
||||
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
||||
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
||||
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
||||
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||
+ * Copyright (c) 2005-2011 Atheros Communications Inc.
|
||||
+ * Copyright (c) 2011-2017 Qualcomm Atheros, Inc.
|
||||
+ * Copyright (c) 2018 Sebastian Gottschall <s.gottschall@dd-wrt.com>
|
||||
+ * Copyright (c) 2018 The Linux Foundation. All rights reserved.
|
||||
+ */
|
||||
+
|
||||
+#ifndef _LEDS_H_
|
||||
+#define _LEDS_H_
|
||||
+
|
||||
@ -569,7 +586,7 @@ v13:
|
||||
|
||||
};
|
||||
|
||||
+/* WMI_GPIO_CONFIG_CMDID */
|
||||
+/* WMI_GPIO_CPTCFG_CMDID */
|
||||
+enum {
|
||||
+ WMI_GPIO_PULL_NONE,
|
||||
+ WMI_GPIO_PULL_UP,
|
||||
@ -585,7 +602,7 @@ v13:
|
||||
+ WMI_GPIO_INTTYPE_LEVEL_HIGH
|
||||
+};
|
||||
+
|
||||
+/* WMI_GPIO_CONFIG_CMDID */
|
||||
+/* WMI_GPIO_CPTCFG_CMDID */
|
||||
+struct wmi_gpio_config_cmd {
|
||||
+ __le32 gpio_num; /* GPIO number to be setup */
|
||||
+ __le32 input; /* 0 - Output/ 1 - Input */
|
||||
@ -29,12 +29,10 @@ Signed-off-by: Mathias Kresin <dev@kresin.me>
|
||||
};
|
||||
--- a/drivers/net/wireless/ath/ath10k/leds.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/leds.c
|
||||
@@ -81,9 +81,7 @@ int ath10k_leds_register(struct ath10k *
|
||||
@@ -70,7 +70,7 @@ int ath10k_leds_register(struct ath10k *
|
||||
|
||||
ar->leds.cdev.name = ar->leds.label;
|
||||
ar->leds.cdev.brightness_set_blocking = ath10k_leds_set_brightness_blocking;
|
||||
-
|
||||
- /* FIXME: this assignment doesn't make sense as it's NULL, remove it? */
|
||||
- ar->leds.cdev.default_trigger = ar->leds.wifi_led.default_trigger;
|
||||
+ ar->leds.cdev.default_trigger = ar->led_default_trigger;
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
|
||||
#include <linux/property.h>
|
||||
#include <linux/dmi.h>
|
||||
#include <linux/ctype.h>
|
||||
@@ -3398,6 +3399,8 @@ static int ath10k_core_probe_fw(struct a
|
||||
@@ -3409,6 +3410,8 @@ static int ath10k_core_probe_fw(struct a
|
||||
|
||||
device_get_mac_address(ar->dev, ar->mac_addr);
|
||||
|
||||
|
||||
@ -0,0 +1,161 @@
|
||||
From d5b6f6d595b446c1693fdaa6aeb4a65b94d5fc90 Mon Sep 17 00:00:00 2001
|
||||
From: Johannes Berg <johannes.berg@intel.com>
|
||||
Date: Wed, 20 Dec 2023 13:41:39 +0200
|
||||
Subject: [PATCH] wifi: mac80211: rework RX timestamp flags
|
||||
|
||||
We only have a single flag free, and before using that for
|
||||
another mactime flag, instead refactor the mactime flags
|
||||
to use a 2-bit field.
|
||||
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
Reviewed-by: Gregory Greenman <gregory.greenman@intel.com>
|
||||
Reviewed-by: Benjamin Berg <benjamin.berg@intel.com>
|
||||
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
|
||||
Link: https://msgid.link/20231220133549.d0e664832d14.I20c8900106f9bf81316bed778b1e3ce145785274@changeid
|
||||
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
|
||||
---
|
||||
drivers/net/wireless/ath/ath10k/htt_rx.c | 2 +-
|
||||
include/net/mac80211.h | 13 +++++++++----
|
||||
net/mac80211/ieee80211_i.h | 5 +----
|
||||
net/mac80211/util.c | 16 ++++++++++------
|
||||
4 files changed, 21 insertions(+), 15 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath10k/htt_rx.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/htt_rx.c
|
||||
@@ -1294,7 +1294,7 @@ static void ath10k_htt_rx_h_ppdu(struct
|
||||
status->encoding = RX_ENC_LEGACY;
|
||||
status->bw = RATE_INFO_BW_20;
|
||||
|
||||
- status->flag &= ~RX_FLAG_MACTIME_END;
|
||||
+ status->flag &= ~RX_FLAG_MACTIME;
|
||||
status->flag |= RX_FLAG_NO_SIGNAL_VAL;
|
||||
|
||||
status->flag &= ~(RX_FLAG_AMPDU_IS_LAST);
|
||||
--- a/include/net/mac80211.h
|
||||
+++ b/include/net/mac80211.h
|
||||
@@ -1352,6 +1352,9 @@ ieee80211_tx_info_clear_status(struct ie
|
||||
* the frame.
|
||||
* @RX_FLAG_FAILED_PLCP_CRC: Set this flag if the PCLP check failed on
|
||||
* the frame.
|
||||
+ * @RX_FLAG_MACTIME: The timestamp passed in the RX status (@mactime
|
||||
+ * field) is valid if this field is non-zero, and the position
|
||||
+ * where the timestamp was sampled depends on the value.
|
||||
* @RX_FLAG_MACTIME_START: The timestamp passed in the RX status (@mactime
|
||||
* field) is valid and contains the time the first symbol of the MPDU
|
||||
* was received. This is useful in monitor mode and for proper IBSS
|
||||
@@ -1431,12 +1434,12 @@ ieee80211_tx_info_clear_status(struct ie
|
||||
enum mac80211_rx_flags {
|
||||
RX_FLAG_MMIC_ERROR = BIT(0),
|
||||
RX_FLAG_DECRYPTED = BIT(1),
|
||||
- RX_FLAG_MACTIME_PLCP_START = BIT(2),
|
||||
+ RX_FLAG_ONLY_MONITOR = BIT(2),
|
||||
RX_FLAG_MMIC_STRIPPED = BIT(3),
|
||||
RX_FLAG_IV_STRIPPED = BIT(4),
|
||||
RX_FLAG_FAILED_FCS_CRC = BIT(5),
|
||||
RX_FLAG_FAILED_PLCP_CRC = BIT(6),
|
||||
- RX_FLAG_MACTIME_START = BIT(7),
|
||||
+ /* one free bit at 7 */
|
||||
RX_FLAG_NO_SIGNAL_VAL = BIT(8),
|
||||
RX_FLAG_AMPDU_DETAILS = BIT(9),
|
||||
RX_FLAG_PN_VALIDATED = BIT(10),
|
||||
@@ -1445,8 +1448,10 @@ enum mac80211_rx_flags {
|
||||
RX_FLAG_AMPDU_IS_LAST = BIT(13),
|
||||
RX_FLAG_AMPDU_DELIM_CRC_ERROR = BIT(14),
|
||||
RX_FLAG_AMPDU_DELIM_CRC_KNOWN = BIT(15),
|
||||
- RX_FLAG_MACTIME_END = BIT(16),
|
||||
- RX_FLAG_ONLY_MONITOR = BIT(17),
|
||||
+ RX_FLAG_MACTIME = BIT(16) | BIT(17),
|
||||
+ RX_FLAG_MACTIME_PLCP_START = 1 << 16,
|
||||
+ RX_FLAG_MACTIME_START = 2 << 16,
|
||||
+ RX_FLAG_MACTIME_END = 3 << 16,
|
||||
RX_FLAG_SKIP_MONITOR = BIT(18),
|
||||
RX_FLAG_AMSDU_MORE = BIT(19),
|
||||
RX_FLAG_RADIOTAP_TLV_AT_END = BIT(20),
|
||||
--- a/net/mac80211/ieee80211_i.h
|
||||
+++ b/net/mac80211/ieee80211_i.h
|
||||
@@ -1807,10 +1807,7 @@ static inline bool txq_has_queue(struct
|
||||
static inline bool
|
||||
ieee80211_have_rx_timestamp(struct ieee80211_rx_status *status)
|
||||
{
|
||||
- WARN_ON_ONCE(status->flag & RX_FLAG_MACTIME_START &&
|
||||
- status->flag & RX_FLAG_MACTIME_END);
|
||||
- return !!(status->flag & (RX_FLAG_MACTIME_START | RX_FLAG_MACTIME_END |
|
||||
- RX_FLAG_MACTIME_PLCP_START));
|
||||
+ return status->flag & RX_FLAG_MACTIME;
|
||||
}
|
||||
|
||||
void ieee80211_vif_inc_num_mcast(struct ieee80211_sub_if_data *sdata);
|
||||
--- a/net/mac80211/util.c
|
||||
+++ b/net/mac80211/util.c
|
||||
@@ -4174,6 +4174,7 @@ u64 ieee80211_calculate_rx_timestamp(str
|
||||
unsigned int mpdu_offset)
|
||||
{
|
||||
u64 ts = status->mactime;
|
||||
+ bool mactime_plcp_start;
|
||||
struct rate_info ri;
|
||||
u16 rate;
|
||||
u8 n_ltf;
|
||||
@@ -4181,6 +4182,9 @@ u64 ieee80211_calculate_rx_timestamp(str
|
||||
if (WARN_ON(!ieee80211_have_rx_timestamp(status)))
|
||||
return 0;
|
||||
|
||||
+ mactime_plcp_start = (status->flag & RX_FLAG_MACTIME) ==
|
||||
+ RX_FLAG_MACTIME_PLCP_START;
|
||||
+
|
||||
memset(&ri, 0, sizeof(ri));
|
||||
|
||||
ri.bw = status->bw;
|
||||
@@ -4195,7 +4199,7 @@ u64 ieee80211_calculate_rx_timestamp(str
|
||||
if (status->enc_flags & RX_ENC_FLAG_SHORT_GI)
|
||||
ri.flags |= RATE_INFO_FLAGS_SHORT_GI;
|
||||
/* TODO/FIXME: is this right? handle other PPDUs */
|
||||
- if (status->flag & RX_FLAG_MACTIME_PLCP_START) {
|
||||
+ if (mactime_plcp_start) {
|
||||
mpdu_offset += 2;
|
||||
ts += 36;
|
||||
}
|
||||
@@ -4212,7 +4216,7 @@ u64 ieee80211_calculate_rx_timestamp(str
|
||||
* See P802.11ax_D6.0, section 27.3.4 for
|
||||
* VHT PPDU format.
|
||||
*/
|
||||
- if (status->flag & RX_FLAG_MACTIME_PLCP_START) {
|
||||
+ if (mactime_plcp_start) {
|
||||
mpdu_offset += 2;
|
||||
ts += 36;
|
||||
|
||||
@@ -4236,7 +4240,7 @@ u64 ieee80211_calculate_rx_timestamp(str
|
||||
* See P802.11REVmd_D3.0, section 19.3.2 for
|
||||
* HT PPDU format.
|
||||
*/
|
||||
- if (status->flag & RX_FLAG_MACTIME_PLCP_START) {
|
||||
+ if (mactime_plcp_start) {
|
||||
mpdu_offset += 2;
|
||||
if (status->enc_flags & RX_ENC_FLAG_HT_GF)
|
||||
ts += 24;
|
||||
@@ -4264,7 +4268,7 @@ u64 ieee80211_calculate_rx_timestamp(str
|
||||
* See P802.11REVmd_D3.0, section 21.3.2 for
|
||||
* VHT PPDU format.
|
||||
*/
|
||||
- if (status->flag & RX_FLAG_MACTIME_PLCP_START) {
|
||||
+ if (mactime_plcp_start) {
|
||||
mpdu_offset += 2;
|
||||
ts += 36;
|
||||
|
||||
@@ -4298,7 +4302,7 @@ u64 ieee80211_calculate_rx_timestamp(str
|
||||
bitrate = sband->bitrates[status->rate_idx].bitrate;
|
||||
ri.legacy = DIV_ROUND_UP(bitrate, (1 << shift));
|
||||
|
||||
- if (status->flag & RX_FLAG_MACTIME_PLCP_START) {
|
||||
+ if (mactime_plcp_start) {
|
||||
if (status->band == NL80211_BAND_5GHZ) {
|
||||
ts += 20 << shift;
|
||||
mpdu_offset += 2;
|
||||
@@ -4320,7 +4324,7 @@ u64 ieee80211_calculate_rx_timestamp(str
|
||||
return 0;
|
||||
|
||||
/* rewind from end of MPDU */
|
||||
- if (status->flag & RX_FLAG_MACTIME_END)
|
||||
+ if ((status->flag & RX_FLAG_MACTIME) == RX_FLAG_MACTIME_END)
|
||||
ts -= mpdu_len * 8 * 10 / rate;
|
||||
|
||||
ts += mpdu_offset * 8 * 10 / rate;
|
||||
@ -83,6 +83,33 @@ define Package/libatomic/config
|
||||
endmenu
|
||||
endef
|
||||
|
||||
define Package/libquadmath
|
||||
$(call Package/gcc/Default)
|
||||
DEPENDS:=@TARGET_x86||TARGET_x86_64 +libgcc
|
||||
TITLE:=Quadmath support library
|
||||
ABI_VERSION:=1
|
||||
endef
|
||||
|
||||
define Package/libquadmath/config
|
||||
menu "Configuration"
|
||||
depends on EXTERNAL_TOOLCHAIN && PACKAGE_libquadmath
|
||||
|
||||
config LIBQUADMATH_ROOT_DIR
|
||||
string
|
||||
prompt "libquadmath shared library base directory"
|
||||
depends on EXTERNAL_TOOLCHAIN && PACKAGE_libquadmath
|
||||
default TOOLCHAIN_ROOT if !NATIVE_TOOLCHAIN
|
||||
default "/" if NATIVE_TOOLCHAIN
|
||||
|
||||
config LIBQUADMATH_FILE_SPEC
|
||||
string
|
||||
prompt "libquadmath shared library files (use wildcards)"
|
||||
depends on EXTERNAL_TOOLCHAIN && PACKAGE_libquadmath
|
||||
default "./lib/libquadmath.so.*"
|
||||
|
||||
endmenu
|
||||
endef
|
||||
|
||||
define Package/libstdcpp
|
||||
$(call Package/gcc/Default)
|
||||
NAME:=libstdc++
|
||||
@ -485,6 +512,11 @@ ifeq ($(CONFIG_EXTERNAL_TOOLCHAIN),)
|
||||
$(CP) $(TOOLCHAIN_DIR)/lib/libatomic.so.* $(1)/lib/
|
||||
endef
|
||||
|
||||
define Package/libquadmath/install
|
||||
$(INSTALL_DIR) $(1)/lib
|
||||
$(CP) $(TOOLCHAIN_DIR)/lib/libquadmath.so.* $(1)/lib/
|
||||
endef
|
||||
|
||||
define Package/libgfortran/install
|
||||
$(INSTALL_DIR) $(1)/usr/lib
|
||||
$(CP) $(TOOLCHAIN_DIR)/lib/libgfortran.so.* $(1)/usr/lib/
|
||||
@ -705,6 +737,14 @@ else
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/libquadmath/install
|
||||
for file in $(call qstrip,$(CONFIG_LIBQUADMATH_FILE_SPEC)); do \
|
||||
$(INSTALL_DIR) $(1)/lib ; \
|
||||
$(CP) $(call qstrip,$(CONFIG_LIBQUADMATH_ROOT_DIR))/$$$$file $(1)/lib/ ; \
|
||||
done ; \
|
||||
exit 0
|
||||
endef
|
||||
|
||||
define Package/libgomp/install
|
||||
for file in $(call qstrip,$(CONFIG_LIBGOMP_FILE_SPEC)); do \
|
||||
$(INSTALL_DIR) $(1)/lib ; \
|
||||
@ -736,6 +776,7 @@ endif
|
||||
$(eval $(call BuildPackage,libc))
|
||||
$(eval $(call BuildPackage,libgcc))
|
||||
$(eval $(call BuildPackage,libatomic))
|
||||
$(eval $(call BuildPackage,libquadmath))
|
||||
$(eval $(call BuildPackage,libstdcpp))
|
||||
$(eval $(call BuildPackage,libasan))
|
||||
$(eval $(call BuildPackage,libtsan))
|
||||
|
||||
@ -2,8 +2,8 @@ include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=xdp-tools
|
||||
PKG_RELEASE:=1
|
||||
PKG_VERSION:=1.2.9
|
||||
PKG_HASH:=159ed8d3c8195d812ec3cde83bd736245a72743af372998320d39c2ba69ab142
|
||||
PKG_VERSION:=1.4.2
|
||||
PKG_HASH:=49c2b96b2be878449a797a74ca515a63e13418cb8ea904df08f8ef9cb2ac5570
|
||||
|
||||
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
|
||||
PKG_SOURCE_URL:=https://codeload.github.com/xdp-project/xdp-tools/tar.gz/v$(PKG_VERSION)?
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
--- a/configure
|
||||
+++ b/configure
|
||||
@@ -174,7 +174,7 @@ int main(int argc, char **argv) {
|
||||
@@ -191,7 +191,7 @@ int main(int argc, char **argv) {
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
@ -9,16 +9,16 @@
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "HAVE_PCAP:=y" >>$CONFIG
|
||||
[ -n "$LIBPCAP_CFLAGS" ] && echo 'CFLAGS += ' $LIBPCAP_CFLAGS >> $CONFIG
|
||||
@@ -222,7 +222,7 @@ int main(int argc, char **argv) {
|
||||
@@ -267,7 +267,7 @@ int main(int argc, char **argv) {
|
||||
return 0;
|
||||
}
|
||||
EOF
|
||||
- libbpf_err=$($CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c -Werror $LIBBPF_CFLAGS $LIBBPF_LDLIBS 2>&1)
|
||||
+ libbpf_err=$($CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c -Werror $LIBBPF_CFLAGS $LIBBPF_LDLIBS $LDFLAGS 2>&1)
|
||||
- compile_cmd="$CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c -Werror $LIBBPF_CFLAGS $LIBBPF_LDLIBS"
|
||||
+ compile_cmd="$CC -o $TMPDIR/libbpftest $TMPDIR/libbpftest.c -Werror $LIBBPF_CFLAGS $LIBBPF_LDLIBS $LDFLAGS"
|
||||
libbpf_err=$($compile_cmd 2>&1)
|
||||
if [ "$?" -eq "0" ]; then
|
||||
echo "HAVE_FEATURES+=${config_var}" >>"$CONFIG"
|
||||
echo "yes"
|
||||
@@ -289,7 +289,7 @@ int main(int argc, char **argv) {
|
||||
@@ -345,7 +345,7 @@ int main(int argc, char **argv) {
|
||||
}
|
||||
EOF
|
||||
|
||||
|
||||
@ -18,7 +18,7 @@ Signed-off-by: Andre Heider <a.heider@gmail.com>
|
||||
|
||||
--- a/lib/libxdp/protocol.org
|
||||
+++ b/lib/libxdp/protocol.org
|
||||
@@ -54,7 +54,7 @@ static volatile const struct xdp_dispatc
|
||||
@@ -59,7 +59,7 @@ static volatile const struct xdp_dispatc
|
||||
/* The volatile return value prevents the compiler from assuming it knows the
|
||||
* return value and optimising based on that.
|
||||
*/
|
||||
@ -29,7 +29,7 @@ Signed-off-by: Andre Heider <a.heider@gmail.com>
|
||||
|
||||
--- a/lib/libxdp/xdp-dispatcher.c.in
|
||||
+++ b/lib/libxdp/xdp-dispatcher.c.in
|
||||
@@ -30,7 +30,7 @@ static volatile const struct xdp_dispatc
|
||||
@@ -29,7 +29,7 @@ static volatile const struct xdp_dispatc
|
||||
* return value and optimising based on that.
|
||||
*/
|
||||
forloop(`i', `0', NUM_PROGS,
|
||||
@ -38,7 +38,7 @@ Signed-off-by: Andre Heider <a.heider@gmail.com>
|
||||
int format(`prog%d', i)(struct xdp_md *ctx) {
|
||||
volatile int ret = XDP_DISPATCHER_RETVAL;
|
||||
|
||||
@@ -40,7 +40,7 @@ int format(`prog%d', i)(struct xdp_md *c
|
||||
@@ -39,7 +39,7 @@ int format(`prog%d', i)(struct xdp_md *c
|
||||
}
|
||||
')
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ Signed-off-by: Andre Heider <a.heider@gmail.com>
|
||||
|
||||
--- a/lib/libxdp/Makefile
|
||||
+++ b/lib/libxdp/Makefile
|
||||
@@ -30,7 +30,7 @@ PC_FILE := $(OBJDIR)/libxdp.pc
|
||||
@@ -28,7 +28,7 @@ PC_FILE := $(OBJDIR)/libxdp.pc
|
||||
TEMPLATED_SOURCES := xdp-dispatcher.c
|
||||
|
||||
CFLAGS += -I$(HEADER_DIR)
|
||||
|
||||
@ -17,7 +17,7 @@ Signed-off-by: Andre Heider <a.heider@gmail.com>
|
||||
|
||||
--- a/lib/common.mk
|
||||
+++ b/lib/common.mk
|
||||
@@ -108,12 +108,12 @@ $(XDP_OBJ): %.o: %.c $(KERN_USER_H) $(EX
|
||||
@@ -111,12 +111,12 @@ $(XDP_OBJ): %.o: %.c $(KERN_USER_H) $(EX
|
||||
$(QUIET_CLANG)$(CLANG) -S \
|
||||
-target $(BPF_TARGET) \
|
||||
-D __BPF_TRACING__ \
|
||||
@ -33,7 +33,7 @@ Signed-off-by: Andre Heider <a.heider@gmail.com>
|
||||
|
||||
--- a/lib/libxdp/Makefile
|
||||
+++ b/lib/libxdp/Makefile
|
||||
@@ -139,12 +139,12 @@ $(XDP_OBJS): %.o: %.c $(BPF_HEADERS) $(L
|
||||
@@ -138,12 +138,12 @@ $(XDP_OBJS): %.o: %.c $(BPF_HEADERS) $(L
|
||||
$(QUIET_CLANG)$(CLANG) -S \
|
||||
-target $(BPF_TARGET) \
|
||||
-D __BPF_TRACING__ \
|
||||
|
||||
@ -33,18 +33,18 @@ Signed-off-by: Andre Heider <a.heider@gmail.com>
|
||||
find_tool()
|
||||
--- a/lib/common.mk
|
||||
+++ b/lib/common.mk
|
||||
@@ -115,7 +115,7 @@ $(XDP_OBJ): %.o: %.c $(KERN_USER_H) $(EX
|
||||
@@ -118,7 +118,7 @@ $(XDP_OBJ): %.o: %.c $(KERN_USER_H) $(EX
|
||||
-Werror \
|
||||
$(BPF_CFLAGS) \
|
||||
-O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
|
||||
- $(QUIET_LLC)$(LLC) -march=$(BPF_TARGET) -filetype=obj -o $@ ${@:.o=.ll}
|
||||
+ $(QUIET_LLC)$(LLC) $(BPF_LDFLAGS) -filetype=obj -o $@ ${@:.o=.ll}
|
||||
|
||||
.PHONY: man
|
||||
ifeq ($(EMACS),)
|
||||
$(BPF_SKEL_H): %.skel.h: %.bpf.o
|
||||
$(QUIET_GEN)$(BPFTOOL) gen skeleton $< name ${@:.skel.h=} > $@
|
||||
--- a/lib/libxdp/Makefile
|
||||
+++ b/lib/libxdp/Makefile
|
||||
@@ -146,7 +146,7 @@ $(XDP_OBJS): %.o: %.c $(BPF_HEADERS) $(L
|
||||
@@ -145,7 +145,7 @@ $(XDP_OBJS): %.o: %.c $(BPF_HEADERS) $(L
|
||||
-Werror \
|
||||
$(BPF_CFLAGS) \
|
||||
-O2 -emit-llvm -c -g -o ${@:.o=.ll} $<
|
||||
|
||||
@ -41,6 +41,12 @@ LIB_SPECS="
|
||||
ssp: libssp
|
||||
gfortran: libgfortran
|
||||
gomp: libgomp
|
||||
atomic: libatomic
|
||||
quadmath: libquadmath
|
||||
asan: libasan
|
||||
tasan: libtsan
|
||||
lasan: liblsan
|
||||
ubasan: libubsan
|
||||
"
|
||||
|
||||
# Binary specs
|
||||
@ -405,7 +411,7 @@ print_config() {
|
||||
fi
|
||||
|
||||
local lib
|
||||
for lib in C RT PTHREAD GCC STDCPP SSP GFORTRAN GOMP; do
|
||||
for lib in C RT PTHREAD GCC STDCPP SSP GFORTRAN GOMP ATOMIC QUADMATH ASAN TSAN LSAN UBSAN; do
|
||||
local file
|
||||
local spec=""
|
||||
local llib="$(echo "$lib" | sed -e 's#.*#\L&#')"
|
||||
|
||||
@ -9,8 +9,7 @@ CPU_TYPE:=464fp
|
||||
FEATURES:=fpu dt gpio ramdisk squashfs usb
|
||||
SUBTARGETS:=nand sata
|
||||
|
||||
KERNEL_PATCHVER:=6.1
|
||||
KERNEL_TESTING_PATCHVER:=6.6
|
||||
KERNEL_PATCHVER:=6.6
|
||||
|
||||
define Target/Description
|
||||
Build images for AppliedMicro APM821xx based boards.
|
||||
|
||||
@ -1,250 +0,0 @@
|
||||
# CONFIG_40x is not set
|
||||
# CONFIG_440_CPU is not set
|
||||
CONFIG_44x=y
|
||||
CONFIG_464_CPU=y
|
||||
CONFIG_4xx=y
|
||||
CONFIG_4xx_SOC=y
|
||||
# CONFIG_ADVANCED_OPTIONS is not set
|
||||
CONFIG_APM821xx=y
|
||||
# CONFIG_APOLLO3G is not set
|
||||
# CONFIG_ARCHES is not set
|
||||
CONFIG_ARCH_32BIT_OFF_T=y
|
||||
CONFIG_ARCH_DMA_ADDR_T_64BIT=y
|
||||
CONFIG_ARCH_HIBERNATION_POSSIBLE=y
|
||||
CONFIG_ARCH_KEEP_MEMBLOCK=y
|
||||
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
|
||||
CONFIG_ARCH_MIGHT_HAVE_PC_PARPORT=y
|
||||
CONFIG_ARCH_MIGHT_HAVE_PC_SERIO=y
|
||||
CONFIG_ARCH_MMAP_RND_BITS=11
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MAX=17
|
||||
CONFIG_ARCH_MMAP_RND_BITS_MIN=11
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=17
|
||||
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=11
|
||||
CONFIG_ARCH_OPTIONAL_KERNEL_RWX_DEFAULT=y
|
||||
CONFIG_ARCH_SPLIT_ARG64=y
|
||||
CONFIG_ARCH_STACKWALK=y
|
||||
CONFIG_ARCH_SUSPEND_POSSIBLE=y
|
||||
CONFIG_ARCH_WEAK_RELEASE_ACQUIRE=y
|
||||
CONFIG_AUDIT_ARCH=y
|
||||
# CONFIG_BAMBOO is not set
|
||||
# CONFIG_BLK_DEV_INITRD is not set
|
||||
CONFIG_BLK_MQ_PCI=y
|
||||
CONFIG_BLUESTONE=y
|
||||
CONFIG_BOOKE=y
|
||||
CONFIG_BOOKE_OR_40x=y
|
||||
CONFIG_BOOKE_WDT=y
|
||||
# CONFIG_CANYONLANDS is not set
|
||||
CONFIG_CLONE_BACKWARDS=y
|
||||
CONFIG_CMDLINE="rootfstype=squashfs noinitrd"
|
||||
CONFIG_CMDLINE_FROM_BOOTLOADER=y
|
||||
CONFIG_COMMON_CLK=y
|
||||
CONFIG_COMPACT_UNEVICTABLE_DEFAULT=1
|
||||
CONFIG_COMPAT_32BIT_TIME=y
|
||||
CONFIG_CPU_BIG_ENDIAN=y
|
||||
CONFIG_CRC16=y
|
||||
# CONFIG_CRC32_SARWATE is not set
|
||||
CONFIG_CRC32_SLICEBY8=y
|
||||
CONFIG_CRYPTO_DEFLATE=y
|
||||
CONFIG_CRYPTO_JITTERENTROPY=y
|
||||
CONFIG_CRYPTO_LIB_BLAKE2S_GENERIC=y
|
||||
CONFIG_CRYPTO_LIB_POLY1305_RSIZE=1
|
||||
CONFIG_CRYPTO_LIB_SHA1=y
|
||||
CONFIG_CRYPTO_LIB_UTILS=y
|
||||
CONFIG_CRYPTO_LZO=y
|
||||
# CONFIG_CRYPTO_MD5_PPC is not set
|
||||
# CONFIG_CRYPTO_SHA1_PPC is not set
|
||||
CONFIG_DATA_SHIFT=12
|
||||
CONFIG_DMADEVICES=y
|
||||
CONFIG_DMA_DIRECT_REMAP=y
|
||||
CONFIG_DMA_ENGINE=y
|
||||
CONFIG_DMA_OF=y
|
||||
CONFIG_DTC=y
|
||||
CONFIG_DW_DMAC=y
|
||||
CONFIG_DW_DMAC_CORE=y
|
||||
CONFIG_EARLY_PRINTK=y
|
||||
# CONFIG_EBONY is not set
|
||||
CONFIG_EDAC_ATOMIC_SCRUB=y
|
||||
CONFIG_EDAC_SUPPORT=y
|
||||
# CONFIG_EIGER is not set
|
||||
CONFIG_EXCLUSIVE_SYSTEM_RAM=y
|
||||
CONFIG_EXTRA_TARGETS="uImage"
|
||||
CONFIG_FIXED_PHY=y
|
||||
CONFIG_FORCE_PCI=y
|
||||
# CONFIG_FSL_LBC is not set
|
||||
CONFIG_FWNODE_MDIO=y
|
||||
CONFIG_FW_LOADER_PAGED_BUF=y
|
||||
CONFIG_FW_LOADER_SYSFS=y
|
||||
CONFIG_GENERIC_ALLOCATOR=y
|
||||
CONFIG_GENERIC_ATOMIC64=y
|
||||
CONFIG_GENERIC_BUG=y
|
||||
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
|
||||
CONFIG_GENERIC_CLOCKEVENTS=y
|
||||
CONFIG_GENERIC_CMOS_UPDATE=y
|
||||
CONFIG_GENERIC_CPU_AUTOPROBE=y
|
||||
CONFIG_GENERIC_EARLY_IOREMAP=y
|
||||
CONFIG_GENERIC_GETTIMEOFDAY=y
|
||||
CONFIG_GENERIC_IRQ_SHOW=y
|
||||
CONFIG_GENERIC_IRQ_SHOW_LEVEL=y
|
||||
CONFIG_GENERIC_ISA_DMA=y
|
||||
CONFIG_GENERIC_MSI_IRQ=y
|
||||
CONFIG_GENERIC_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_GENERIC_PCI_IOMAP=y
|
||||
CONFIG_GENERIC_SMP_IDLE_THREAD=y
|
||||
CONFIG_GENERIC_STRNCPY_FROM_USER=y
|
||||
CONFIG_GENERIC_STRNLEN_USER=y
|
||||
CONFIG_GENERIC_TIME_VSYSCALL=y
|
||||
# CONFIG_GEN_RTC is not set
|
||||
# CONFIG_GLACIER is not set
|
||||
CONFIG_GPIO_CDEV=y
|
||||
CONFIG_GPIO_GENERIC=y
|
||||
CONFIG_GPIO_GENERIC_PLATFORM=y
|
||||
CONFIG_HAS_DMA=y
|
||||
CONFIG_HAS_IOMEM=y
|
||||
CONFIG_HAS_IOPORT_MAP=y
|
||||
CONFIG_I2C=y
|
||||
CONFIG_I2C_BOARDINFO=y
|
||||
CONFIG_I2C_CHARDEV=y
|
||||
CONFIG_I2C_IBM_IIC=y
|
||||
CONFIG_IBM_EMAC=y
|
||||
CONFIG_IBM_EMAC_EMAC4=y
|
||||
CONFIG_IBM_EMAC_POLL_WEIGHT=32
|
||||
CONFIG_IBM_EMAC_RGMII=y
|
||||
CONFIG_IBM_EMAC_RXB=128
|
||||
CONFIG_IBM_EMAC_RX_COPY_THRESHOLD=256
|
||||
CONFIG_IBM_EMAC_TAH=y
|
||||
CONFIG_IBM_EMAC_TXB=128
|
||||
# CONFIG_ICON is not set
|
||||
CONFIG_ILLEGAL_POINTER_VALUE=0
|
||||
CONFIG_IRQCHIP=y
|
||||
CONFIG_IRQ_DOMAIN=y
|
||||
CONFIG_IRQ_DOMAIN_HIERARCHY=y
|
||||
CONFIG_IRQ_FORCED_THREADING=y
|
||||
CONFIG_IRQ_WORK=y
|
||||
CONFIG_ISA_DMA_API=y
|
||||
# CONFIG_JFFS2_FS is not set
|
||||
# CONFIG_KATMAI is not set
|
||||
CONFIG_KERNEL_START=0xc0000000
|
||||
CONFIG_LEDS_TRIGGER_MTD=y
|
||||
CONFIG_LEDS_TRIGGER_PATTERN=y
|
||||
CONFIG_LIBFDT=y
|
||||
CONFIG_LOCK_DEBUGGING_SUPPORT=y
|
||||
CONFIG_LOWMEM_SIZE=0x30000000
|
||||
# CONFIG_MATH_EMULATION is not set
|
||||
CONFIG_MDIO_BUS=y
|
||||
CONFIG_MDIO_DEVICE=y
|
||||
CONFIG_MDIO_DEVRES=y
|
||||
CONFIG_MEMFD_CREATE=y
|
||||
CONFIG_MIGRATION=y
|
||||
CONFIG_MMU_GATHER_PAGE_SIZE=y
|
||||
CONFIG_MODULES_USE_ELF_RELA=y
|
||||
CONFIG_MODULE_ALLOW_MISSING_NAMESPACE_IMPORTS=y
|
||||
CONFIG_MTD_CFI_ADV_OPTIONS=y
|
||||
# CONFIG_MTD_CFI_GEOMETRY is not set
|
||||
# CONFIG_MTD_SPLIT_SQUASHFS_ROOT is not set
|
||||
CONFIG_NEED_DMA_MAP_STATE=y
|
||||
CONFIG_NEED_PER_CPU_KM=y
|
||||
CONFIG_NEED_SG_DMA_LENGTH=y
|
||||
CONFIG_NET_SELFTESTS=y
|
||||
CONFIG_NOT_COHERENT_CACHE=y
|
||||
CONFIG_NO_HZ=y
|
||||
CONFIG_NO_HZ_COMMON=y
|
||||
CONFIG_NO_HZ_IDLE=y
|
||||
CONFIG_NR_CPUS=1
|
||||
CONFIG_NR_IRQS=512
|
||||
CONFIG_NVMEM=y
|
||||
CONFIG_NVMEM_SYSFS=y
|
||||
CONFIG_NVMEM_U_BOOT_ENV=y
|
||||
CONFIG_OF=y
|
||||
CONFIG_OF_ADDRESS=y
|
||||
CONFIG_OF_EARLY_FLATTREE=y
|
||||
CONFIG_OF_FLATTREE=y
|
||||
CONFIG_OF_GPIO=y
|
||||
CONFIG_OF_IRQ=y
|
||||
CONFIG_OF_KOBJ=y
|
||||
CONFIG_OF_MDIO=y
|
||||
CONFIG_OLD_SIGACTION=y
|
||||
CONFIG_OLD_SIGSUSPEND=y
|
||||
CONFIG_PACKING=y
|
||||
CONFIG_PAGE_OFFSET=0xc0000000
|
||||
CONFIG_PCI=y
|
||||
CONFIG_PCIEAER=y
|
||||
CONFIG_PCIEPORTBUS=y
|
||||
CONFIG_PCI_DISABLE_COMMON_QUIRKS=y
|
||||
CONFIG_PCI_DOMAINS=y
|
||||
CONFIG_PCI_MSI=y
|
||||
CONFIG_PCI_MSI_ARCH_FALLBACKS=y
|
||||
CONFIG_PCI_MSI_IRQ_DOMAIN=y
|
||||
CONFIG_PGTABLE_LEVELS=2
|
||||
CONFIG_PHYLIB=y
|
||||
CONFIG_PHYSICAL_START=0x00000000
|
||||
CONFIG_PHYS_64BIT=y
|
||||
CONFIG_PHYS_ADDR_T_64BIT=y
|
||||
# CONFIG_PMU_SYSFS is not set
|
||||
CONFIG_PPC=y
|
||||
CONFIG_PPC32=y
|
||||
CONFIG_PPC44x_SIMPLE=y
|
||||
CONFIG_PPC4xx_GPIO=y
|
||||
CONFIG_PPC4xx_PCI_EXPRESS=y
|
||||
# CONFIG_PPC64 is not set
|
||||
# CONFIG_PPC_47x is not set
|
||||
# CONFIG_PPC_85xx is not set
|
||||
# CONFIG_PPC_8xx is not set
|
||||
CONFIG_PPC_ADV_DEBUG_DACS=2
|
||||
CONFIG_PPC_ADV_DEBUG_DAC_RANGE=y
|
||||
CONFIG_PPC_ADV_DEBUG_DVCS=2
|
||||
CONFIG_PPC_ADV_DEBUG_IACS=4
|
||||
CONFIG_PPC_ADV_DEBUG_REGS=y
|
||||
# CONFIG_PPC_BOOK3S_32 is not set
|
||||
CONFIG_PPC_DCR=y
|
||||
CONFIG_PPC_DCR_NATIVE=y
|
||||
# CONFIG_PPC_EARLY_DEBUG is not set
|
||||
CONFIG_PPC_FPU=y
|
||||
CONFIG_PPC_FPU_REGS=y
|
||||
CONFIG_PPC_INDIRECT_PCI=y
|
||||
CONFIG_PPC_KUAP=y
|
||||
# CONFIG_PPC_KUAP_DEBUG is not set
|
||||
CONFIG_PPC_KUEP=y
|
||||
CONFIG_PPC_MMU_NOHASH=y
|
||||
CONFIG_PPC_PAGE_SHIFT=12
|
||||
# CONFIG_PPC_PCI_BUS_NUM_DOMAIN_DEPENDENT is not set
|
||||
CONFIG_PPC_UDBG_16550=y
|
||||
CONFIG_PPC_WERROR=y
|
||||
CONFIG_PTE_64BIT=y
|
||||
CONFIG_PTP_1588_CLOCK_OPTIONAL=y
|
||||
# CONFIG_RAINIER is not set
|
||||
CONFIG_RAS=y
|
||||
CONFIG_RATIONAL=y
|
||||
CONFIG_REGULATOR=y
|
||||
CONFIG_RSEQ=y
|
||||
# CONFIG_SAM440EP is not set
|
||||
# CONFIG_SCOM_DEBUGFS is not set
|
||||
# CONFIG_SEQUOIA is not set
|
||||
# CONFIG_SERIAL_8250_FSL is not set
|
||||
CONFIG_SERIAL_MCTRL_GPIO=y
|
||||
CONFIG_SERIAL_OF_PLATFORM=y
|
||||
CONFIG_SGL_ALLOC=y
|
||||
CONFIG_SPARSE_IRQ=y
|
||||
CONFIG_SRCU=y
|
||||
# CONFIG_STATIC_CALL_SELFTEST is not set
|
||||
CONFIG_SWPHY=y
|
||||
CONFIG_SYSCTL_EXCEPTION_TRACE=y
|
||||
# CONFIG_TAISHAN is not set
|
||||
CONFIG_TARGET_CPU="464"
|
||||
CONFIG_TARGET_CPU_BOOL=y
|
||||
CONFIG_TASK_SIZE=0xc0000000
|
||||
CONFIG_THREAD_INFO_IN_TASK=y
|
||||
CONFIG_THREAD_SHIFT=13
|
||||
CONFIG_TICK_CPU_ACCOUNTING=y
|
||||
CONFIG_TINY_SRCU=y
|
||||
# CONFIG_TOOLCHAIN_DEFAULT_CPU is not set
|
||||
CONFIG_USB_SUPPORT=y
|
||||
CONFIG_VDSO32=y
|
||||
# CONFIG_VIRTIO_MENU is not set
|
||||
# CONFIG_VIRT_CPU_ACCOUNTING_NATIVE is not set
|
||||
# CONFIG_WARP is not set
|
||||
CONFIG_WATCHDOG_CORE=y
|
||||
CONFIG_XZ_DEC_BCJ=y
|
||||
CONFIG_XZ_DEC_POWERPC=y
|
||||
# CONFIG_YOSEMITE is not set
|
||||
CONFIG_ZLIB_DEFLATE=y
|
||||
CONFIG_ZLIB_INFLATE=y
|
||||
@ -1,30 +0,0 @@
|
||||
--- a/arch/powerpc/platforms/44x/Kconfig
|
||||
+++ b/arch/powerpc/platforms/44x/Kconfig
|
||||
@@ -118,6 +118,17 @@ config CANYONLANDS
|
||||
help
|
||||
This option enables support for the AMCC PPC460EX evaluation board.
|
||||
|
||||
+config APOLLO3G
|
||||
+ bool "Apollo3G"
|
||||
+ depends on 44x
|
||||
+ default n
|
||||
+ select PPC44x_SIMPLE
|
||||
+ select APM821xx
|
||||
+ select IBM_EMAC_RGMII
|
||||
+ select 460EX
|
||||
+ help
|
||||
+ This option enables support for the AMCC Apollo 3G board.
|
||||
+
|
||||
config GLACIER
|
||||
bool "Glacier"
|
||||
depends on 44x
|
||||
--- a/arch/powerpc/platforms/44x/ppc44x_simple.c
|
||||
+++ b/arch/powerpc/platforms/44x/ppc44x_simple.c
|
||||
@@ -46,6 +46,7 @@ machine_device_initcall(ppc44x_simple, p
|
||||
* board.c file for it rather than adding it to this list.
|
||||
*/
|
||||
static char *board[] __initdata = {
|
||||
+ "amcc,apollo3g",
|
||||
"amcc,arches",
|
||||
"amcc,bamboo",
|
||||
"apm,bluestone",
|
||||
@ -1,51 +0,0 @@
|
||||
--- a/arch/powerpc/platforms/4xx/pci.c
|
||||
+++ b/arch/powerpc/platforms/4xx/pci.c
|
||||
@@ -1061,15 +1061,24 @@ static int __init apm821xx_pciex_init_po
|
||||
u32 val;
|
||||
|
||||
/*
|
||||
- * Do a software reset on PCIe ports.
|
||||
- * This code is to fix the issue that pci drivers doesn't re-assign
|
||||
- * bus number for PCIE devices after Uboot
|
||||
- * scanned and configured all the buses (eg. PCIE NIC IntelPro/1000
|
||||
- * PT quad port, SAS LSI 1064E)
|
||||
+ * Only reset the PHY when no link is currently established.
|
||||
+ * This is for the Atheros PCIe board which has problems to establish
|
||||
+ * the link (again) after this PHY reset. All other currently tested
|
||||
+ * PCIe boards don't show this problem.
|
||||
*/
|
||||
-
|
||||
- mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x0);
|
||||
- mdelay(10);
|
||||
+ val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP);
|
||||
+ if (!(val & 0x00001000)) {
|
||||
+ /*
|
||||
+ * Do a software reset on PCIe ports.
|
||||
+ * This code is to fix the issue that pci drivers doesn't re-assign
|
||||
+ * bus number for PCIE devices after Uboot
|
||||
+ * scanned and configured all the buses (eg. PCIE NIC IntelPro/1000
|
||||
+ * PT quad port, SAS LSI 1064E)
|
||||
+ */
|
||||
+
|
||||
+ mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x0);
|
||||
+ mdelay(10);
|
||||
+ }
|
||||
|
||||
if (port->endpoint)
|
||||
val = PTYPE_LEGACY_ENDPOINT << 20;
|
||||
@@ -1086,9 +1095,12 @@ static int __init apm821xx_pciex_init_po
|
||||
mtdcri(SDR0, PESDR0_460EX_L0DRV, 0x00000130);
|
||||
mtdcri(SDR0, PESDR0_460EX_L0CLK, 0x00000006);
|
||||
|
||||
- mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x10000000);
|
||||
- mdelay(50);
|
||||
- mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x30000000);
|
||||
+ val = mfdcri(SDR0, port->sdr_base + PESDRn_LOOP);
|
||||
+ if (!(val & 0x00001000)) {
|
||||
+ mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x10000000);
|
||||
+ mdelay(50);
|
||||
+ mtdcri(SDR0, PESDR0_460EX_PHY_CTL_RST, 0x30000000);
|
||||
+ }
|
||||
|
||||
mtdcri(SDR0, port->sdr_base + PESDRn_RCSSET,
|
||||
mfdcri(SDR0, port->sdr_base + PESDRn_RCSSET) |
|
||||
@ -1,14 +0,0 @@
|
||||
--- a/arch/powerpc/platforms/4xx/pci.c
|
||||
+++ b/arch/powerpc/platforms/4xx/pci.c
|
||||
@@ -1903,9 +1903,9 @@ static void __init ppc4xx_configure_pcie
|
||||
* if it works
|
||||
*/
|
||||
out_le32(mbase + PECFG_PIM0LAL, 0x00000000);
|
||||
- out_le32(mbase + PECFG_PIM0LAH, 0x00000000);
|
||||
+ out_le32(mbase + PECFG_PIM0LAH, 0x00000008);
|
||||
out_le32(mbase + PECFG_PIM1LAL, 0x00000000);
|
||||
- out_le32(mbase + PECFG_PIM1LAH, 0x00000000);
|
||||
+ out_le32(mbase + PECFG_PIM1LAH, 0x0000000c);
|
||||
out_le32(mbase + PECFG_PIM01SAH, 0xffff0000);
|
||||
out_le32(mbase + PECFG_PIM01SAL, 0x00000000);
|
||||
|
||||
@ -1,29 +0,0 @@
|
||||
From c9395ad54e2cabb87d408becc37566f3d8248933 Mon Sep 17 00:00:00 2001
|
||||
From: Christian Lamparter <chunkeey@gmail.com>
|
||||
Date: Sun, 1 Dec 2019 02:08:23 +0100
|
||||
Subject: [PATCH] powerpc: bootwrapper: force gzip as mkimage's compression
|
||||
method
|
||||
|
||||
Due to CONFIG_KERNEL_XZ symbol, the bootwrapper code tries to
|
||||
instruct the mkimage to use the xz compression, which isn't
|
||||
supported. This patch forces the gzip compression, which is
|
||||
supported and doesn't matter because the generated uImage for
|
||||
the apm821xx target gets ignored as the OpenWrt toolchain will
|
||||
do separate U-Boot kernel images for each device individually.
|
||||
|
||||
Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
|
||||
---
|
||||
arch/powerpc/boot/Makefile | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/powerpc/boot/Makefile
|
||||
+++ b/arch/powerpc/boot/Makefile
|
||||
@@ -274,7 +274,7 @@ compressor-$(CONFIG_KERNEL_LZO) := lzo
|
||||
|
||||
# args (to if_changed): 1 = (this rule), 2 = platform, 3 = dts 4=dtb 5=initrd
|
||||
quiet_cmd_wrap = WRAP $@
|
||||
- cmd_wrap =$(CONFIG_SHELL) $(wrapper) -Z $(compressor-y) -c -o $@ -p $2 \
|
||||
+ cmd_wrap =$(CONFIG_SHELL) $(wrapper) -Z gzip -c -o $@ -p $2 \
|
||||
$(CROSSWRAP) $(if $3, -s $3)$(if $4, -d $4)$(if $5, -i $5) \
|
||||
vmlinux
|
||||
|
||||
@ -74,7 +74,7 @@
|
||||
regulator-name = "usb-vbus";
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
gpio = <&gpio 11 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
From f7982c726e02001afc19052fe48f642dfcbc00b2 Mon Sep 17 00:00:00 2001
|
||||
From c67d90e058550403a3e6f9b05bfcdcfa12b1815c Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Tremblay <vincent@vtremblay.dev>
|
||||
Date: Mon, 26 Dec 2022 21:10:37 -0500
|
||||
Subject: [PATCH 1/2] spidev: Add Silicon Labs EM3581 device compatible
|
||||
Date: Mon, 26 Dec 2022 21:35:48 -0500
|
||||
Subject: [PATCH] spidev: Add Silicon Labs EM3581 device compatible
|
||||
|
||||
Add compatible string for Silicon Labs EM3581 device.
|
||||
|
||||
Note: This patch is adapted from a patch submitted to the for-next branch (v6.3).
|
||||
|
||||
Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
|
||||
Link: https://lore.kernel.org/r/20221227023550.569547-2-vincent@vtremblay.dev
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
---
|
||||
drivers/spi/spidev.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
@ -1,13 +1,13 @@
|
||||
From 536581825219e97fa2ae0c4de35605d2f6311416 Mon Sep 17 00:00:00 2001
|
||||
From 6c9d1fd52956c3148e847a214bae9102b1811de5 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Tremblay <vincent@vtremblay.dev>
|
||||
Date: Tue, 27 Dec 2022 09:00:58 -0500
|
||||
Subject: [PATCH 2/2] spidev: Add Silicon Labs SI3210 device compatible
|
||||
Date: Tue, 27 Dec 2022 09:10:08 -0500
|
||||
Subject: [PATCH] spidev: Add Silicon Labs SI3210 device compatible
|
||||
|
||||
Add compatible string for Silicon Labs SI3210 device.
|
||||
|
||||
Note: This patch is adapted from a patch submitted to the for-next branch (v6.3).
|
||||
|
||||
Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
|
||||
Link: https://lore.kernel.org/r/20221227141011.111410-2-vincent@vtremblay.dev
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
---
|
||||
drivers/spi/spidev.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
@ -1,13 +1,13 @@
|
||||
From f7982c726e02001afc19052fe48f642dfcbc00b2 Mon Sep 17 00:00:00 2001
|
||||
From c67d90e058550403a3e6f9b05bfcdcfa12b1815c Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Tremblay <vincent@vtremblay.dev>
|
||||
Date: Mon, 26 Dec 2022 21:10:37 -0500
|
||||
Subject: [PATCH 1/2] spidev: Add Silicon Labs EM3581 device compatible
|
||||
Date: Mon, 26 Dec 2022 21:35:48 -0500
|
||||
Subject: [PATCH] spidev: Add Silicon Labs EM3581 device compatible
|
||||
|
||||
Add compatible string for Silicon Labs EM3581 device.
|
||||
|
||||
Note: This patch is adapted from a patch submitted to the for-next branch (v6.3).
|
||||
|
||||
Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
|
||||
Link: https://lore.kernel.org/r/20221227023550.569547-2-vincent@vtremblay.dev
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
---
|
||||
drivers/spi/spidev.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
@ -1,13 +1,13 @@
|
||||
From 536581825219e97fa2ae0c4de35605d2f6311416 Mon Sep 17 00:00:00 2001
|
||||
From 6c9d1fd52956c3148e847a214bae9102b1811de5 Mon Sep 17 00:00:00 2001
|
||||
From: Vincent Tremblay <vincent@vtremblay.dev>
|
||||
Date: Tue, 27 Dec 2022 09:00:58 -0500
|
||||
Subject: [PATCH 2/2] spidev: Add Silicon Labs SI3210 device compatible
|
||||
Date: Tue, 27 Dec 2022 09:10:08 -0500
|
||||
Subject: [PATCH] spidev: Add Silicon Labs SI3210 device compatible
|
||||
|
||||
Add compatible string for Silicon Labs SI3210 device.
|
||||
|
||||
Note: This patch is adapted from a patch submitted to the for-next branch (v6.3).
|
||||
|
||||
Signed-off-by: Vincent Tremblay <vincent@vtremblay.dev>
|
||||
Link: https://lore.kernel.org/r/20221227141011.111410-2-vincent@vtremblay.dev
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
---
|
||||
drivers/spi/spidev.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
@ -0,0 +1,75 @@
|
||||
From 56364c910691f6d10ba88c964c9041b9ab777bd6 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Date: Mon, 25 Mar 2024 08:40:28 +0100
|
||||
Subject: [PATCH 1/4] net: Remove conditional threaded-NAPI wakeup based on
|
||||
task state.
|
||||
|
||||
A NAPI thread is scheduled by first setting NAPI_STATE_SCHED bit. If
|
||||
successful (the bit was not yet set) then the NAPI_STATE_SCHED_THREADED
|
||||
is set but only if thread's state is not TASK_INTERRUPTIBLE (is
|
||||
TASK_RUNNING) followed by task wakeup.
|
||||
|
||||
If the task is idle (TASK_INTERRUPTIBLE) then the
|
||||
NAPI_STATE_SCHED_THREADED bit is not set. The thread is no relying on
|
||||
the bit but always leaving the wait-loop after returning from schedule()
|
||||
because there must have been a wakeup.
|
||||
|
||||
The smpboot-threads implementation for per-CPU threads requires an
|
||||
explicit condition and does not support "if we get out of schedule()
|
||||
then there must be something to do".
|
||||
|
||||
Removing this optimisation simplifies the following integration.
|
||||
|
||||
Set NAPI_STATE_SCHED_THREADED unconditionally on wakeup and rely on it
|
||||
in the wait path by removing the `woken' condition.
|
||||
|
||||
Acked-by: Jakub Kicinski <kuba@kernel.org>
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
---
|
||||
net/core/dev.c | 14 ++------------
|
||||
1 file changed, 2 insertions(+), 12 deletions(-)
|
||||
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -4473,13 +4473,7 @@ static inline void ____napi_schedule(str
|
||||
*/
|
||||
thread = READ_ONCE(napi->thread);
|
||||
if (thread) {
|
||||
- /* Avoid doing set_bit() if the thread is in
|
||||
- * INTERRUPTIBLE state, cause napi_thread_wait()
|
||||
- * makes sure to proceed with napi polling
|
||||
- * if the thread is explicitly woken from here.
|
||||
- */
|
||||
- if (READ_ONCE(thread->__state) != TASK_INTERRUPTIBLE)
|
||||
- set_bit(NAPI_STATE_SCHED_THREADED, &napi->state);
|
||||
+ set_bit(NAPI_STATE_SCHED_THREADED, &napi->state);
|
||||
wake_up_process(thread);
|
||||
return;
|
||||
}
|
||||
@@ -6635,8 +6629,6 @@ static int napi_poll(struct napi_struct
|
||||
|
||||
static int napi_thread_wait(struct napi_struct *napi)
|
||||
{
|
||||
- bool woken = false;
|
||||
-
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
|
||||
while (!kthread_should_stop()) {
|
||||
@@ -6645,15 +6637,13 @@ static int napi_thread_wait(struct napi_
|
||||
* Testing SCHED bit is not enough because SCHED bit might be
|
||||
* set by some other busy poll thread or by napi_disable().
|
||||
*/
|
||||
- if (test_bit(NAPI_STATE_SCHED_THREADED, &napi->state) || woken) {
|
||||
+ if (test_bit(NAPI_STATE_SCHED_THREADED, &napi->state)) {
|
||||
WARN_ON(!list_empty(&napi->poll_list));
|
||||
__set_current_state(TASK_RUNNING);
|
||||
return 0;
|
||||
}
|
||||
|
||||
schedule();
|
||||
- /* woken being true indicates this thread owns this napi. */
|
||||
- woken = true;
|
||||
set_current_state(TASK_INTERRUPTIBLE);
|
||||
}
|
||||
__set_current_state(TASK_RUNNING);
|
||||
@ -0,0 +1,330 @@
|
||||
From dad6b97702639fba27a2bd3e986982ad6f0db3a7 Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Date: Mon, 25 Mar 2024 08:40:29 +0100
|
||||
Subject: [PATCH 2/4] net: Allow to use SMP threads for backlog NAPI.
|
||||
|
||||
Backlog NAPI is a per-CPU NAPI struct only (with no device behind it)
|
||||
used by drivers which don't do NAPI them self, RPS and parts of the
|
||||
stack which need to avoid recursive deadlocks while processing a packet.
|
||||
|
||||
The non-NAPI driver use the CPU local backlog NAPI. If RPS is enabled
|
||||
then a flow for the skb is computed and based on the flow the skb can be
|
||||
enqueued on a remote CPU. Scheduling/ raising the softirq (for backlog's
|
||||
NAPI) on the remote CPU isn't trivial because the softirq is only
|
||||
scheduled on the local CPU and performed after the hardirq is done.
|
||||
In order to schedule a softirq on the remote CPU, an IPI is sent to the
|
||||
remote CPU which schedules the backlog-NAPI on the then local CPU.
|
||||
|
||||
On PREEMPT_RT interrupts are force-threaded. The soft interrupts are
|
||||
raised within the interrupt thread and processed after the interrupt
|
||||
handler completed still within the context of the interrupt thread. The
|
||||
softirq is handled in the context where it originated.
|
||||
|
||||
With force-threaded interrupts enabled, ksoftirqd is woken up if a
|
||||
softirq is raised from hardirq context. This is the case if it is raised
|
||||
from an IPI. Additionally there is a warning on PREEMPT_RT if the
|
||||
softirq is raised from the idle thread.
|
||||
This was done for two reasons:
|
||||
- With threaded interrupts the processing should happen in thread
|
||||
context (where it originated) and ksoftirqd is the only thread for
|
||||
this context if raised from hardirq. Using the currently running task
|
||||
instead would "punish" a random task.
|
||||
- Once ksoftirqd is active it consumes all further softirqs until it
|
||||
stops running. This changed recently and is no longer the case.
|
||||
|
||||
Instead of keeping the backlog NAPI in ksoftirqd (in force-threaded/
|
||||
PREEMPT_RT setups) I am proposing NAPI-threads for backlog.
|
||||
The "proper" setup with threaded-NAPI is not doable because the threads
|
||||
are not pinned to an individual CPU and can be modified by the user.
|
||||
Additionally a dummy network device would have to be assigned. Also
|
||||
CPU-hotplug has to be considered if additional CPUs show up.
|
||||
All this can be probably done/ solved but the smpboot-threads already
|
||||
provide this infrastructure.
|
||||
|
||||
Sending UDP packets over loopback expects that the packet is processed
|
||||
within the call. Delaying it by handing it over to the thread hurts
|
||||
performance. It is not beneficial to the outcome if the context switch
|
||||
happens immediately after enqueue or after a while to process a few
|
||||
packets in a batch.
|
||||
There is no need to always use the thread if the backlog NAPI is
|
||||
requested on the local CPU. This restores the loopback throuput. The
|
||||
performance drops mostly to the same value after enabling RPS on the
|
||||
loopback comparing the IPI and the tread result.
|
||||
|
||||
Create NAPI-threads for backlog if request during boot. The thread runs
|
||||
the inner loop from napi_threaded_poll(), the wait part is different. It
|
||||
checks for NAPI_STATE_SCHED (the backlog NAPI can not be disabled).
|
||||
|
||||
The NAPI threads for backlog are optional, it has to be enabled via the boot
|
||||
argument "thread_backlog_napi". It is mandatory for PREEMPT_RT to avoid the
|
||||
wakeup of ksoftirqd from the IPI.
|
||||
|
||||
Acked-by: Jakub Kicinski <kuba@kernel.org>
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
---
|
||||
net/core/dev.c | 148 +++++++++++++++++++++++++++++++++++++------------
|
||||
1 file changed, 113 insertions(+), 35 deletions(-)
|
||||
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -78,6 +78,7 @@
|
||||
#include <linux/slab.h>
|
||||
#include <linux/sched.h>
|
||||
#include <linux/sched/mm.h>
|
||||
+#include <linux/smpboot.h>
|
||||
#include <linux/mutex.h>
|
||||
#include <linux/rwsem.h>
|
||||
#include <linux/string.h>
|
||||
@@ -217,6 +218,31 @@ static inline struct hlist_head *dev_ind
|
||||
return &net->dev_index_head[ifindex & (NETDEV_HASHENTRIES - 1)];
|
||||
}
|
||||
|
||||
+#ifndef CONFIG_PREEMPT_RT
|
||||
+
|
||||
+static DEFINE_STATIC_KEY_FALSE(use_backlog_threads_key);
|
||||
+
|
||||
+static int __init setup_backlog_napi_threads(char *arg)
|
||||
+{
|
||||
+ static_branch_enable(&use_backlog_threads_key);
|
||||
+ return 0;
|
||||
+}
|
||||
+early_param("thread_backlog_napi", setup_backlog_napi_threads);
|
||||
+
|
||||
+static bool use_backlog_threads(void)
|
||||
+{
|
||||
+ return static_branch_unlikely(&use_backlog_threads_key);
|
||||
+}
|
||||
+
|
||||
+#else
|
||||
+
|
||||
+static bool use_backlog_threads(void)
|
||||
+{
|
||||
+ return true;
|
||||
+}
|
||||
+
|
||||
+#endif
|
||||
+
|
||||
static inline void rps_lock_irqsave(struct softnet_data *sd,
|
||||
unsigned long *flags)
|
||||
{
|
||||
@@ -4441,6 +4467,7 @@ EXPORT_SYMBOL(__dev_direct_xmit);
|
||||
/*************************************************************************
|
||||
* Receiver routines
|
||||
*************************************************************************/
|
||||
+static DEFINE_PER_CPU(struct task_struct *, backlog_napi);
|
||||
|
||||
int netdev_max_backlog __read_mostly = 1000;
|
||||
EXPORT_SYMBOL(netdev_max_backlog);
|
||||
@@ -4473,12 +4500,16 @@ static inline void ____napi_schedule(str
|
||||
*/
|
||||
thread = READ_ONCE(napi->thread);
|
||||
if (thread) {
|
||||
+ if (use_backlog_threads() && thread == raw_cpu_read(backlog_napi))
|
||||
+ goto use_local_napi;
|
||||
+
|
||||
set_bit(NAPI_STATE_SCHED_THREADED, &napi->state);
|
||||
wake_up_process(thread);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
+use_local_napi:
|
||||
list_add_tail(&napi->poll_list, &sd->poll_list);
|
||||
WRITE_ONCE(napi->list_owner, smp_processor_id());
|
||||
/* If not called from net_rx_action()
|
||||
@@ -4724,6 +4755,11 @@ static void napi_schedule_rps(struct sof
|
||||
|
||||
#ifdef CONFIG_RPS
|
||||
if (sd != mysd) {
|
||||
+ if (use_backlog_threads()) {
|
||||
+ __napi_schedule_irqoff(&sd->backlog);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
sd->rps_ipi_next = mysd->rps_ipi_list;
|
||||
mysd->rps_ipi_list = sd;
|
||||
|
||||
@@ -5947,7 +5983,7 @@ static void net_rps_action_and_irq_enabl
|
||||
#ifdef CONFIG_RPS
|
||||
struct softnet_data *remsd = sd->rps_ipi_list;
|
||||
|
||||
- if (remsd) {
|
||||
+ if (!use_backlog_threads() && remsd) {
|
||||
sd->rps_ipi_list = NULL;
|
||||
|
||||
local_irq_enable();
|
||||
@@ -5962,7 +5998,7 @@ static void net_rps_action_and_irq_enabl
|
||||
static bool sd_has_rps_ipi_waiting(struct softnet_data *sd)
|
||||
{
|
||||
#ifdef CONFIG_RPS
|
||||
- return sd->rps_ipi_list != NULL;
|
||||
+ return !use_backlog_threads() && sd->rps_ipi_list;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
@@ -6006,7 +6042,7 @@ static int process_backlog(struct napi_s
|
||||
* We can use a plain write instead of clear_bit(),
|
||||
* and we dont need an smp_mb() memory barrier.
|
||||
*/
|
||||
- napi->state = 0;
|
||||
+ napi->state &= NAPIF_STATE_THREADED;
|
||||
again = false;
|
||||
} else {
|
||||
skb_queue_splice_tail_init(&sd->input_pkt_queue,
|
||||
@@ -6672,43 +6708,48 @@ static void skb_defer_free_flush(struct
|
||||
}
|
||||
}
|
||||
|
||||
-static int napi_threaded_poll(void *data)
|
||||
+static void napi_threaded_poll_loop(struct napi_struct *napi)
|
||||
{
|
||||
- struct napi_struct *napi = data;
|
||||
struct softnet_data *sd;
|
||||
- void *have;
|
||||
+ unsigned long last_qs = jiffies;
|
||||
|
||||
- while (!napi_thread_wait(napi)) {
|
||||
- unsigned long last_qs = jiffies;
|
||||
+ for (;;) {
|
||||
+ bool repoll = false;
|
||||
+ void *have;
|
||||
|
||||
- for (;;) {
|
||||
- bool repoll = false;
|
||||
+ local_bh_disable();
|
||||
+ sd = this_cpu_ptr(&softnet_data);
|
||||
+ sd->in_napi_threaded_poll = true;
|
||||
|
||||
- local_bh_disable();
|
||||
- sd = this_cpu_ptr(&softnet_data);
|
||||
- sd->in_napi_threaded_poll = true;
|
||||
-
|
||||
- have = netpoll_poll_lock(napi);
|
||||
- __napi_poll(napi, &repoll);
|
||||
- netpoll_poll_unlock(have);
|
||||
-
|
||||
- sd->in_napi_threaded_poll = false;
|
||||
- barrier();
|
||||
-
|
||||
- if (sd_has_rps_ipi_waiting(sd)) {
|
||||
- local_irq_disable();
|
||||
- net_rps_action_and_irq_enable(sd);
|
||||
- }
|
||||
- skb_defer_free_flush(sd);
|
||||
- local_bh_enable();
|
||||
+ have = netpoll_poll_lock(napi);
|
||||
+ __napi_poll(napi, &repoll);
|
||||
+ netpoll_poll_unlock(have);
|
||||
+
|
||||
+ sd->in_napi_threaded_poll = false;
|
||||
+ barrier();
|
||||
+
|
||||
+ if (sd_has_rps_ipi_waiting(sd)) {
|
||||
+ local_irq_disable();
|
||||
+ net_rps_action_and_irq_enable(sd);
|
||||
+ }
|
||||
+ skb_defer_free_flush(sd);
|
||||
+ local_bh_enable();
|
||||
|
||||
- if (!repoll)
|
||||
- break;
|
||||
+ if (!repoll)
|
||||
+ break;
|
||||
|
||||
- rcu_softirq_qs_periodic(last_qs);
|
||||
- cond_resched();
|
||||
- }
|
||||
+ rcu_softirq_qs_periodic(last_qs);
|
||||
+ cond_resched();
|
||||
}
|
||||
+}
|
||||
+
|
||||
+static int napi_threaded_poll(void *data)
|
||||
+{
|
||||
+ struct napi_struct *napi = data;
|
||||
+
|
||||
+ while (!napi_thread_wait(napi))
|
||||
+ napi_threaded_poll_loop(napi);
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -11289,7 +11330,7 @@ static int dev_cpu_dead(unsigned int old
|
||||
|
||||
list_del_init(&napi->poll_list);
|
||||
if (napi->poll == process_backlog)
|
||||
- napi->state = 0;
|
||||
+ napi->state &= NAPIF_STATE_THREADED;
|
||||
else
|
||||
____napi_schedule(sd, napi);
|
||||
}
|
||||
@@ -11297,12 +11338,14 @@ static int dev_cpu_dead(unsigned int old
|
||||
raise_softirq_irqoff(NET_TX_SOFTIRQ);
|
||||
local_irq_enable();
|
||||
|
||||
+ if (!use_backlog_threads()) {
|
||||
#ifdef CONFIG_RPS
|
||||
- remsd = oldsd->rps_ipi_list;
|
||||
- oldsd->rps_ipi_list = NULL;
|
||||
+ remsd = oldsd->rps_ipi_list;
|
||||
+ oldsd->rps_ipi_list = NULL;
|
||||
#endif
|
||||
- /* send out pending IPI's on offline CPU */
|
||||
- net_rps_send_ipi(remsd);
|
||||
+ /* send out pending IPI's on offline CPU */
|
||||
+ net_rps_send_ipi(remsd);
|
||||
+ }
|
||||
|
||||
/* Process offline CPU's input_pkt_queue */
|
||||
while ((skb = __skb_dequeue(&oldsd->process_queue))) {
|
||||
@@ -11565,6 +11608,38 @@ static struct pernet_operations __net_in
|
||||
*
|
||||
*/
|
||||
|
||||
+static int backlog_napi_should_run(unsigned int cpu)
|
||||
+{
|
||||
+ struct softnet_data *sd = per_cpu_ptr(&softnet_data, cpu);
|
||||
+ struct napi_struct *napi = &sd->backlog;
|
||||
+
|
||||
+ return test_bit(NAPI_STATE_SCHED_THREADED, &napi->state);
|
||||
+}
|
||||
+
|
||||
+static void run_backlog_napi(unsigned int cpu)
|
||||
+{
|
||||
+ struct softnet_data *sd = per_cpu_ptr(&softnet_data, cpu);
|
||||
+
|
||||
+ napi_threaded_poll_loop(&sd->backlog);
|
||||
+}
|
||||
+
|
||||
+static void backlog_napi_setup(unsigned int cpu)
|
||||
+{
|
||||
+ struct softnet_data *sd = per_cpu_ptr(&softnet_data, cpu);
|
||||
+ struct napi_struct *napi = &sd->backlog;
|
||||
+
|
||||
+ napi->thread = this_cpu_read(backlog_napi);
|
||||
+ set_bit(NAPI_STATE_THREADED, &napi->state);
|
||||
+}
|
||||
+
|
||||
+static struct smp_hotplug_thread backlog_threads = {
|
||||
+ .store = &backlog_napi,
|
||||
+ .thread_should_run = backlog_napi_should_run,
|
||||
+ .thread_fn = run_backlog_napi,
|
||||
+ .thread_comm = "backlog_napi/%u",
|
||||
+ .setup = backlog_napi_setup,
|
||||
+};
|
||||
+
|
||||
/*
|
||||
* This is called single threaded during boot, so no need
|
||||
* to take the rtnl semaphore.
|
||||
@@ -11615,7 +11690,10 @@ static int __init net_dev_init(void)
|
||||
init_gro_hash(&sd->backlog);
|
||||
sd->backlog.poll = process_backlog;
|
||||
sd->backlog.weight = weight_p;
|
||||
+ INIT_LIST_HEAD(&sd->backlog.poll_list);
|
||||
}
|
||||
+ if (use_backlog_threads())
|
||||
+ smpboot_register_percpu_thread(&backlog_threads);
|
||||
|
||||
dev_boot_phase = 0;
|
||||
|
||||
@ -0,0 +1,121 @@
|
||||
From 80d2eefcb4c84aa9018b2a997ab3a4c567bc821a Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Date: Mon, 25 Mar 2024 08:40:30 +0100
|
||||
Subject: [PATCH 3/4] net: Use backlog-NAPI to clean up the defer_list.
|
||||
|
||||
The defer_list is a per-CPU list which is used to free skbs outside of
|
||||
the socket lock and on the CPU on which they have been allocated.
|
||||
The list is processed during NAPI callbacks so ideally the list is
|
||||
cleaned up.
|
||||
Should the amount of skbs on the list exceed a certain water mark then
|
||||
the softirq is triggered remotely on the target CPU by invoking a remote
|
||||
function call. The raise of the softirqs via a remote function call
|
||||
leads to waking the ksoftirqd on PREEMPT_RT which is undesired.
|
||||
The backlog-NAPI threads already provide the infrastructure which can be
|
||||
utilized to perform the cleanup of the defer_list.
|
||||
|
||||
The NAPI state is updated with the input_pkt_queue.lock acquired. It
|
||||
order not to break the state, it is needed to also wake the backlog-NAPI
|
||||
thread with the lock held. This requires to acquire the use the lock in
|
||||
rps_lock_irq*() if the backlog-NAPI threads are used even with RPS
|
||||
disabled.
|
||||
|
||||
Move the logic of remotely starting softirqs to clean up the defer_list
|
||||
into kick_defer_list_purge(). Make sure a lock is held in
|
||||
rps_lock_irq*() if backlog-NAPI threads are used. Schedule backlog-NAPI
|
||||
for defer_list cleanup if backlog-NAPI is available.
|
||||
|
||||
Acked-by: Jakub Kicinski <kuba@kernel.org>
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
---
|
||||
include/linux/netdevice.h | 1 +
|
||||
net/core/dev.c | 25 +++++++++++++++++++++----
|
||||
net/core/skbuff.c | 4 ++--
|
||||
3 files changed, 24 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/include/linux/netdevice.h
|
||||
+++ b/include/linux/netdevice.h
|
||||
@@ -3300,6 +3300,7 @@ static inline void dev_xmit_recursion_de
|
||||
__this_cpu_dec(softnet_data.xmit.recursion);
|
||||
}
|
||||
|
||||
+void kick_defer_list_purge(struct softnet_data *sd, unsigned int cpu);
|
||||
void __netif_schedule(struct Qdisc *q);
|
||||
void netif_schedule_queue(struct netdev_queue *txq);
|
||||
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -246,7 +246,7 @@ static bool use_backlog_threads(void)
|
||||
static inline void rps_lock_irqsave(struct softnet_data *sd,
|
||||
unsigned long *flags)
|
||||
{
|
||||
- if (IS_ENABLED(CONFIG_RPS))
|
||||
+ if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
|
||||
spin_lock_irqsave(&sd->input_pkt_queue.lock, *flags);
|
||||
else if (!IS_ENABLED(CONFIG_PREEMPT_RT))
|
||||
local_irq_save(*flags);
|
||||
@@ -254,7 +254,7 @@ static inline void rps_lock_irqsave(stru
|
||||
|
||||
static inline void rps_lock_irq_disable(struct softnet_data *sd)
|
||||
{
|
||||
- if (IS_ENABLED(CONFIG_RPS))
|
||||
+ if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
|
||||
spin_lock_irq(&sd->input_pkt_queue.lock);
|
||||
else if (!IS_ENABLED(CONFIG_PREEMPT_RT))
|
||||
local_irq_disable();
|
||||
@@ -263,7 +263,7 @@ static inline void rps_lock_irq_disable(
|
||||
static inline void rps_unlock_irq_restore(struct softnet_data *sd,
|
||||
unsigned long *flags)
|
||||
{
|
||||
- if (IS_ENABLED(CONFIG_RPS))
|
||||
+ if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
|
||||
spin_unlock_irqrestore(&sd->input_pkt_queue.lock, *flags);
|
||||
else if (!IS_ENABLED(CONFIG_PREEMPT_RT))
|
||||
local_irq_restore(*flags);
|
||||
@@ -271,7 +271,7 @@ static inline void rps_unlock_irq_restor
|
||||
|
||||
static inline void rps_unlock_irq_enable(struct softnet_data *sd)
|
||||
{
|
||||
- if (IS_ENABLED(CONFIG_RPS))
|
||||
+ if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
|
||||
spin_unlock_irq(&sd->input_pkt_queue.lock);
|
||||
else if (!IS_ENABLED(CONFIG_PREEMPT_RT))
|
||||
local_irq_enable();
|
||||
@@ -4774,6 +4774,23 @@ static void napi_schedule_rps(struct sof
|
||||
__napi_schedule_irqoff(&mysd->backlog);
|
||||
}
|
||||
|
||||
+void kick_defer_list_purge(struct softnet_data *sd, unsigned int cpu)
|
||||
+{
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ if (use_backlog_threads()) {
|
||||
+ rps_lock_irqsave(sd, &flags);
|
||||
+
|
||||
+ if (!__test_and_set_bit(NAPI_STATE_SCHED, &sd->backlog.state))
|
||||
+ __napi_schedule_irqoff(&sd->backlog);
|
||||
+
|
||||
+ rps_unlock_irq_restore(sd, &flags);
|
||||
+
|
||||
+ } else if (!cmpxchg(&sd->defer_ipi_scheduled, 0, 1)) {
|
||||
+ smp_call_function_single_async(cpu, &sd->defer_csd);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
#ifdef CONFIG_NET_FLOW_LIMIT
|
||||
int netdev_flow_limit_table_len __read_mostly = (1 << 12);
|
||||
#endif
|
||||
--- a/net/core/skbuff.c
|
||||
+++ b/net/core/skbuff.c
|
||||
@@ -6863,8 +6863,8 @@ nodefer: __kfree_skb(skb);
|
||||
/* Make sure to trigger NET_RX_SOFTIRQ on the remote CPU
|
||||
* if we are unlucky enough (this seems very unlikely).
|
||||
*/
|
||||
- if (unlikely(kick) && !cmpxchg(&sd->defer_ipi_scheduled, 0, 1))
|
||||
- smp_call_function_single_async(cpu, &sd->defer_csd);
|
||||
+ if (unlikely(kick))
|
||||
+ kick_defer_list_purge(sd, cpu);
|
||||
}
|
||||
|
||||
static void skb_splice_csum_page(struct sk_buff *skb, struct page *page,
|
||||
@ -0,0 +1,164 @@
|
||||
From 765b11f8f4e20b7433e4ba4a3e9106a0d59501ed Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Date: Mon, 25 Mar 2024 08:40:31 +0100
|
||||
Subject: [PATCH 4/4] net: Rename rps_lock to backlog_lock.
|
||||
|
||||
The rps_lock.*() functions use the inner lock of a sk_buff_head for
|
||||
locking. This lock is used if RPS is enabled, otherwise the list is
|
||||
accessed lockless and disabling interrupts is enough for the
|
||||
synchronisation because it is only accessed CPU local. Not only the list
|
||||
is protected but also the NAPI state protected.
|
||||
With the addition of backlog threads, the lock is also needed because of
|
||||
the cross CPU access even without RPS. The clean up of the defer_list
|
||||
list is also done via backlog threads (if enabled).
|
||||
|
||||
It has been suggested to rename the locking function since it is no
|
||||
longer just RPS.
|
||||
|
||||
Rename the rps_lock*() functions to backlog_lock*().
|
||||
|
||||
Suggested-by: Jakub Kicinski <kuba@kernel.org>
|
||||
Acked-by: Jakub Kicinski <kuba@kernel.org>
|
||||
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
|
||||
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
---
|
||||
net/core/dev.c | 34 +++++++++++++++++-----------------
|
||||
1 file changed, 17 insertions(+), 17 deletions(-)
|
||||
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -243,8 +243,8 @@ static bool use_backlog_threads(void)
|
||||
|
||||
#endif
|
||||
|
||||
-static inline void rps_lock_irqsave(struct softnet_data *sd,
|
||||
- unsigned long *flags)
|
||||
+static inline void backlog_lock_irq_save(struct softnet_data *sd,
|
||||
+ unsigned long *flags)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
|
||||
spin_lock_irqsave(&sd->input_pkt_queue.lock, *flags);
|
||||
@@ -252,7 +252,7 @@ static inline void rps_lock_irqsave(stru
|
||||
local_irq_save(*flags);
|
||||
}
|
||||
|
||||
-static inline void rps_lock_irq_disable(struct softnet_data *sd)
|
||||
+static inline void backlog_lock_irq_disable(struct softnet_data *sd)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
|
||||
spin_lock_irq(&sd->input_pkt_queue.lock);
|
||||
@@ -260,8 +260,8 @@ static inline void rps_lock_irq_disable(
|
||||
local_irq_disable();
|
||||
}
|
||||
|
||||
-static inline void rps_unlock_irq_restore(struct softnet_data *sd,
|
||||
- unsigned long *flags)
|
||||
+static inline void backlog_unlock_irq_restore(struct softnet_data *sd,
|
||||
+ unsigned long *flags)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
|
||||
spin_unlock_irqrestore(&sd->input_pkt_queue.lock, *flags);
|
||||
@@ -269,7 +269,7 @@ static inline void rps_unlock_irq_restor
|
||||
local_irq_restore(*flags);
|
||||
}
|
||||
|
||||
-static inline void rps_unlock_irq_enable(struct softnet_data *sd)
|
||||
+static inline void backlog_unlock_irq_enable(struct softnet_data *sd)
|
||||
{
|
||||
if (IS_ENABLED(CONFIG_RPS) || use_backlog_threads())
|
||||
spin_unlock_irq(&sd->input_pkt_queue.lock);
|
||||
@@ -4779,12 +4779,12 @@ void kick_defer_list_purge(struct softne
|
||||
unsigned long flags;
|
||||
|
||||
if (use_backlog_threads()) {
|
||||
- rps_lock_irqsave(sd, &flags);
|
||||
+ backlog_lock_irq_save(sd, &flags);
|
||||
|
||||
if (!__test_and_set_bit(NAPI_STATE_SCHED, &sd->backlog.state))
|
||||
__napi_schedule_irqoff(&sd->backlog);
|
||||
|
||||
- rps_unlock_irq_restore(sd, &flags);
|
||||
+ backlog_unlock_irq_restore(sd, &flags);
|
||||
|
||||
} else if (!cmpxchg(&sd->defer_ipi_scheduled, 0, 1)) {
|
||||
smp_call_function_single_async(cpu, &sd->defer_csd);
|
||||
@@ -4846,7 +4846,7 @@ static int enqueue_to_backlog(struct sk_
|
||||
reason = SKB_DROP_REASON_NOT_SPECIFIED;
|
||||
sd = &per_cpu(softnet_data, cpu);
|
||||
|
||||
- rps_lock_irqsave(sd, &flags);
|
||||
+ backlog_lock_irq_save(sd, &flags);
|
||||
if (!netif_running(skb->dev))
|
||||
goto drop;
|
||||
qlen = skb_queue_len(&sd->input_pkt_queue);
|
||||
@@ -4855,7 +4855,7 @@ static int enqueue_to_backlog(struct sk_
|
||||
enqueue:
|
||||
__skb_queue_tail(&sd->input_pkt_queue, skb);
|
||||
input_queue_tail_incr_save(sd, qtail);
|
||||
- rps_unlock_irq_restore(sd, &flags);
|
||||
+ backlog_unlock_irq_restore(sd, &flags);
|
||||
return NET_RX_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -4870,7 +4870,7 @@ enqueue:
|
||||
|
||||
drop:
|
||||
sd->dropped++;
|
||||
- rps_unlock_irq_restore(sd, &flags);
|
||||
+ backlog_unlock_irq_restore(sd, &flags);
|
||||
|
||||
dev_core_stats_rx_dropped_inc(skb->dev);
|
||||
kfree_skb_reason(skb, reason);
|
||||
@@ -5901,7 +5901,7 @@ static void flush_backlog(struct work_st
|
||||
local_bh_disable();
|
||||
sd = this_cpu_ptr(&softnet_data);
|
||||
|
||||
- rps_lock_irq_disable(sd);
|
||||
+ backlog_lock_irq_disable(sd);
|
||||
skb_queue_walk_safe(&sd->input_pkt_queue, skb, tmp) {
|
||||
if (skb->dev->reg_state == NETREG_UNREGISTERING) {
|
||||
__skb_unlink(skb, &sd->input_pkt_queue);
|
||||
@@ -5909,7 +5909,7 @@ static void flush_backlog(struct work_st
|
||||
input_queue_head_incr(sd);
|
||||
}
|
||||
}
|
||||
- rps_unlock_irq_enable(sd);
|
||||
+ backlog_unlock_irq_enable(sd);
|
||||
|
||||
skb_queue_walk_safe(&sd->process_queue, skb, tmp) {
|
||||
if (skb->dev->reg_state == NETREG_UNREGISTERING) {
|
||||
@@ -5927,14 +5927,14 @@ static bool flush_required(int cpu)
|
||||
struct softnet_data *sd = &per_cpu(softnet_data, cpu);
|
||||
bool do_flush;
|
||||
|
||||
- rps_lock_irq_disable(sd);
|
||||
+ backlog_lock_irq_disable(sd);
|
||||
|
||||
/* as insertion into process_queue happens with the rps lock held,
|
||||
* process_queue access may race only with dequeue
|
||||
*/
|
||||
do_flush = !skb_queue_empty(&sd->input_pkt_queue) ||
|
||||
!skb_queue_empty_lockless(&sd->process_queue);
|
||||
- rps_unlock_irq_enable(sd);
|
||||
+ backlog_unlock_irq_enable(sd);
|
||||
|
||||
return do_flush;
|
||||
#endif
|
||||
@@ -6049,7 +6049,7 @@ static int process_backlog(struct napi_s
|
||||
|
||||
}
|
||||
|
||||
- rps_lock_irq_disable(sd);
|
||||
+ backlog_lock_irq_disable(sd);
|
||||
if (skb_queue_empty(&sd->input_pkt_queue)) {
|
||||
/*
|
||||
* Inline a custom version of __napi_complete().
|
||||
@@ -6065,7 +6065,7 @@ static int process_backlog(struct napi_s
|
||||
skb_queue_splice_tail_init(&sd->input_pkt_queue,
|
||||
&sd->process_queue);
|
||||
}
|
||||
- rps_unlock_irq_enable(sd);
|
||||
+ backlog_unlock_irq_enable(sd);
|
||||
}
|
||||
|
||||
return work;
|
||||
@ -85,7 +85,7 @@ Signed-off-by: Paolo Abeni <pabeni@redhat.com>
|
||||
/**
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -6555,7 +6555,7 @@ static int __napi_poll(struct napi_struc
|
||||
@@ -6602,7 +6602,7 @@ static int __napi_poll(struct napi_struc
|
||||
* accidentally calling ->poll() when NAPI is not scheduled.
|
||||
*/
|
||||
work = 0;
|
||||
|
||||
@ -19,7 +19,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
--- a/include/linux/netdevice.h
|
||||
+++ b/include/linux/netdevice.h
|
||||
@@ -1759,6 +1759,7 @@ enum netdev_priv_flags {
|
||||
@@ -1758,6 +1758,7 @@ enum netdev_priv_flags {
|
||||
IFF_TX_SKB_NO_LINEAR = BIT_ULL(31),
|
||||
IFF_CHANGE_PROTO_DOWN = BIT_ULL(32),
|
||||
IFF_SEE_ALL_HWTSTAMP_REQUESTS = BIT_ULL(33),
|
||||
@ -27,7 +27,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
};
|
||||
|
||||
#define IFF_802_1Q_VLAN IFF_802_1Q_VLAN
|
||||
@@ -1792,6 +1793,7 @@ enum netdev_priv_flags {
|
||||
@@ -1791,6 +1792,7 @@ enum netdev_priv_flags {
|
||||
#define IFF_FAILOVER_SLAVE IFF_FAILOVER_SLAVE
|
||||
#define IFF_L3MDEV_RX_HANDLER IFF_L3MDEV_RX_HANDLER
|
||||
#define IFF_TX_SKB_NO_LINEAR IFF_TX_SKB_NO_LINEAR
|
||||
@ -35,7 +35,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
|
||||
/* Specifies the type of the struct net_device::ml_priv pointer */
|
||||
enum netdev_ml_priv_type {
|
||||
@@ -2184,6 +2186,11 @@ struct net_device {
|
||||
@@ -2183,6 +2185,11 @@ struct net_device {
|
||||
const struct tlsdev_ops *tlsdev_ops;
|
||||
#endif
|
||||
|
||||
@ -47,7 +47,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
const struct header_ops *header_ops;
|
||||
|
||||
unsigned char operstate;
|
||||
@@ -2257,6 +2264,10 @@ struct net_device {
|
||||
@@ -2256,6 +2263,10 @@ struct net_device {
|
||||
struct mctp_dev __rcu *mctp_ptr;
|
||||
#endif
|
||||
|
||||
@ -105,7 +105,7 @@ Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
help
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -3571,6 +3571,11 @@ static int xmit_one(struct sk_buff *skb,
|
||||
@@ -3597,6 +3597,11 @@ static int xmit_one(struct sk_buff *skb,
|
||||
if (dev_nit_active(dev))
|
||||
dev_queue_xmit_nit(skb, dev);
|
||||
|
||||
|
||||
@ -1,227 +0,0 @@
|
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Thu, 16 Feb 2023 18:39:04 +0100
|
||||
Subject: [PATCH] net/core: add optional threading for backlog processing
|
||||
|
||||
When dealing with few flows or an imbalance on CPU utilization, static RPS
|
||||
CPU assignment can be too inflexible. Add support for enabling threaded NAPI
|
||||
for backlog processing in order to allow the scheduler to better balance
|
||||
processing. This helps better spread the load across idle CPUs.
|
||||
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/include/linux/netdevice.h
|
||||
+++ b/include/linux/netdevice.h
|
||||
@@ -558,6 +558,7 @@ static inline bool napi_complete(struct
|
||||
}
|
||||
|
||||
int dev_set_threaded(struct net_device *dev, bool threaded);
|
||||
+int backlog_set_threaded(bool threaded);
|
||||
|
||||
/**
|
||||
* napi_disable - prevent NAPI from scheduling
|
||||
@@ -3236,6 +3237,7 @@ struct softnet_data {
|
||||
/* stats */
|
||||
unsigned int processed;
|
||||
unsigned int time_squeeze;
|
||||
+ unsigned int process_queue_empty;
|
||||
#ifdef CONFIG_RPS
|
||||
struct softnet_data *rps_ipi_list;
|
||||
#endif
|
||||
--- a/net/core/dev.c
|
||||
+++ b/net/core/dev.c
|
||||
@@ -4729,7 +4729,7 @@ static void napi_schedule_rps(struct sof
|
||||
struct softnet_data *mysd = this_cpu_ptr(&softnet_data);
|
||||
|
||||
#ifdef CONFIG_RPS
|
||||
- if (sd != mysd) {
|
||||
+ if (sd != mysd && !test_bit(NAPI_STATE_THREADED, &sd->backlog.state)) {
|
||||
sd->rps_ipi_next = mysd->rps_ipi_list;
|
||||
mysd->rps_ipi_list = sd;
|
||||
|
||||
@@ -5848,6 +5848,8 @@ static DEFINE_PER_CPU(struct work_struct
|
||||
/* Network device is going away, flush any packets still pending */
|
||||
static void flush_backlog(struct work_struct *work)
|
||||
{
|
||||
+ unsigned int process_queue_empty;
|
||||
+ bool threaded, flush_processq;
|
||||
struct sk_buff *skb, *tmp;
|
||||
struct softnet_data *sd;
|
||||
|
||||
@@ -5862,8 +5864,17 @@ static void flush_backlog(struct work_st
|
||||
input_queue_head_incr(sd);
|
||||
}
|
||||
}
|
||||
+
|
||||
+ threaded = test_bit(NAPI_STATE_THREADED, &sd->backlog.state);
|
||||
+ flush_processq = threaded &&
|
||||
+ !skb_queue_empty_lockless(&sd->process_queue);
|
||||
+ if (flush_processq)
|
||||
+ process_queue_empty = sd->process_queue_empty;
|
||||
rps_unlock_irq_enable(sd);
|
||||
|
||||
+ if (threaded)
|
||||
+ goto out;
|
||||
+
|
||||
skb_queue_walk_safe(&sd->process_queue, skb, tmp) {
|
||||
if (skb->dev->reg_state == NETREG_UNREGISTERING) {
|
||||
__skb_unlink(skb, &sd->process_queue);
|
||||
@@ -5871,7 +5882,16 @@ static void flush_backlog(struct work_st
|
||||
input_queue_head_incr(sd);
|
||||
}
|
||||
}
|
||||
+
|
||||
+out:
|
||||
local_bh_enable();
|
||||
+
|
||||
+ while (flush_processq) {
|
||||
+ msleep(1);
|
||||
+ rps_lock_irq_disable(sd);
|
||||
+ flush_processq = process_queue_empty == sd->process_queue_empty;
|
||||
+ rps_unlock_irq_enable(sd);
|
||||
+ }
|
||||
}
|
||||
|
||||
static bool flush_required(int cpu)
|
||||
@@ -6003,6 +6023,7 @@ static int process_backlog(struct napi_s
|
||||
}
|
||||
|
||||
rps_lock_irq_disable(sd);
|
||||
+ sd->process_queue_empty++;
|
||||
if (skb_queue_empty(&sd->input_pkt_queue)) {
|
||||
/*
|
||||
* Inline a custom version of __napi_complete().
|
||||
@@ -6012,7 +6033,8 @@ static int process_backlog(struct napi_s
|
||||
* We can use a plain write instead of clear_bit(),
|
||||
* and we dont need an smp_mb() memory barrier.
|
||||
*/
|
||||
- napi->state = 0;
|
||||
+ napi->state &= ~(NAPIF_STATE_SCHED |
|
||||
+ NAPIF_STATE_SCHED_THREADED);
|
||||
again = false;
|
||||
} else {
|
||||
skb_queue_splice_tail_init(&sd->input_pkt_queue,
|
||||
@@ -6426,6 +6448,55 @@ int dev_set_threaded(struct net_device *
|
||||
}
|
||||
EXPORT_SYMBOL(dev_set_threaded);
|
||||
|
||||
+int backlog_set_threaded(bool threaded)
|
||||
+{
|
||||
+ static bool backlog_threaded;
|
||||
+ int err = 0;
|
||||
+ int i;
|
||||
+
|
||||
+ if (backlog_threaded == threaded)
|
||||
+ return 0;
|
||||
+
|
||||
+ for_each_possible_cpu(i) {
|
||||
+ struct softnet_data *sd = &per_cpu(softnet_data, i);
|
||||
+ struct napi_struct *n = &sd->backlog;
|
||||
+
|
||||
+ if (n->thread)
|
||||
+ continue;
|
||||
+ n->thread = kthread_run(napi_threaded_poll, n, "napi/backlog-%d", i);
|
||||
+ if (IS_ERR(n->thread)) {
|
||||
+ err = PTR_ERR(n->thread);
|
||||
+ pr_err("kthread_run failed with err %d\n", err);
|
||||
+ n->thread = NULL;
|
||||
+ threaded = false;
|
||||
+ break;
|
||||
+ }
|
||||
+
|
||||
+ }
|
||||
+
|
||||
+ backlog_threaded = threaded;
|
||||
+
|
||||
+ /* Make sure kthread is created before THREADED bit
|
||||
+ * is set.
|
||||
+ */
|
||||
+ smp_mb__before_atomic();
|
||||
+
|
||||
+ for_each_possible_cpu(i) {
|
||||
+ struct softnet_data *sd = &per_cpu(softnet_data, i);
|
||||
+ struct napi_struct *n = &sd->backlog;
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ rps_lock_irqsave(sd, &flags);
|
||||
+ if (threaded)
|
||||
+ n->state |= NAPIF_STATE_THREADED;
|
||||
+ else
|
||||
+ n->state &= ~NAPIF_STATE_THREADED;
|
||||
+ rps_unlock_irq_restore(sd, &flags);
|
||||
+ }
|
||||
+
|
||||
+ return err;
|
||||
+}
|
||||
+
|
||||
void netif_napi_add_weight(struct net_device *dev, struct napi_struct *napi,
|
||||
int (*poll)(struct napi_struct *, int), int weight)
|
||||
{
|
||||
@@ -11307,6 +11378,9 @@ static int dev_cpu_dead(unsigned int old
|
||||
raise_softirq_irqoff(NET_TX_SOFTIRQ);
|
||||
local_irq_enable();
|
||||
|
||||
+ if (test_bit(NAPI_STATE_THREADED, &oldsd->backlog.state))
|
||||
+ return 0;
|
||||
+
|
||||
#ifdef CONFIG_RPS
|
||||
remsd = oldsd->rps_ipi_list;
|
||||
oldsd->rps_ipi_list = NULL;
|
||||
@@ -11622,6 +11696,7 @@ static int __init net_dev_init(void)
|
||||
INIT_CSD(&sd->defer_csd, trigger_rx_softirq, sd);
|
||||
spin_lock_init(&sd->defer_lock);
|
||||
|
||||
+ INIT_LIST_HEAD(&sd->backlog.poll_list);
|
||||
init_gro_hash(&sd->backlog);
|
||||
sd->backlog.poll = process_backlog;
|
||||
sd->backlog.weight = weight_p;
|
||||
--- a/net/core/sysctl_net_core.c
|
||||
+++ b/net/core/sysctl_net_core.c
|
||||
@@ -30,6 +30,7 @@ static int int_3600 = 3600;
|
||||
static int min_sndbuf = SOCK_MIN_SNDBUF;
|
||||
static int min_rcvbuf = SOCK_MIN_RCVBUF;
|
||||
static int max_skb_frags = MAX_SKB_FRAGS;
|
||||
+static int backlog_threaded;
|
||||
static int min_mem_pcpu_rsv = SK_MEMORY_PCPU_RESERVE;
|
||||
|
||||
static int net_msg_warn; /* Unused, but still a sysctl */
|
||||
@@ -189,6 +190,23 @@ static int rps_sock_flow_sysctl(struct c
|
||||
}
|
||||
#endif /* CONFIG_RPS */
|
||||
|
||||
+static int backlog_threaded_sysctl(struct ctl_table *table, int write,
|
||||
+ void *buffer, size_t *lenp, loff_t *ppos)
|
||||
+{
|
||||
+ static DEFINE_MUTEX(backlog_threaded_mutex);
|
||||
+ int ret;
|
||||
+
|
||||
+ mutex_lock(&backlog_threaded_mutex);
|
||||
+
|
||||
+ ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);
|
||||
+ if (write && !ret)
|
||||
+ ret = backlog_set_threaded(backlog_threaded);
|
||||
+
|
||||
+ mutex_unlock(&backlog_threaded_mutex);
|
||||
+
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
#ifdef CONFIG_NET_FLOW_LIMIT
|
||||
static DEFINE_MUTEX(flow_limit_update_mutex);
|
||||
|
||||
@@ -541,6 +559,15 @@ static struct ctl_table net_core_table[]
|
||||
.proc_handler = rps_sock_flow_sysctl
|
||||
},
|
||||
#endif
|
||||
+ {
|
||||
+ .procname = "backlog_threaded",
|
||||
+ .data = &backlog_threaded,
|
||||
+ .maxlen = sizeof(unsigned int),
|
||||
+ .mode = 0644,
|
||||
+ .proc_handler = backlog_threaded_sysctl,
|
||||
+ .extra1 = SYSCTL_ZERO,
|
||||
+ .extra2 = SYSCTL_ONE
|
||||
+ },
|
||||
#ifdef CONFIG_NET_FLOW_LIMIT
|
||||
{
|
||||
.procname = "flow_limit_cpu_bitmap",
|
||||
@ -16,7 +16,7 @@
|
||||
regulator-max-microvolt = <5000000>;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
gpio = <&tlmm 25 GPIO_ACTIVE_LOW>;
|
||||
gpios = <&tlmm 25 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@
|
||||
regulator-max-microvolt = <5000000>;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
gpio = <&tlmm 68 GPIO_ACTIVE_LOW>;
|
||||
gpios = <&tlmm 68 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@
|
||||
enable-active-high;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
gpio = <&gpio0 24 0>;
|
||||
gpios = <&gpio0 24 0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -96,7 +96,7 @@
|
||||
enable-active-high;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -110,7 +110,7 @@
|
||||
regulator-max-microvolt = <5000000>;
|
||||
enable-active-high;
|
||||
regulator-always-on;
|
||||
gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -117,7 +117,7 @@
|
||||
enable-active-high;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
gpio = <&gpio0 24 0>;
|
||||
gpios = <&gpio0 24 0>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -96,7 +96,7 @@
|
||||
enable-active-high;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio0 29 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -110,7 +110,7 @@
|
||||
regulator-max-microvolt = <5000000>;
|
||||
enable-active-high;
|
||||
regulator-always-on;
|
||||
gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -160,7 +160,7 @@ Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ gpio = <&gpio0 21 GPIO_ACTIVE_HIGH>;
|
||||
+ gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ sata1_power: regulator@2 {
|
||||
@ -171,7 +171,7 @@ Signed-off-by: Gregory CLEMENT <gregory.clement@bootlin.com>
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ gpio = <&gpio1 1 GPIO_ACTIVE_HIGH>;
|
||||
+ gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ thermal-zones {
|
||||
|
||||
@ -82,7 +82,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 50 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 50 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
|
||||
@ -94,7 +94,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 51 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 51 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -101,7 +101,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 33 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 33 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -108,7 +108,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 36 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 36 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -116,7 +116,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 36 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 36 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -106,7 +106,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 9 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 9 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -105,7 +105,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 14 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -121,7 +121,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 14 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -125,7 +125,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 28 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 28 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -139,7 +139,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 28 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 28 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -80,7 +80,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 8 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -120,7 +120,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 14 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -118,7 +118,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpiomm 0 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpiomm 0 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -134,7 +134,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpiomm 0 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpiomm 0 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -87,7 +87,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 14 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -21,7 +21,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 3 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 3 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -45,7 +45,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 29 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 29 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -92,7 +92,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 32 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 32 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -106,7 +106,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 47 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -126,7 +126,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 32 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 32 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -159,7 +159,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 32 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 32 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -102,7 +102,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 14 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
|
||||
@ -114,7 +114,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 5 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -93,7 +93,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 14 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 14 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
|
||||
@ -105,7 +105,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 5 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -90,7 +90,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 5 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 5 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -113,7 +113,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 33 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 33 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -150,7 +150,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 33 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 33 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -96,7 +96,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 33 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 33 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -107,7 +107,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 33 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 33 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -99,7 +99,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 33 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 33 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -110,7 +110,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&gpio 33 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio 33 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
};
|
||||
|
||||
@ -130,7 +130,7 @@
|
||||
regulator-name = "usb_vbus";
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
gpio = <&pio 22 GPIO_ACTIVE_LOW>;
|
||||
gpios = <&pio 22 GPIO_ACTIVE_LOW>;
|
||||
enable-active-high;
|
||||
};
|
||||
|
||||
|
||||
@ -31,7 +31,7 @@
|
||||
regulator-name = "fan";
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
gpio = <&pio 28 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&pio 28 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
};
|
||||
|
||||
|
||||
@ -65,7 +65,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&pio 9 GPIO_ACTIVE_LOW>;
|
||||
gpios = <&pio 9 GPIO_ACTIVE_LOW>;
|
||||
regulator-boot-on;
|
||||
};
|
||||
};
|
||||
|
||||
@ -57,7 +57,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
|
||||
gpio = <&pio 12 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&pio 12 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
@ -56,7 +56,7 @@
|
||||
regulator-name = "fan";
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
gpio = <&pio 28 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&pio 28 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
regulator-boot-on;
|
||||
};
|
||||
@ -66,7 +66,7 @@
|
||||
regulator-name = "usb_vbus";
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
gpio = <&pio 12 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&pio 12 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
regulator-boot-on;
|
||||
};
|
||||
|
||||
@ -36,7 +36,7 @@
|
||||
regulator-min-microvolt = <3300000>;
|
||||
regulator-max-microvolt = <3300000>;
|
||||
regulator-always-on;
|
||||
gpio = <&pio 5 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&pio 5 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
leds {
|
||||
|
||||
@ -15,7 +15,7 @@
|
||||
regulator-name = "wifi";
|
||||
regulator-min-microvolt = <12000000>;
|
||||
regulator-max-microvolt = <12000000>;
|
||||
gpio = <&pio 4 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&pio 4 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
@ -15,7 +15,7 @@ preinit_mount_udpu() {
|
||||
|
||||
if [ -b "${mmcdev}p4" ]; then
|
||||
mkdir /misc
|
||||
mount -t f2fs ${mmcdev}p4 /misc
|
||||
mount -o compress_algorithm=zstd -t f2fs ${mmcdev}p4 /misc
|
||||
[ -f "/misc/$BACKUP_FILE" ] && {
|
||||
echo "- Restoring configuration files -"
|
||||
tar xzf "/misc/$BACKUP_FILE" -C /
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
# Copyright (C) 2016 LEDE-Project.org
|
||||
#
|
||||
|
||||
RAMFS_COPY_BIN='fw_printenv fw_setenv'
|
||||
RAMFS_COPY_BIN='fw_printenv fw_setenv mkfs.f2fs fdisk'
|
||||
RAMFS_COPY_DATA='/etc/fw_env.config /var/lock/fw_printenv.lock'
|
||||
REQUIRE_IMAGE_METADATA=1
|
||||
|
||||
|
||||
@ -42,7 +42,7 @@ udpu_do_part_check() {
|
||||
# Format the /misc part right away as we will need it for the firmware
|
||||
printf "Formating /misc partition, this make take a while..\n"
|
||||
udpu_part_prep ${emmc_dev}p4
|
||||
if mkfs.f2fs -q -l misc ${emmc_dev}p4; then
|
||||
if mkfs.f2fs -q -l misc -O extra_attr,compression ${emmc_dev}p4; then
|
||||
printf "/misc partition formated successfully\n"
|
||||
else
|
||||
printf "/misc partition formatting failed\n"
|
||||
@ -66,7 +66,7 @@ udpu_do_misc_prep() {
|
||||
format_count=0
|
||||
while [ "$format_count" -lt "1" ]; do
|
||||
udpu_part_prep ${emmc_dev}p4
|
||||
mkfs.f2fs -q -l misc ${emmc_dev}p4
|
||||
mkfs.f2fs -q -l misc -O extra_attr,compression ${emmc_dev}p4
|
||||
if ! mount ${emmc_dev}p4 /misc; then
|
||||
umount -l /misc
|
||||
printf "Failed while mounting /misc\n"
|
||||
@ -92,7 +92,7 @@ udpu_do_initial_setup() {
|
||||
# Prepare /root partition
|
||||
printf "Formating /root partition, this may take a while..\n"
|
||||
udpu_part_prep ${emmc_dev}p3
|
||||
mkfs.f2fs -q -l rootfs ${emmc_dev}p3 && printf "/root partition reformated\n"
|
||||
mkfs.f2fs -q -l rootfs -O extra_attr,compression ${emmc_dev}p3 && printf "/root partition reformated\n"
|
||||
}
|
||||
|
||||
udpu_do_regular_upgrade() {
|
||||
|
||||
@ -42,6 +42,10 @@ CONFIG_CC_HAVE_SHADOW_CALL_STACK=y
|
||||
CONFIG_CC_HAVE_STACKPROTECTOR_SYSREG=y
|
||||
CONFIG_CPU_LITTLE_ENDIAN=y
|
||||
CONFIG_DMA_DIRECT_REMAP=y
|
||||
CONFIG_F2FS_FS_COMPRESSION=y
|
||||
# CONFIG_F2FS_FS_LZ4 is not set
|
||||
# CONFIG_F2FS_FS_LZO is not set
|
||||
CONFIG_F2FS_FS_ZSTD=y
|
||||
CONFIG_FRAME_POINTER=y
|
||||
CONFIG_GCC_SUPPORTS_DYNAMIC_FTRACE_WITH_REGS=y
|
||||
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
|
||||
|
||||
@ -192,7 +192,7 @@
|
||||
enable-active-high;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
sata2_power: regulator@2 {
|
||||
@ -205,7 +205,7 @@
|
||||
enable-active-high;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
gpio = <&gpio0 2 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -204,7 +204,7 @@
|
||||
enable-active-high;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
gpio = <&gpio0 5 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio0 5 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
sata1_power: regulator@1 {
|
||||
@ -217,7 +217,7 @@
|
||||
enable-active-high;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
sata2_power: regulator@2 {
|
||||
@ -230,7 +230,7 @@
|
||||
enable-active-high;
|
||||
regulator-always-on;
|
||||
regulator-boot-on;
|
||||
gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@ -151,7 +151,7 @@
|
||||
regulator-name = "vbus-usb0";
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
gpio = <&gpio1 20 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio1 20 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
regulator-always-on;
|
||||
};
|
||||
@ -161,7 +161,7 @@
|
||||
regulator-name = "vbus-usb1";
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
gpio = <&gpio1 21 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio1 21 GPIO_ACTIVE_HIGH>;
|
||||
enable-active-high;
|
||||
regulator-always-on;
|
||||
};
|
||||
|
||||
@ -151,7 +151,7 @@
|
||||
regulator-name = "usb-vbus";
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
gpio = <&gpio1 21 GPIO_ACTIVE_LOW>;
|
||||
gpios = <&gpio1 21 GPIO_ACTIVE_LOW>;
|
||||
regulator-always-on;
|
||||
};
|
||||
};
|
||||
|
||||
@ -205,7 +205,7 @@
|
||||
};
|
||||
|
||||
&usb3_1_vbus {
|
||||
gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpio1 12 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
&usb3_1_vbus_pins {
|
||||
|
||||
@ -124,7 +124,7 @@
|
||||
regulator-name = "sata-power";
|
||||
regulator-min-microvolt = <12000000>;
|
||||
regulator-max-microvolt = <12000000>;
|
||||
gpio = <&gpio1 20 GPIO_ACTIVE_LOW>;
|
||||
gpios = <&gpio1 20 GPIO_ACTIVE_LOW>;
|
||||
regulator-always-on;
|
||||
};
|
||||
};
|
||||
|
||||
@ -40,7 +40,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
enable-active-high;
|
||||
gpio = <&gpionb 19 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&gpionb 19 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
usb3_phy: usb3-phy {
|
||||
|
||||
@ -78,7 +78,7 @@
|
||||
regulator-name = "v_5v0_usb3_hst_vbus";
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
gpio = <&expander0 6 GPIO_ACTIVE_LOW>;
|
||||
gpios = <&expander0 6 GPIO_ACTIVE_LOW>;
|
||||
vin-supply = <&v_5v0>;
|
||||
};
|
||||
|
||||
|
||||
@ -68,7 +68,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
enable-active-high;
|
||||
gpio = <&cp2_gpio1 2 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&cp2_gpio1 2 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
cp2_usb3_0_phy0: cp2_usb3_phy0 {
|
||||
@ -82,7 +82,7 @@
|
||||
regulator-min-microvolt = <5000000>;
|
||||
regulator-max-microvolt = <5000000>;
|
||||
enable-active-high;
|
||||
gpio = <&cp2_gpio1 3 GPIO_ACTIVE_HIGH>;
|
||||
gpios = <&cp2_gpio1 3 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
cp2_usb3_0_phy1: cp2_usb3_phy1 {
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user